context

Contexts are named connection profiles stored in $XDG_CONFIG_HOME/ferriskey/config.toml. Each holds a server URL, a client ID, an optional client secret, and a realm. The first context you add becomes the active one.

ferris-ctl context <subcommand>

These subcommands only read and write the config file. They make no network call and need no login. They honor -o.

context add

Add a new context. The first context added is marked active. Adding a name that already exists is an error: remove the old context first.

ferris-ctl context add <name> --url <url> --client-id <id> [--client-secret <secret>] [--realm <realm>]
ArgumentRequiredDescription
<name>yesUnique context name
--urlyesFerrisKey server URL
--client-idyesOAuth2 client identifier
--client-secretnoClient secret (omit for public clients). An empty value counts as none
--realmin practice, yesThe realm the CLI signs in to, and the default realm for commands

--realm is optional for context add, but realm, client, and user commands fail with auth realm is required on a context that has none. Only login falls back to master. See Authentication.

ferris-ctl context add staging \
  --url https://auth.staging.example.com \
  --client-id ferris-ctl \
  --realm master

The secret goes into config.toml in clear text, and a value passed on the command line stays in your shell history. For a CI job, prefer FERRISKEY_CLIENT_SECRET (see Authentication).

context list

List all configured contexts. The active context is marked with *.

ferris-ctl context list

Table columns: ACTIVE, NAME, URL, CLIENT_ID, REALM. The JSON and YAML forms carry name, url, client_id, realm, and is_current. The client secret is never printed.

context current

Show the active context: its name, URL, client ID, realm, and whether it is current. The secret is not shown.

ferris-ctl context current

context use

Switch the active context. The name must exist.

ferris-ctl context use <name>
ArgumentRequiredDescription
<name>yesContext to activate

context remove

Remove a stored context. If it was active, the active marker is cleared. A saved login session in credentials.toml is left alone; run logout to delete it.

ferris-ctl context remove <name>
ArgumentRequiredDescription
<name>yesContext to remove

context path

Print the path to the configuration file.

ferris-ctl context path

With -o json or -o yaml the path comes back under a path key.