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 helpShow help and usage
kosh initInitialize a new encrypted vault
kosh addAdd or update a credential
kosh listList stored credentials
kosh get <label> <user>Retrieve (decrypt) a credential
kosh search <query> / kosh <query>Adaptive fuzzy search
kosh delete <id>Permanently delete a credential

Display help, available commands, and usage details.

Terminal window
kosh help

Initialize a new encrypted SQLite vault in the current directory.

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.

Add a new credential or update an existing one.

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.


Below is a drop-in command reference section for kosh generate, written to match the style, tone, and structure of your existing documentation. You can paste this directly into the same page.


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

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

The generated password is:

  • Cryptographically random
  • Encrypted before storage
  • Automatically copied to your clipboard

  • label Identifier for the credential (e.g. github, email). Must not conflict with an existing command name.

  • user Username or account associated with the credential.


-length int
Length of the generated password (default: 20)
-upper
Include uppercase letters (A–Z) (default: true)
-lower
Include lowercase letters (a–z) (default: true)
-digit
Include digits (0–9) (default: true)
-symbol
Include special symbols (default: true)
-require string
Enforce minimum character counts per group.
Format: group=count[,group=count...]
GroupDescription
lowerLowercase letters
upperUppercase letters
digitDigits
symbolSpecial symbols

  • If the total required characters exceed the requested password length, Kosh will prompt to automatically increase the length.

  • If a credential with the same label + user already exists:

    • Overwrite confirmation is required
    • A typed confirmation phrase is required
  • Master password verification is required before saving.


Terminal window
kosh generate github pluto
Terminal window
kosh generate -length 32 email personal
Terminal window
kosh generate -require "upper=2,lower=10,digit=4,symbol=2" bank main
Terminal window
kosh generate -symbol=false server root

  • Requirements cannot contradict disabled character groups (e.g. -symbol=false with symbol=2 is invalid).
  • Passwords are generated locally; no network access is ever used.
  • Clipboard handling is platform-specific but automatic.

If you want, I can also:

  • Add kosh generate to the command table at the top with a short purpose line
  • Normalize wording across all commands (add/get/generate consistency)
  • Produce a man-page (kosh-generate(1)) version of this section

List credentials stored in the vault.

Terminal window
kosh list
Terminal window
kosh list github

Matches label or user via simple substring matching.

Terminal window
kosh list --label github
kosh list --user pluto
Terminal window
kosh list --label github --user pluto

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


Retrieve (decrypt) a credential by exact match.

Terminal window
kosh get github pluto

Behavior:

  1. Prompts for master password.
  2. Decrypts the credential.
  3. Copies the password to your clipboard.

Search your vault using Kosh’s adaptive fuzzy matching.

Terminal window
kosh search git

Or use the shorthand:

Terminal window
kosh git

Searches across:

  • Label
  • Username

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

Provide separate fuzzy queries for label and user:

Terminal window
kosh search github pluto
kosh search mail personal

Equivalent to fuzzy-matching both fields independently.


Permanently delete a credential from the vault.

Terminal window
kosh delete 42

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.


Kosh uses standard exit code conventions:

  • 0 – success
  • 1 – general errors
  • 2 – invalid arguments
  • 3 – authentication failure (incorrect master password)
  • 4 – vault 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.