bhatti setup
Configure the CLI’s API endpoint and key.
Synopsis
Section titled “Synopsis”bhatti setup [—url URL] [—token KEY]
Description
Section titled “Description”Writes the API endpoint and key to ~/.bhatti/config.yaml and tests
the connection by listing sandboxes. The auth test hits
GET /sandboxes (an authenticated endpoint), so a bad key fails
immediately instead of appearing to succeed.
With no flags, runs interactively — prompts for endpoint and key,
masks the key as you type. With --url and --token, runs
non-interactively. Use the latter form for agents, CI scripts, and
provisioning tools.
You usually don’t need to run this on the server itself: the install
script (curl -fsSL bhatti.sh/install | sudo bash) creates the
admin user and writes the config to your $SUDO_USER’s
~/.bhatti/config.yaml automatically. Run setup on a different
machine that you want to drive the server from, or to switch your
local CLI to a different bhatti server.
Examples
Section titled “Examples”Interactive (the default)
Section titled “Interactive (the default)”bhatti setupAPI endpoint [http://localhost:8080]: https://api.bhatti.shAPI key: <input is hidden>Saved to /home/alice/.bhatti/config.yamlTesting connection... ✓ authenticated (3 sandboxes)
Enable completions: echo 'source <(bhatti completion zsh)' >> ~/.zshrcNon-interactive (agents, CI, provisioners)
Section titled “Non-interactive (agents, CI, provisioners)”bhatti setup --url https://api.bhatti.sh --token bht_abc123Saved to /home/alice/.bhatti/config.yamlTesting connection... ✓ authenticated (3 sandboxes)The completions hint is suppressed — there’s no human reading the output anyway. If the connection test fails, the command exits non-zero so your provisioner can detect the failure.
Options
Section titled “Options”API endpoint URL. Sets the prompt’s default. With --token set
too, the prompt is skipped entirely and setup writes
immediately.
API key. With --url set too, the prompt is skipped and setup
writes immediately.
The auth test always runs. If you need to write the config without
contacting a server (pre-baking an image, for example), edit
~/.bhatti/config.yaml directly — it’s just two YAML keys.
See Global flags for --url,
--token (the global versions of these — they override config but
don’t write to it; setup’s flags are the persisting form),
--json, --timing, --data-dir.
Configuration file
Section titled “Configuration file”After setup, your config looks like:
api_url: https://api.bhatti.shauth_token: bht_abc123def456...At runtime, this can be overridden with --url, --token,
BHATTI_URL, or BHATTI_TOKEN. See
Configuration precedence.
See also
Section titled “See also”bhatti version— check connection without changing configbhatti user create— create a user and get an API key (server-side, run by the operator)bhatti completion— shell completions- Configuration — full file format
- Self-hosting → adding teammates — the full flow for setting someone up against a remote bhatti