--- title: Tabstack CLI | Tabstack description: Use the full Tabstack API from your terminal. The Tabstack CLI is a single, dependency-free binary for browser automation, web research, and structured extraction, built for shell workflows and CI. --- The Tabstack CLI brings every Tabstack capability to your terminal: markdown and structured extraction, AI generation, browser automation, and web research. It’s a single static binary with no runtime dependencies, so it drops cleanly into shell scripts, Makefiles, and CI pipelines. Output is human-readable when you run it in a terminal and switches to JSON automatically when piped, so the same command reads well by hand and parses cleanly in a script. The CLI is open source on [GitHub](https://github.com/Mozilla-Ocho/tabstack-cli). --- ## Install Install the latest release with the install script: Terminal window ``` curl -fsSL https://tabstack.ai/install.sh | sh ``` This downloads the right prebuilt binary for your platform (macOS, Linux, Windows) and puts `tabstack` on your `PATH`. Verify the install: Terminal window ``` tabstack --version ``` Tip Prefer to build from source or install with Go? See the [project README](https://github.com/Mozilla-Ocho/tabstack-cli) for `go install` and source-build instructions. --- ## Authenticate You’ll need a Tabstack API key first ([get one at tabstack.ai](https://tabstack.ai)). Log in once and the key is saved to your config file: Terminal window ``` tabstack auth login # prompts for your API key tabstack auth status # shows how the key is being resolved ``` The CLI resolves your API key in this order of precedence: 1. `--api-key` flag 2. `TABSTACK_API_KEY` environment variable 3. Config file at `~/.config/tabstack/config.toml` (created with `0600` permissions) For CI and scripts, set the environment variable instead of logging in: Terminal window ``` export TABSTACK_API_KEY="sk_..." ``` --- ## Commands ### Extract markdown Convert any URL to clean markdown: Terminal window ``` tabstack extract markdown https://example.com --metadata ``` ### Extract structured JSON Pull structured data from a page against a JSON schema: Terminal window ``` tabstack extract json https://example.com --schema @schema.json ``` ### Generate with AI Generate structured output from a page using natural-language instructions plus a schema: Terminal window ``` tabstack generate json https://example.com \ --instructions "Extract the product name, price, and availability" \ --schema @schema.json ``` ### Browser automation Drive a browser with a natural-language task: Terminal window ``` tabstack agent automate "Find the price of the Pro plan" --url https://example.com ``` ### Web research Run a multi-source research task: Terminal window ``` tabstack agent research "latest developments in quantum computing" --mode balanced ``` ### Interactive automation Pause an automation to supply input mid-run (logins, forms), then resume by request ID: Terminal window ``` tabstack agent automate "Log in and download the latest invoice" \ --url https://example.com --interactive tabstack agent input \ --data '{"fields":[{"ref":"field1","value":"yes"}]}' ``` See the [interactive mode guide](/guides/interactive-mode/index.md) for the full pause/resume flow. --- ## Common options These flags work across the commands above: | Flag | Description | | ------------------------------- | ------------------------------------------------------------------------------------------------------------ | | `--effort {min\|standard\|max}` | Trade speed against capability. See [effort levels](/guides/effort-levels/index.md). | | `--geo ` | Route the request through a country (ISO 3166-1 alpha-2). See [geotargeting](/guides/geotargeting/index.md). | | `--nocache` | Bypass the cache and fetch fresh. | | `-o, --output {pretty\|json}` | Force the output format (auto-detected by default). | | `--timeout ` | Request timeout, e.g. `30s`. | | `--no-color` | Disable colored output. | --- ## Input handling The `--schema`, `--instructions`, and `--data` flags all accept three input forms: - A **literal string**, like `--instructions "Extract the title"` - A **file** with `@`, like `--schema @schema.json` - **stdin** with `-` (like curl), as in `--schema -` Terminal window ``` cat schema.json | tabstack extract json https://example.com --schema - ``` --- ## Output and exit codes Output auto-detects context: pretty for terminals, JSON when piped. Pipe straight into `jq`: Terminal window ``` tabstack extract markdown https://example.com | jq . ``` Exit codes make the CLI safe to branch on in scripts: | Code | Meaning | | ---- | -------------------------------------------- | | `0` | Success | | `1` | Runtime / network error | | `2` | Usage / invalid input (e.g. missing API key) | | `3` | API error or task failure | Terminal window ``` if tabstack extract json "$URL" --schema @schema.json > out.json; then echo "extracted" else echo "failed with exit $?" fi ``` --- ## Next steps - [API Reference](/api/index.md). Full parameter and response details for every endpoint. - [Schema design](/guides/schema-design/index.md). Write schemas for `extract json` and `generate json`. - [Effort levels](/guides/effort-levels/index.md). Tune speed vs. capability. - [Interactive mode](/guides/interactive-mode/index.md). Handle logins and forms mid-automation.