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.
All commands
Section titled “All commands”| Command | Purpose | Master password |
|---|---|---|
kosh init |
Initialize the active profile’s vault | prompted twice |
Credentials
Section titled “Credentials”| 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 |
Profiles
Section titled “Profiles”| 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 |
The kosh shorthand
Section titled “The kosh shorthand”Any argument that is not a known subcommand is treated as a search query, so the search
subcommand is implied:
kosh github alice # same as: kosh search github aliceRun with no arguments at all, Kosh opens the interactive search picker:
kosh # same as: kosh searchBecause of this, a credential label may not be the name of a subcommand — see
kosh add.
Global flags
Section titled “Global flags”| Flag | Description |
|---|---|
-h, --help |
Help for the command |
-v, --version |
Version of kosh (root command only) |
Exit codes
Section titled “Exit codes”| 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.
Environment
Section titled “Environment”| 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.