Skip to content

ButterIX v1 is out: versions, multiple languages, Ask AI, and a per-site MCP server, all built in. →

CLI deployment and API keys

Log in with an organization API key, and biti deploy packs your project, uploads it to the platform, waits for the build, and prints the URL. Works locally and in any CI.

Create an API key

Open organization settings

In the dashboard, go to "Organization settings → API Keys" (requires the admin role).

Generate a key

Enter a recognizable name (for example "GitHub Actions") and click generate. The key starts with biti_ and is shown only once — save it to your password manager or CI secret store right away.

API keys belong to the organization and act with the editor role: they can deploy, switch production, and edit content, but can't manage members, domains, or other keys. Deleting a key immediately revokes every CLI and CI that uses it. The list shows each key's prefix and when it was last used.

Log in

biti login

The CLI prompts you to paste the key, verifies it against the platform's /api/v1/whoami, and saves the credentials to ~/.config/bitidocs/credentials.json (under XDG_CONFIG_HOME if set, with file mode 600).

biti login --token biti_xxxxxxxxxxxxxxxx

The CLI connects to the ButterIX hosted platform by default.

No login needed — just set environment variables:

export BITI_TOKEN=biti_xxxxxxxxxxxxxxxx

When BITI_TOKEN is set, it takes precedence over saved credentials.

Deploy

biti deploy --site acme-payments --message "Publish v1.2 docs"
Output
  ButterIX · biti

◆ Packing .…
◆ Uploading 412 KB to https://console.butterix.com…
  queued
  building
✔ Published 94 pages in 6.1s

  https://acme-payments-sites.butterix.com
[dir]stringDefault .
Project directory.
--sitestring
Site slug. If omitted, infers it from the hostname of instances[0].url in docs.yml (acme-payments-sites.butterix.com → acme-payments).
--previewboolean
Create a preview deployment that doesn't affect the production URL and gets its own <site>--<short id> URL.
--messagestringDefault Deployed with biti CLI
Deployment message, shown in the dashboard's deployment list.

What happens

Validate config

Reads docs.yml; if the config has errors, stops and suggests running biti check first.

Pack

Packs the project directory into a gzip tarball, skipping node_modules, .git, .biti, dist, .DS_Store, and files that may hold credentials, such as .env, .npmrc, and SSH private keys (they are listed). The platform accepts uploads up to 200 MB.

Upload

POST /api/v1/sites/<site>/deployments, which returns the deployment id.

Wait for the build

Polls the deployment status every second and prints status changes; on success prints the URL, if it fails or is canceled, prints the error and exits with a non-zero status.

Network errors, rate limits, and platform restarts (5xx) while polling are retried automatically. The command gives up only after 2 minutes without a valid response. By then the upload has already succeeded and the build may still be running, so check the deployment list in the dashboard before deploying again.

Builds run on the platform, so you don't need build output on your machine. Running biti check --strict locally before deploying catches problems in seconds instead of waiting for a platform build to fail.

Sync with the online editor

biti deploy checks whether changes were published from the online editor since your last deploy or pull.

SituationResult
No new online changesDeploys right away
None of the files changed online were changed locallyLists the changes, merges them into your folder, and continues deploying
The same file changed on both sides, in different placesMerges line by line into your folder, keeping both sides' changes, and continues deploying
The same place changed on both sidesStops, marks those files with !, and leaves your files alone. Run biti pull and settle the conflicts
No sync record (.biti/sync.json, for example in CI)Stops without merging

biti pull --dry-run only lists what would change. biti deploy --force overwrites the online changes with your local content.

Settle conflicts

biti pull marks both versions in files that conflict and merges everything else:

<<<<<<< local
  - url: https://api.example.com/v1
=======
  - url: https://api.example.com/v2
>>>>>>> online

Edit the text to what you want and remove the marker lines, or take one side:

biti resolve . --online                    # take the online side everywhere
biti resolve . openapi/api.yml --local     # keep your side of this file

Files that can't be merged by line, such as images, and files deleted online but edited locally keep your version; the online version is in .biti/conflicts/. Choose a side with biti resolve; without an option, the files are kept as they are now.

Until every conflict is settled, biti deploy won't publish and biti pull won't pull again. biti deploy --force publishes your side.

In the editor, the number on the Files button counts uncommitted drafts. An orange dot next to it means changes published online haven't been pulled to the command line yet; open the menu to see the files.

Deploy from CI

GitHub Actions

Publish to production on pushes to main, and create previews for pull requests:

.github/workflows/docs.yml
name: Docs
on:
  push:
    branches: [main]
  pull_request:

jobs:
  deploy:
    runs-on: ubuntu-latest
    env:
      BITI_TOKEN: ${{ secrets.BITI_TOKEN }}
      BITI_API: https://console.butterix.com
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with:
          node-version: 22
      - run: npm install -g bitidocs
      - run: biti check --strict
      - if: github.event_name == 'push'
        run: biti deploy --site acme-payments --message "${{ github.event.head_commit.message }}"
      - if: github.event_name == 'pull_request'
        run: biti deploy --site acme-payments --preview --message "PR #${{ github.event.number }}"

GitLab CI

.gitlab-ci.yml
docs:
  image: node:22
  variables:
    BITI_API: https://console.butterix.com
  script:
    - npm install -g bitidocs
    - biti check --strict
    - biti deploy --site acme-payments --message "$CI_COMMIT_TITLE"
  rules:
    - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH

Add BITI_TOKEN to your CI secrets.

If your repository is on GitHub, you can skip CI entirely and let the platform connect to the repo — pushes and pull requests trigger builds automatically. See Git deployments.

Call the API directly

The CLI is just a thin wrapper around the platform API. In environments without Node.js, you can do the same thing with curl:

POST/sites/:site/deployments
tar --exclude=node_modules --exclude=.git --exclude=dist -czf site.tgz .
curl -X POST https://api.butterix.com/v1/sites/acme-payments/deployments \
  -H "Authorization: Bearer $BITI_TOKEN" \
  -H "Content-Type: application/gzip" \
  -H "x-biti-preview: 1" \
  --data-binary @site.tgz

Then poll Get deployment until status is ready.