Install the Scheduler Zero CLI
Run the sz CLI with npx, bunx, pnpm dlx or Yarn, install it globally, pin versions, and check your Node.js setup.
# Install the Scheduler Zero CLI
The Scheduler Zero command-line interface is published on npm as **`@scheduler-zero/sz`**. The executable is **`sz`**; `scheduler-zero` is also available after installation. The package declares Node.js 18 or later and contains a bundled Node executable, so running the published package does not require the Scheduler Zero repository, workspace packages, or Bun's build tools.
## Run without a global install
Choose the package runner you already use:
| Package manager | Command |
| --- | --- |
| npm | `npx --yes @scheduler-zero/sz@latest --help` |
| Bun | `bunx @scheduler-zero/sz@latest --help` |
| pnpm | `pnpm dlx @scheduler-zero/sz@latest --help` |
| Yarn | `yarn dlx @scheduler-zero/sz@latest --help` |
`yarn dlx` requires a Yarn version that supports `dlx`. The examples in these guides use `npx` or an installed `sz`; use the same arguments with another runner. Package runners download and cache the published package. `--yes` suppresses npm's package-install prompt; it does not approve Scheduler Zero access.
Check the installed package's version:
```bash
npx --yes @scheduler-zero/sz@latest --version
bunx @scheduler-zero/sz@latest --version
```
For interactive use, follow [the CLI quickstart](/cli/quickstart). For repeatable automation, pin a version you have tested rather than relying on `latest`:
```bash
npx --yes @scheduler-zero/sz@0.2.1 whoami --json
```
## Install globally
A global install gives you the short `sz` command:
```bash
npm install --global @scheduler-zero/sz
sz --version
sz --help
```
Equivalent installs are `bun add --global @scheduler-zero/sz`, `pnpm add --global @scheduler-zero/sz`, and `yarn global add @scheduler-zero/sz` for Yarn versions with global-install support. Your package manager's global executable directory must be on `PATH`. If `sz` is not found, use a package runner while correcting your package manager's PATH configuration.
To update an npm global install, run the install command again. To remove it:
```bash
npm uninstall --global @scheduler-zero/sz
```
Removing the package does not revoke a saved API key. Use [logout and revocation](/cli/authentication) before removing an installation when you want to end its access.
## Install in a scripts project
You can make the CLI a development dependency in your own automation project:
```bash
npm install --save-dev --save-exact @scheduler-zero/sz@0.2.1
```
Invoke `sz` from that project's package scripts, where the package manager adds local executables to PATH. Commit the package-manager lockfile to keep the chosen package version repeatable. Do not commit local credentials or put a literal API key into `package.json`.
## Choose the environment
The default API is `https://api.schedulerzero.com`; browser login uses `https://app.schedulerzero.com`. Normal users do not need to set either address.
`--base-url` or `SCHEDULER_ZERO_API_URL` changes API requests, while `SCHEDULER_ZERO_APP_URL` changes browser login. They are independent: changing the API origin does not automatically move browser consent. For a self-hosted or preview environment, configure both to the matching deployment and use a credential issued there. Browser login requires HTTPS, with HTTP allowed only for localhost development.
See [environment variables and configuration](/cli/reference) for precedence and [troubleshooting installation](/cli/troubleshooting) for version-resolution errors. The [npm package](https://www.npmjs.com/package/@scheduler-zero/sz) is the distribution source; the [command reference](/cli/commands) describes what the CLI currently implements.