Sanka CLI

Install and use the official command-line tool for Sanka’s public CRM and AI APIs: auth, profiles, records, workflows, and AI helpers.

Overview

Sanka CLI is a thin command-line wrapper around Sanka’s public APIs. Business logic stays on the server; the CLI handles token storage and refresh, profile and config, building requests for CRM and workflow endpoints, table or JSON output, and optional polling for long-running workflow runs.

Install

From GitHub (recommended until the first PyPI release):
Bash
uv tool install "git+https://github.com/sankaHQ/sanka-cli.git"
Bootstrap script:
cURL
curl -fsSL https://raw.githubusercontent.com/sankaHQ/sanka-cli/main/scripts/install.sh | sh
The script tries PyPI first and falls back to the GitHub repo if the package is not published yet.After the first PyPI release:
Bash
uv tool install sanka-cli
Homebrew (published tap: sankaHQ/homebrew-cli):
Bash
brew tap sankaHQ/cli
brew install sankaHQ/cli/sanka
If you installed an earlier preview from sankaHQ/tap (the old sankaHQ/homebrew-tap repo), remove the old formula and untap it first. Homebrew cannot keep two sanka formulae from different taps installed at the same time.
Bash
brew uninstall sanka
brew untap sankaHQ/tap
brew tap sankaHQ/cli
brew install sankaHQ/cli/sanka
For local development from a checkout:
Bash
uv tool install .

Authenticate

Create a Developer API access token and refresh token in Sanka, then save them locally (tokens are stored in the system keychain when available):
Bash
sanka auth login --access-token "<ACCESS_TOKEN>" --refresh-token "<REFRESH_TOKEN>"
Check the active profile and session:
Bash
sanka auth status
Clear stored tokens for a profile:
Bash
sanka auth logout

Profiles

List configured profiles and switch the active profile:
Bash
sanka profiles list
sanka profiles use prod

CRM records

The CLI exposes companies, contacts, deals, and tickets with list, get, create, update, and delete. Pass JSON inline or from a file with @path/to/file.json.
Bash
sanka companies list
sanka companies get <company-id>
sanka contacts get <contact-id>
sanka deals create --data @deal.json
sanka tickets delete <ticket-id>
get, update, and delete accept --external-id when resolving by external id.

Workflows

Bash
sanka workflows list
sanka workflows get <workflow-ref>
sanka workflows run <workflow-ref>
sanka workflows run <workflow-ref> --wait
Use --wait to poll until the run finishes (with --poll-interval and --timeout as needed).

AI helpers

Bash
sanka ai score company <record-id>
sanka ai score deal <record-id> --score-model-id <score-model-id>
sanka ai enrich company <record-id> --force-refresh
sanka ai enrich company --seed-name "Acme" --seed-url "https://acme.example" --dry-run
When using seed fields instead of a record id, --dry-run is required.

Global options and output

Top-level options:
  • --profile — profile name
  • --base-url — override API base URL for the command
  • --output table|json — output format
By default the CLI uses table output on a TTY and JSON otherwise. Override per command:
Bash
sanka --output json companies list

Environment overrides

These override stored profile values without persisting them:
  • SANKA_PROFILE
  • SANKA_BASE_URL (default API base is https://api.sanka.com when not set in config)
  • SANKA_ACCESS_TOKEN
  • SANKA_REFRESH_TOKEN

Source and docs