Skip to content

Command Reference

Kosh provides a small, focused set of commands designed for secure, local-first credential management. This page documents all CLI commands, their arguments, behaviors, and examples.

CommandPurpose
kosh initInitialize a new encrypted vault
kosh addAdd a new credential interactively
kosh listList stored credentials
kosh get <label> <user>Retrieve (decrypt) a credential
kosh search <label> [user] / kosh <label>Adaptive fuzzy search
kosh delete <id>Permanently delete a credential
kosh generate [flags] <label> <user>Generate a strong password
kosh update <id>Update fields of an existing credential
kosh completionGenerate shell autocompletion script

Initialize a new encrypted SQLite vault.

Terminal window
kosh init

Prompts you for:

  • Master password (used to derive your encryption key via Argon2id)

Notes:

  • The vault is created as a local SQLite file.
  • Master password cannot be changed after initialization.

Interactively add a new credential to the vault.

Terminal window
kosh add

Interactive prompts:

  • Label
  • Username
  • Password (hidden input)
  • Confirm password

If a credential with the same label + username already exists, it will be securely overwritten.


Show a list of saved credentials.

Terminal window
kosh list [flags]
FlagDescription
-l, --labelFilter credentials whose label contains the given string
-u, --userFilter credentials whose user contains the given string
Terminal window
kosh list
Terminal window
kosh list --label github
Terminal window
kosh list --user alice
Terminal window
kosh list --label github --user alice

Shows entries where both label and user contain the given substrings.


Retrieve (decrypt) a credential by exact match.

Terminal window
kosh get <label> <user>

Behavior:

  1. Prompts for master password.
  2. Decrypts the credential.
  3. Copies the password to your clipboard.
Terminal window
kosh get github alice

Search your vault using Kosh’s adaptive fuzzy matching.

Terminal window
kosh search <label> [user]

Returns the best-scoring match based on fuzzy distance, prefix/substring boosts, recency, and usage frequency.

Searches across both label and username:

Terminal window
kosh search git

Any argument that doesn’t match an existing command name also falls back to search, so this is equivalent:

Terminal window
kosh git

Provide separate fuzzy queries for label and user:

Terminal window
kosh search github alice

Equivalent to fuzzy-matching both fields independently.


Permanently delete a credential from the vault.

Terminal window
kosh delete <id>

Process:

  1. Prompts for master password
  2. Shows the exact credential to be deleted
  3. Requires a typed confirmation phrase (delete <label> <user>)
  4. Securely deletes the row and overwrites freed memory

Warning: Deletion is irreversible.

Terminal window
kosh delete 42

Update fields (label, user, or secret) of an existing credential.

Terminal window
kosh update <id>

Process:

  1. Prompts for master password
  2. Shows the exact credential to be updated
  3. Prompts for which field to update
  4. Requires a typed confirmation phrase
  5. Updates the specified field in the vault

Warning: Updates are irreversible.

Terminal window
kosh update 42

Generate a strong random password and store it securely in the vault.

Terminal window
kosh generate [flags] <label> <user>

The generated password is:

  • Cryptographically random
  • Encrypted before storage
  • Automatically copied to your clipboard
ArgumentDescription
labelIdentifier for the credential (e.g. github, email). Ignored with --no-save.
userUsername or account associated with the credential. Ignored with --no-save.
FlagDescriptionDefault
-l, --length intLength of the generated password20
--upperInclude uppercase letters (A–Z)true
--lowerInclude lowercase letters (a–z)true
--digitInclude digits (0–9)true
--symbolInclude special symbolstrue
-r, --require stringEnforce minimum character counts per group (e.g. upper=2,digit=3)
-n, --no-saveGenerate password but do not save it to the vaultfalse
GroupDescription
lowerLowercase letters
upperUppercase letters
digitDigits
symbolSpecial symbols
  • If the total required characters exceed the requested length, Kosh will prompt to automatically increase it.
  • If --no-save is used, the password is generated and copied to clipboard without requiring a label, user, or master password.
  • If a credential with the same label + user already exists, overwrite confirmation is required.
  • Master password verification is required before saving (unless --no-save is used).
  • Requirements cannot contradict disabled character groups (e.g. --symbol=false with symbol=2 is invalid).
Terminal window
kosh generate github alice
Terminal window
kosh generate -l 32 email personal
Terminal window
kosh generate --require "upper=2,lower=10,digit=5,symbol=3" email alice
Terminal window
kosh generate --symbol=false server root

Generate a temporary password without saving

Section titled “Generate a temporary password without saving”
Terminal window
kosh generate --no-save

Generate the autocompletion script for the specified shell.

Terminal window
kosh completion [shell]

Supported shells: bash, zsh, fish, powershell.

Run kosh completion --help for shell-specific installation instructions.


CodeMeaning
0Success
1General error
2Invalid arguments
3Authentication failure (wrong master password)
4Vault not found

  • Clipboard handling is platform-specific but abstracted away internally.
  • Vault is always local; Kosh never performs any network requests.
  • Works on Linux, macOS, and Windows.