Scheduler Zero CLI documentation
Use the sz command-line interface with npx or bunx: browser login, API keys, workspace discovery, campaign reads, JSON scripting and CI.
# Scheduler Zero CLI documentation
The **Scheduler Zero CLI** is a command-line client for the authenticated Scheduler Zero API. Run the npm package **`@scheduler-zero/sz`** with `npx`, `bunx`, `pnpm dlx` or Yarn, or install it to use the short **`sz`** executable. Sign in through browser consent or a personal API key, discover your organizations and workspaces, and read campaigns from a terminal or script.
The CLI uses the same authorization model as the [REST API](/rest-api) and [MCP](/mcp). A credential is restricted to the approved access intersected with its owner's live permissions. The current CLI implements authentication and campaign reads; broader product write actions are documented in the REST and MCP references rather than implied by a permission list.
## Get started
```bash
npx --yes @scheduler-zero/sz@latest auth login
npx --yes @scheduler-zero/sz@latest workspaces list --json
npx --yes @scheduler-zero/sz@latest campaigns list --workspace YOUR_WORKSPACE_UUID --json
```
Replace the placeholder with a workspace UUID from your list. Login prints a browser URL and confirmation code. Compare the code, select your organization/workspaces and permission level, and click **Authorize CLI**. The CLI polls for the approved credential without a localhost callback. Opening the link alone never authorizes access.
Use `bunx @scheduler-zero/sz@latest auth login --no-browser` for SSH or manual browser opening. If you already have a key, supply `SCHEDULER_ZERO_API_KEY` through your shell or secret manager instead. The [quickstart](/cli/quickstart) walks through each step and its expected result.
## Documentation map
| Guide | What you will learn |
| --- | --- |
| [Install the CLI](/cli/installation) | Package runners, global/project installs, version pins and environment selection |
| [Quickstart](/cli/quickstart) | Browser approval, checking identity, finding IDs and inspecting campaigns |
| [Authentication](/cli/authentication) | Browser/device-style login, workspace grants, API-key precedence, storage, expiry and revocation |
| [Command reference](/cli/commands) | Every shipped command, its options, examples and underlying API operations |
| [Options and configuration](/cli/reference) | Environment variables, JSON/table output, workspace defaults and exit codes |
| [Scripting and CI](/cli/scripting) | Secret-managed keys, jq recipes, bounded pagination and repeatable automation |
| [Troubleshooting](/cli/troubleshooting) | Package resolution, login timeouts, permission failures and response shapes |
The command reference is generated from the same hand-written metadata used by `sz help`, with authored notes for behavior, examples and authorization. Run `sz campaigns list --help` or `sz auth login --help` for command-specific terminal help.
## Choose CLI, REST or MCP
| Need | Start here |
| --- | --- |
| Read account/workspace/campaign data from a terminal | [CLI quickstart](/cli/quickstart) |
| Build a typed integration or invoke broader product operations | [REST API reference](/rest-api/reference) |
| Give an AI client discoverable, callable product tools | [Connect an MCP client](/mcp/connect) |
| Understand live permissions and delegated access | [Authentication and authorization](/authentication) |
The CLI is distributed through [npm](https://www.npmjs.com/package/@scheduler-zero/sz). The [source repository](https://github.com/fundlevel-digital/scheduler-zero/tree/main/packages/cli) contains its command metadata and implementation. Package-manager release authentication is separate from your Scheduler Zero login.
## Markdown and agents
Use **Copy as Markdown** on a page to copy its complete text, or choose the Markdown link to download it. Text exports come from the same sources as these rendered guides and generated command pages:
- [CLI overview Markdown](/cli.md): this page.
- [CLI LLM index](/cli/llms.txt): all CLI guides and command links, with Markdown URLs.
- [Complete CLI text](/cli/llms-full.txt): all CLI guides and command reference bodies.
- [CLI command catalog](/cli/catalog.json): version, usages, options and descriptions for machine consumption.
- [Markdown documentation guide](/markdown): equivalent text formats for REST and MCP.
- [Site-wide llms.txt](/llms.txt) and [llms-full.txt](/llms-full.txt): the complete developer documentation.