---
title: CLI reference
subtitle: Every biti command, option, and environment variable.
description: biti CLI reference — options and examples for init, dev, check, eval, export, login, deploy, pull, translate, and components, plus exit codes and environment variables.
---

<Markdown src="/snippets/install-cli.mdx" />

```bash
biti --help        # list commands
biti <command> --help  # show a command's options
biti --version
```

Every command that accepts `[dir]` defaults to the current directory.

## biti init

Create a new docs project.

```bash
biti init [dir] [--title <title>] [--openapi <file>] [--skill]
```

<ParamField path="--title" type="string">Site title; generated from the directory name by default.</ParamField>
<ParamField path="--openapi" type="string">Copies this OpenAPI file to `openapi.yml` and generates two tabs, "Guides" and "API Reference".</ParamField>
<ParamField path="--from" type="string">Directory of an existing Fern / Mintlify project, copied whole into the new project. biti reads its `fern/docs.yml` or `docs.json` directly. See [Migrate from Fern](./migrate-from-fern.mdx).</ParamField>

<ParamField path="--skill" type="boolean">Writes the writing skill to `.claude/skills/butterix-docs` for coding agents such as Claude Code to use when editing the docs. In an existing project it only adds the skill, and leaves one that's already there as it is. See [Let coding agents edit your docs](../features/agents.mdx#let-coding-agents-edit-your-docs).</ParamField>

Generates `docs.yml`, `pages/introduction.mdx`, `pages/quickstart.mdx`, `assets/logo.svg`, `AGENTS.md`, and `.gitignore`. Exits with an error if the directory already contains `docs.yml` and `--skill` isn't given.

## biti dev

Preview the docs on your computer, with automatic reload when you edit. Run `biti login` first (or set `BITI_TOKEN`).

```bash
biti dev [dir] [-p, --port <port>]
```

<ParamField path="-p, --port" type="number" default="3000">Port.</ParamField>

- Pages are rendered by the ButterIX platform: biti syncs changes in your docs folder to the platform incrementally and serves the pages at `http://localhost:<port>`. Pages reload once a change has synced; CSS-only changes hot-swap styles without a full reload.
- The preview opens on your computer only. Every page carries a footer note saying it is a development-only preview, not for readers.
- Search and Ask AI work on the published site; in the development preview, clicking them shows a notice. [API playground](../api/try-it.mdx) requests work, but only to the public servers listed in your OpenAPI spec.
- Use `biti check` for a full check.

## biti check

Validate the config, navigation, MDX, links, API specs, and [skills](../features/agents.mdx#hosted-skills) without writing any files. The check runs on the platform, so run `biti login` first; in CI, set `BITI_TOKEN`.

```bash
biti check [dir] [--json] [--strict] [--review]
```

<ParamField path="--json" type="boolean">Output machine-readable JSON: `{ ok, pages, diagnostics: [{ severity, code, message, file, line, column, hint }] }`. Suited to CI and coding agents.</ParamField>
<ParamField path="--strict" type="boolean">Treat warnings as errors too.</ParamField>
<ParamField path="--review" type="boolean">Also list pages to [review](../features/page-review.mdx); with `--json` they are in `reviews`. Doesn't affect the exit code.</ParamField>

The exit code is 1 when there are errors (or warnings under `--strict`). Common diagnostics:

| Code | Level | Meaning |
|---|---|---|
| `config/schema` | Error | Wrong field type in `docs.yml`; the message includes the field path |
| `config/tab` | Error | The navigation references an undeclared tab |
| `nav/missing-page` | Error | A page file in the navigation doesn't exist |
| `nav/duplicate-slug` | Error | Two pages end up with the same URL |
| `api/load` | Error | The OpenAPI file doesn't exist or can't be parsed |
| `mdx/parse` | Error | MDX syntax error (unclosed tag, unescaped `{` / `<`) |
| `mdx/attribute` | Error | A prop value isn't a literal |
| `asset/missing` | Error | A referenced image or file doesn't exist |
| `link/broken` | Warning | Link to a nonexistent source file |
| `mdx/unknown-component` | Warning | Unknown component; only its children are rendered |
| `mdx/required-prop` | Warning | A component is missing a required prop |
| `mdx/tag` | Warning | A disallowed HTML tag was removed |
| `md/table-merge` | Warning | `>` / `^` in a table cell is neither written as a [merge](../writing/markdown.mdx#merged-cells) nor escaped |
| `page/review` | Warning | `owner`, `verified` or `review-every` is written wrongly, see [Page review](../features/page-review.mdx) |
| `icon/unknown` | Warning | No [icon](../components/icon.mdx#available-icons) has that name |
| `skill/invalid` | Error / warning | A skill in `.well-known/agent-skills/` doesn't meet the [requirements](../features/agents.mdx#hosted-skills) |
| `api/unsupported` | Warning | The file isn't OpenAPI or Swagger (for example AsyncAPI or OpenRPC), so this section has no content |
| `openapi/spec` | Warning | A problem in the OpenAPI spec (such as an unresolvable `$ref`) |

## biti eval

Lets AI answer the questions in `evals.yml` from the docs alone and grades the answers, see [Docs eval](../features/evals.mdx). Run `biti login` first; answering and grading use your own model key (see [Environment variables](#environment-variables)).

```bash
biti eval [dir] [--model <id>] [--min <percent>] [--site <slug>] [--report <file>] [--json]
biti eval [dir] --import --site <slug>
```

The exit code is 1 below the pass mark.

## biti export

Exports the docs published on the platform as Markdown or PDF. Run `biti login` first. See [Export and print](../features/export.mdx#command-line).

```bash
biti export [dir] [--site <slug>] [--format markdown|pdf] [--out <path>] [--only <name>] [--lang <code>] [--paper a4|letter]
biti export [dir] --list
```

## biti migrate

Prints the steps to move docs from another platform, or compares the old project with the new one. See [Migration tool](./migrate.mdx).

```bash
biti migrate <source> [--check <dir>] [--report <file>] [--base <path>] [--ignore <glob>] [--json]
```

`<source>` is the folder of the old project, or the `https://` address of the old site. With `--check`, the exit code is 1 while something is missing.

## biti login

Save platform credentials.

```bash
biti login [--api <url>] [--token <token>]
```

<ParamField path="--api" type="string" default="https://console.butterix.com">Platform URL; the ButterIX hosted platform by default.</ParamField>
<ParamField path="--token" type="string">Organization API key; prompted interactively when omitted.</ParamField>

Credentials are verified against `/api/v1/whoami` and saved to `~/.config/bitidocs/credentials.json`.

## biti deploy

Package the project, upload it, and publish it to the hosted platform.

```bash
biti deploy [dir] [--site <slug>] [--preview] [--message <msg>]
```

<ParamField path="--site" type="string">Site slug; defaults to the first subdomain label of `instances[0].url`.</ParamField>
<ParamField path="--preview" type="boolean">Create a preview deployment.</ParamField>
<ParamField path="--message" type="string">Deployment message.</ParamField>

See [CLI deployment and API keys](../deploy/cli-deploy.mdx) for details.

## biti pull

Pull the source files online into a local folder. A folder that doesn't exist is created; a folder synced before is merged line by line, keeping changes from both sides.

```bash
biti pull [dir] [--site <slug>] [--clean | --merge] [--force] [--dry-run]
```

<ParamField path="--site" type="string">Site slug; defaults to the first subdomain label of `instances[0].url`. Required when pulling into a new folder.</ParamField>
<ParamField path="--clean" type="boolean">If the folder holds something else, empty it first (keeps `.git`). It is emptied only after the download succeeds.</ParamField>
<ParamField path="--merge" type="boolean">If the folder holds something else, pull into it anyway. Files with the same path but different content become conflicts; the rest stays and is uploaded by the next deploy.</ParamField>
<ParamField path="--force" type="boolean">Take the online version of every file, overwriting local edits.</ParamField>
<ParamField path="--dry-run" type="boolean">List what would change without writing anything.</ParamField>

When the folder isn't empty and isn't this site's docs (never synced, and its `docs.yml` doesn't match), you're asked whether to empty it first, pull into it, or cancel. Where nobody can answer, such as in CI, pass `--clean` or `--merge`.

See [Sync with the online editor](../deploy/cli-deploy.mdx#sync-with-the-online-editor) for merging and conflicts.

## biti translate

Incrementally translate pages into `translations/<lang>/` with AI.

```bash
biti translate [dir] [--to <langs>] [--provider <provider>] [--model <model>] [--only <path>]
```

<ParamField path="--to" type="string">Target languages, comma-separated; defaults to every language other than the source.</ParamField>
<ParamField path="--provider" type="anthropic | deepseek | openrouter" default="anthropic">Model provider.</ParamField>
<ParamField path="--model" type="string">Model id; defaults to the provider's default model.</ParamField>
<ParamField path="--only" type="string">Only translate pages whose path contains this string.</ParamField>

See [Internationalization](../features/i18n.mdx#translate-automatically-with-biti-translate) for details.

## biti components

List every MDX component, alias, and prop.

```bash
biti components [--json]
```

```text title="Output (excerpt)"
<Callout> (<Note> <Info> <Warning> <Success> <Error> <Danger> <Tip> <Check> <Launch>) callout
  Highlights important information. Aliases set the intent: …
  intent enum: note | info | warning | success | error | tip | check | launch | danger — Color and default icon.
  title string — Bold heading above the content.
  icon icon — Icon spec (Font Awesome / lucide:name / URL / <svg>). icon={false} hides the icon.
```

## Environment variables

| Variable | Used by | Description |
|---|---|---|
| `BITI_TOKEN` | `dev`, `check`, `eval`, `export`, `deploy`, `pull` | Organization API key; takes precedence over saved credentials |
| `BITI_API` | `login` and commands that need a login | Platform URL; the ButterIX hosted platform `https://console.butterix.com` by default |
| `XDG_CONFIG_HOME` | `login` and commands that need a login | Directory containing the credentials file; defaults to `~/.config` |
| `ANTHROPIC_API_KEY` | `translate`, `eval` | Anthropic key |
| `DEEPSEEK_API_KEY` | `translate`, `eval` | DeepSeek key |
| `OPENROUTER_API_KEY` | `translate`, `eval` | OpenRouter key |
| `BITI_AI_PROVIDER` | `eval` | Provider for answering and grading; defaults to the one whose key is set |
| `BITI_AI_MODEL` | `eval` | Model that answers |
