> For the complete documentation index, see [llms.txt](https://docs.kick.co/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.kick.co/ai/developer-tools/cli/cli-reference.md).

# Reference

Use this page when you need exact CLI behavior for credentials, workspace selection, output formats, exit codes, or finding current commands.

### Find all commands

The CLI's built-in help is the source of truth for the current command list and flags.

Start at the root:

```
kick --help
```

Then inspect a command group:

```
kick transactions --help
kick reports --help
```

For command-specific flags, run `--help` on the command:

```
kick reports profit-loss --help
kick transactions find --help
```

This avoids stale docs when commands or flags change.

### Credential lookup order

The CLI resolves credentials in this order:

1. `--token <value>`
2. `KICK_PAT`
3. `KICK_API_TOKEN`
4. OS keychain from `kick login`
5. `~/.config/kick/credentials`

`KICK_API_TOKEN` is the older environment variable name. Prefer `KICK_PAT`.

### Workspace selection

List workspaces:

```
kick workspaces list
```

Run a command in a workspace:

```
kick --workspace <workspace-id> transactions find --limit 10
```

If you work across multiple clients, pass `--workspace` explicitly. This is safer than relying on a remembered default.

### Common command examples

These examples are not a complete command list. Use `kick --help` and command-specific `--help` output for the current list.

Authentication and context:

```
kick login
kick whoami
kick auth status
kick logout
```

Workspace lookup:

```
kick workspaces list
kick workspaces get <id>
```

Transaction lookup:

```
kick --workspace <workspace-id> transactions find --limit 10
kick --workspace <workspace-id> transactions get <id>
```

Reports:

```
kick --workspace <workspace-id> reports profit-loss
kick --workspace <workspace-id> reports balance-sheet
kick --workspace <workspace-id> reports trial-balance
```

Activity:

```
kick --workspace <workspace-id> activity list
kick --workspace <workspace-id> activity logs
```

Local MCP server:

```
kick --workspace <workspace-id> mcp serve
```

### Output modes

* `--output auto` - table in a terminal, structured output when piped.
* `--output table` - human-readable table.
* `--output json` - formatted JSON.
* `--output json-compact` - compact JSON for scripts and agent contexts.
* `--output yaml` - YAML.

Data goes to stdout. Diagnostics, progress messages, and errors go to stderr.

For examples, see [Kick CLI use case library](/ai/cli/cli-use-case-library.md) and [additional workflows](/ai/developer-tools/cli/cli-example-workflows.md).

### Exit codes

* `0` - success
* `1` - generic failure
* `2` - usage error
* `3` - network error
* `4` - authentication or authorization error
* `5` - not found
* `6` - rate limited
* `130` - interrupted

### Safety reminders

* Use read-only commands for lookup and reporting.
* Use write commands only when the workflow needs them.
* Keep PATs out of source control and shared docs.
* Confirm workspace and entity IDs before running commands on client data.
* Treat generated output as a draft until an accountant reviews it.

For more detail, see [Permissions and Security](/ai/permissions-and-security.md) and [CLI Troubleshooting](/ai/troubleshooting/cli-troubleshooting.md).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.kick.co/ai/developer-tools/cli/cli-reference.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
