Configuration
The config file, the active organization and project, and the environment variables that override both.
The config file
One YAML file, at ~/.config/shortspan/config.yaml. The directory is created with 0700 permissions.
api_host: https://shortspan.dev
active_org: acme
active_project: 9f2c1e04-7b3a-4d51-8e6f-2a9c4b1d7e30
active_project_name: Production| Key | Meaning |
|---|---|
| Which deployment to talk to. Also the keyring lookup key for your token. |
| The organization slug commands act in. |
| The project id, not its slug - project routes bind by id. |
| Cached for display, so listing your context needs no request. |
Reading and writing it
shortspan config list
shortspan config get api_host
shortspan config set api_host https://shortspan.internal.example.comConfig commands run before the authentication gate, so config set api_host works before you have signed in anywhere. Requiring a token in order to set the host would strand every self-hosted user.
The active context
Almost every command acts on a project. Rather than naming it each time, the CLI keeps a current one.
shortspan org list # organizations you belong to
shortspan org use acme
shortspan project list # projects in the active organization
shortspan project use productionproject use takes a slug and stores the resolved id, so renaming a project in the console does not silently break your local context.
Without an active project you get a direct instruction rather than a confusing 404:
no active project. Run 'shortspan project use <slug>'Environment variables
These override the config file for a single invocation, which is what a CI runner needs when it cannot write one.
| Variable | Effect |
|---|---|
| Use this token instead of the keyring. |
| Talk to this host instead of the configured one. |
| Suppress the background update notice. Set it in CI. |
| Keep the config file, auth cache and update check in this directory instead of |
| Drop panels, colour and tips. Output stays tabular and stable for scripts. Same as |
| Render the full terminal presentation even when output is redirected, for capturing documentation or a screenshot. |
# A one-off against staging without disturbing your saved context
SHORTSPAN_API_HOST=https://staging.internal shortspan secret listThere is also a --host flag on every command, which does the same thing for one invocation.
Using the CLI in automation
- 1
Mint a scoped token
In the console under API tokens, or with
shortspan token create. Give it only the abilities the job needs - a deploy job usually needssecrets:readand nothing else.bashshortspan token create ci-deploy --abilities secrets:read --abilities ssh:use - 2
Store it as a secret in your CI provider
The token is shown once, at creation. There is no way to read it again afterwards.
- 3
Set the context explicitly in the job
A CI runner has no saved config, so name the organization and project every run rather than relying on a default.
bashshortspan org use acme shortspan project use production - 4
Inject rather than reveal
Use
runorsecret runso values never enter the job log. CI providers mask known secret values, but they cannot mask something they were never told about.bashshortspan run api-production -- ./deploy.sh
Every request from CI is audited with the token identity and source address, so a token behaving unusually is visible in the audit log alongside human activity.
Exit codes
Commands that wrap another process - run, secret run, aws --exec - propagate the wrapped process's exit code rather than replacing it. A failing deploy script fails the build.
| Code | Meaning |
|---|---|
| Success. |
| The CLI itself failed - not authenticated, resource not found, permission denied. |
*n* | The wrapped process's own exit code, passed through unchanged. |
Diagnostic output goes to stderr, so shortspan secret get X > file writes only the value.
Something here wrong or missing? Tell us.