# Jitsu CLI

`jitsu-cli` is the command-line interface for Jitsu. It manages workspace
configuration objects (destinations, streams, connections, …) and runs the
[Functions](/docs/functions) dev workflow.

The CLI calls the same [Management API](/docs/api) the Jitsu UI uses.

## Install

```bash
npm i -g jitsu-cli
```

Verify:

```bash
jitsu-cli --version
```

## First steps

```bash
jitsu-cli login                                # log in once
jitsu-cli set-default-workspace my-workspace   # optional — saves you typing -w on every command
jitsu-cli config destinations list             # uses the saved workspace
```

See [Authentication](/docs/jitsu-cli/auth) for login options and [Config](/docs/jitsu-cli/config) for
managing configuration objects.

## Command groups

| Command | Description |
|---|---|
| [`login` / `logout` / `whoami`](/docs/jitsu-cli/auth) | Authenticate and inspect session |
| [`set-default-workspace` / `unset-default-workspace`](/docs/jitsu-cli/auth#default-workspace) | Pin a workspace so `-w` becomes optional |
| [`config <noun> <verb>`](/docs/jitsu-cli/config) | Manage workspaces, destinations, streams, services, functions, connections, … |
| `init` / `build` / `test` / `deploy` | Functions extension dev workflow — see [Functions SDK](/docs/functions/sdk) |

## Global options

Most commands accept these:

- `-h, --host <host>` — Jitsu host (default `https://use.jitsu.com`). Overrides the saved auth file.
- `-k, --apikey <keyId:secret>` — API key. Overrides the saved auth file.
- `-w, --workspace <id-or-slug>` — Target workspace. Falls back to the default workspace if set.
- `-o, --output <format>` — Output format for read commands (e.g. `json`, `yaml`, `table`).

When `--host` and `--apikey` are both omitted, the CLI uses the credentials
saved by `jitsu-cli login`.