Skip to Content
AgentsCLIInstall the CLI

Install the CLI

The Gavana CLI is a JSON-first command-line client for the Canvas API. It reads and changes canvases, works with assets and Elements, plans campaign Work, explicitly runs Recipes and deterministic Image Actions, queues image and video generation, and observes every execution through shared Run and Job interfaces — without opening a browser.

You need it when an agent on your computer should bring images from your disk onto a canvas, save generated images and videos to a folder, or run batches and scheduled jobs. Chatting with Gavana in ChatGPT or Claude does not need it.

Prerequisites

Node.js 20 or newer.

node --version

Install

npm install -g @gavana.ai/cli gavana auth login --base-url https://app.gavana.ai

To try it without installing, run the same package through npx:

npx -y @gavana.ai/cli auth login --base-url https://app.gavana.ai npx -y @gavana.ai/cli doctor

The same commands are on the Developer tab of Settings → Connect an agent in Gavana, under Gavana CLI.

The package installs four commands: gavana, gavana-canvas, and — as compatibility aliases for existing scripts — craftboard and craftboard-canvas. They are the same program.

Use of the published CLI is subject to the current Gavana Terms of Service .

Choose a login

SituationUse
Interactive use on your own machineBrowser OAuth: gavana auth login
Interactive, inspection onlygavana auth login --read-only
CI, a server, or anything unattendedA Personal Access Token via stdin
An agent runs the login for youBrowser OAuth with a longer wait: gavana auth login --timeout 600
A remote or headless machinegavana auth login --no-browser, then open the printed URL yourself

Browser OAuth (default)

gavana auth login

The CLI starts a loopback callback server, opens Gavana, asks you to approve exact scopes, and returns through the callback. Nothing is typed anywhere. It prints the sign-in URL to stderr and says how long it will wait — 180 seconds unless you pass --timeout SECONDS. The page is already open; do not open the URL a second time. If the wait runs out, run the command again and use the new URL it prints.

gavana auth login --read-only

Read-only requests only canvas:read, asset:read, and element:read. The default requests canvas:read, canvas:write, asset:read, element:read, element:write, image:generate, video:generate, and job:manage — every permission except reference:extract. The resulting CLI authorization has no automatic expiry. When that machine should no longer have access, run gavana auth logout, or revoke it in Gavana under Settings → Connect an agent → Connected, where a browser login is listed with an OAuth badge.

Each installation registers itself under a stable id kept in the config file, so logging in again on the same machine replaces that machine’s previous authorization instead of piling up a new one.

On macOS the resulting revocable token goes into Keychain under the service name ai.gavana.cli. Other platforms — and any custom config path — use a mode-0600 file.

Personal Access Token via stdin

Never pass a token as a command argument. Use the prompt for your shell so the value never reaches shell history or the process table.

zsh (the default shell on current macOS):

read -rs 'GAVANA_AGENT_TOKEN?Paste Agent Access token: '; printf '\n'; printf '%s' "$GAVANA_AGENT_TOKEN" | gavana auth login --base-url 'https://app.gavana.ai' --token-stdin; unset GAVANA_AGENT_TOKEN

Bash:

read -rsp 'Paste Agent Access token: ' GAVANA_AGENT_TOKEN; printf '\n'; printf '%s' "$GAVANA_AGENT_TOKEN" | gavana auth login --base-url 'https://app.gavana.ai' --token-stdin; unset GAVANA_AGENT_TOKEN

PowerShell:

$secureToken = Read-Host 'Paste Agent Access token' -AsSecureString $token = [System.Net.NetworkCredential]::new('', $secureToken).Password $token | gavana auth login --base-url 'https://app.gavana.ai' --token-stdin Remove-Variable token, secureToken

Verify

gavana auth status

A working setup reports authenticated, the profile name, the base URL, a masked token, the auth type, and the granted scopes. If a scope you expected is missing, the token or consent did not include it — fix that now rather than discovering it mid-task.

gavana doctor

doctor runs these checks and exits 0 only if all pass:

CheckPasses when
nodeNode.js major version is 20 or newer
credentialsA token is available from the config file, Keychain, environment, or command line
base_urlThe base URL is HTTPS, or HTTP on a loopback address
authenticationGavana accepts the credential
api_compatibilityThe server speaks API v1. A server that does not report its version passes as unverified

If credentials fails it tells you where it looked. If authentication fails it includes the error code and the requestId — that is the one value to share with support. When authentication succeeds, doctor also reports your CLI version, the granted scopes, and — if Gavana recommends a newer CLI — the exact npm install -g @gavana.ai/cli@VERSION command to update.

On macOS, credentials can fail with keychain_inaccessible even though you are logged in: the token is in Keychain, but this process is not allowed to read it. Run the command from a terminal that Keychain trusts, or supply GAVANA_AGENT_TOKEN for that one invocation. Do not log in again — the credential is not missing.

Named profiles

Profiles keep accounts and environments apart. Each has its own token and base URL.

gavana auth login --profile work gavana auth login --profile staging --base-url https://staging.example.com gavana config list # all profiles, which is active, which are configured gavana config get work # one profile's details gavana config use work # change the active profile gavana canvas list --profile staging # one-off override

Profile precedence, highest first: the --profile flag, then GAVANA_PROFILE, then CRAFTBOARD_PROFILE, then the stored active profile, then default.

Profile names are 1–64 characters, must start with a letter or digit, and may contain letters, digits, dots, underscores, and dashes.

Log out of one profile without touching the others:

gavana auth logout --profile staging

logout revokes the token at Gavana when the profile was created by browser OAuth, then removes the profile locally. Removing the last profile deletes the config file.

Where configuration lives

~/.config/gavana/agent.json

The directory is created with mode 0700 and the file with mode 0600, written atomically through a temporary file.

Resolution order for the config path:

  1. GAVANA_AGENT_CONFIG_FILE
  2. CRAFTBOARD_AGENT_CONFIG_FILE
  3. $XDG_CONFIG_HOME/gavana/agent.json
  4. ~/.config/gavana/agent.json

When no explicit config file is requested, the CLI also falls back to reading a legacy ~/.config/craftboard/agent.json. A Gavana config always wins.

macOS Keychain. On macOS the token is stored in Keychain rather than the file, and the file records credentialStore: "macos-keychain" instead. Keychain is skipped — and the token written to the mode-0600 file — when GAVANA_CLI_KEYCHAIN=false, when a custom config file path is set, or when XDG_CONFIG_HOME is set.

Environment variables

VariableEffectLegacy alias
GAVANA_BASE_URLOverrides the saved base URLCRAFTBOARD_BASE_URL
GAVANA_AGENT_TOKENOverrides the saved tokenCRAFTBOARD_AGENT_TOKEN
GAVANA_PROFILESelects the profileCRAFTBOARD_PROFILE
GAVANA_AGENT_CONFIG_FILEOverrides the config file pathCRAFTBOARD_AGENT_CONFIG_FILE
GAVANA_CLI_KEYCHAINSet to false to skip macOS Keychain—
GAVANA_WEBHOOK_SECRETDefault webhook signing secretCRAFTBOARD_WEBHOOK_SECRET
GAVANA_ENABLE_LEGACY_CAMPAIGN_COMMANDSSet to true to re-enable the retired campaign groupCRAFTBOARD_ENABLE_LEGACY_CAMPAIGN_COMMANDS

Environment values override saved configuration; explicit flags override both.

Shell completion

gavana completion zsh >> ~/.zshrc gavana completion bash >> ~/.bashrc gavana completion fish > ~/.config/fish/completions/gavana.fish

With no shell argument, the CLI infers one from $SHELL and falls back to zsh.

First real command

gavana canvas list --limit 5 --output human

Then pick a canvas handle from the result and read it:

gavana canvas get canvas:OWNER_UID:CANVAS_ID --detail summary

For new work, create one canvas for the task and keep its handle. Every later write, import, and generation for that task names it — there is no shared default canvas:

TASK_CANVAS=$(gavana canvas create --title "Bottle launch" \ --idempotency-key "bottle-launch-task-20261005" --jq '.canvas.handle' -r)

Security notes

  • Never paste a literal cba_… token into a shell command. Use the stdin prompt above.
  • Do not copy the CLI profile into a repository, a chat message, or a support request. Share only the requestId from an error.
  • Use a distinct token per machine so you can revoke access individually.
  • HTTPS is required for remote origins. Plain HTTP is accepted only for localhost, 127.0.0.1, and ::1.
  • Installing the CLI does not install the local MCP adapter. gavana mcp config local prints its definition; see Connect a client when you need it.
Last updated on