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
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 loginThe 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_xxxxxxxxxxxxxxxxThe CLI connects to the ButterIX hosted platform by default.
No login needed — just set environment variables:
export BITI_TOKEN=biti_xxxxxxxxxxxxxxxxWhen BITI_TOKEN is set, it takes precedence over saved credentials.
Deploy
biti deploy --site acme-payments --message "Publish v1.2 docs" ButterIX · biti
◆ Packing .…
◆ Uploading 412 KB to https://console.butterix.com…
queued
building
✔ Published 94 pages in 6.1s
https://acme-payments-sites.butterix.cominstances[0].url in docs.yml (acme-payments-sites.butterix.com → acme-payments).<site>--<short id> URL.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.
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.
| Situation | Result |
|---|---|
| No new online changes | Deploys right away |
| None of the files changed online were changed locally | Lists the changes, merges them into your folder, and continues deploying |
| The same file changed on both sides, in different places | Merges line by line into your folder, keeping both sides' changes, and continues deploying |
| The same place changed on both sides | Stops, 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
>>>>>>> onlineEdit 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 fileFiles 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:
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
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_BRANCHAdd 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:
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$ biti deploy --site acme-payments --message "Release v1.2"Then poll Get deployment until status is ready.