Skip to content
Kosh Docs

Command Reference

Every Kosh command at a glance, with global flags, exit codes and the default-command shorthand.

Kosh has a small, focused command set. This section documents each one in detail; the pages mirror kosh <command> --help, which is the authoritative source — run it any time you want to check something against your installed version.

Every command operates on the active profile only. See Profiles.


Command Purpose Master password
kosh init Initialize the active profile’s vault prompted twice
Command Purpose Master password
kosh add Interactively add a credential required
kosh generate Generate a random password and store it required, unless --no-save
kosh list Show a table of saved credentials not required
kosh get Copy a credential matched by exact label and user required
kosh search Copy a credential found by fuzzy search after a match
kosh update Update the label, user or secret of a credential required
kosh delete Permanently delete a credential by ID required
Command Purpose Master password
kosh use Switch the active profile not required
kosh profile List, create and delete profiles varies by subcommand
kosh copy Copy a credential into another profile the active profile’s
Command Purpose Master password
kosh completion Generate a shell autocompletion script not required
kosh help Help about any command not required

Any argument that is not a known subcommand is treated as a search query, so the search subcommand is implied:

Terminal window
kosh github alice # same as: kosh search github alice

Run with no arguments at all, Kosh opens the interactive search picker:

Terminal window
kosh # same as: kosh search

Because of this, a credential label may not be the name of a subcommand — see kosh add.


Flag Description
-h, --help Help for the command
-v, --version Version of kosh (root command only)

Code Meaning
0 Success
1 Any error — invalid arguments, wrong master password, vault not found, storage failure
130 Interrupted with Ctrl+C during a password prompt (terminal state is restored first)

Kosh does not currently use distinct exit codes per error class. To distinguish failures in a script, match on the message written to stderr — see Troubleshooting.


Variable Effect
KOSH_DEBUG Set to a truthy value (1, t, true) to enable structured debug logging on stderr

See Configuration & Files for on-disk layout and permissions.