Skip to content
Kosh Docs

kosh profile

List, create and delete the profiles kept under ~/.kosh/profiles.

Manage the profiles kept under ~/.kosh/profiles.

Terminal window
kosh profile [command]

Running kosh profile on its own prints help. Subcommands: list, create, delete.

To switch the active profile use kosh use; to copy a credential from one profile to another use kosh copy.


List the profiles stored under ~/.kosh/profiles.

Terminal window
kosh profile list [filter]

Arguments: zero or one — a substring filter on the profile name.

Profile Status
------- --------
> default active
work inactive
personal inactive

The active profile is marked with a green > pointer and an active status.

  • Only profile names are read, so no vault is opened and no master password is needed.
  • The filter ignores casekosh profile list WORK matches work_main.
  • This is the authoritative view of what your profiles are actually called. Because profile create cleans up names silently, it is worth checking here after creating one.
Terminal window
kosh profile list
kosh profile list work

Create a new profile, switch to it and set up its vault.

Terminal window
kosh profile create <profile>

Arguments: exactly one — the profile name.

Process: cleans up the name → rejects a name already in use (profile already exists) → prompts for the new master password twice → builds the vault → switches to the new profile.

The order matters: nothing is written to disk until the vault is built, so pressing Ctrl+C at either password prompt creates nothing and leaves the active profile alone.

This is the only command that cleans up a profile name. Accents are folded to ASCII, characters outside A–Z a–z 0–9 _ - space are deleted, whitespace runs become a single underscore, repeated _/- collapse, leading and trailing _/- are stripped, and the result is capped at 252 characters. Case is preserved.

The cleaned name is the real one — the filename, the output prefix, and what every other command must be given. You are not told that the name changed, so run kosh profile list afterwards to see what you got.

Two names are rejected outright:

Error Cause
invalid profile name The name cleans up to nothing — e.g. "" or $__##
profile name is reserved by the operating system The cleaned name is con, prn, aux, nul, com1com9 or lpt1lpt9 — rejected on every platform, not just Windows

Full rules and a worked-examples table: Naming profiles.

  • It switches to the new profile. If you want to stay where you were, run kosh use <old> afterwards.
  • kosh init is not needed afterwards — the vault is ready to use straight away.
  • Every profile has its own master password, independent of the others. Losing it permanently locks that profile’s vault, with no recovery mechanism.
  • The duplicate check ignores case. kosh profile create Work fails with profile already exists when work exists, on every platform — including Linux, where the filesystem would allow both.
  • Ctrl+C at the password prompt creates nothing. Persistent state is only touched once the vault has been built, so abandoning the command at either prompt leaves the config and the profiles directory untouched.
  • A failed creation rolls itself back. If building the vault fails, the partially created profile file is removed. The active profile is untouched — Kosh only switches once the vault exists — so you can retry the same name.
  • If the vault is built but the switch fails, you get <cause>: profile "<name>" was created but could not be activated. The profile and its vault are intact: run kosh use <name> to switch to it. Do not recreate it — the name is taken and the vault is complete.

The password prompts carry the new profile’s name, since that is what they concern. If creation then fails, the failure line appears under the profile that is still active:

(work) [?] enter master password:
(default) [✗] failed to initialize vault
Terminal window
kosh profile create work
kosh profile create work # add a credential to the new profile
kosh add

Delete a profile along with the vault file holding its credentials.

Terminal window
kosh profile delete <profile>

Arguments: exactly one — the profile name.

  1. Refuses if the profile does not exist (profile does not exist).
  2. Refuses to delete the active profile (cannot delete active profile) — switch away with kosh use first.
  3. Prompts for that profile’s own master password and verifies it, to prove ownership.
  4. Prints a caution block.
  5. Requires the exact phrase permanently delete <name> with credentials.
  • Deletion is permanent. The vault file is overwritten with cryptographically random bytes and synced to disk before it is removed — every credential in that profile is gone for good.

  • The name is matched ignoring case, and the profile is deleted under the spelling it is stored as. The active-profile guard folds case too, so deleting WORK while work is active is rejected.

  • If the target profile’s vault was never initialized, no master password is asked for — there is nothing to verify and no secrets in the file. Kosh reports vault is not initialized and goes straight to the confirmation gate. The caution block, typed phrase and random-byte overwrite still apply.

  • While Kosh works on the target profile, output lines carry the target’s name in the prefix rather than the active profile’s, so the password prompt cannot be mistaken for a request for the wrong password:

    (personal) [?] enter master password:
Terminal window
kosh profile delete work
kosh use default # switch away first if it is the active profile
kosh profile delete work