Skip to content

knosh update

Refresh the commands directory with the bundled file-defined commands shipped in this Knosh release.

Synopsis

knosh update [--dry-run] [--no-install]

Description

update walks the bundled commands shipped inside the Knosh JAR and reconciles each one with the configured commandsDir (default ~/.config/knosh/commands/). For each bundled command:

  • If the bundled file is missing a parseable version: it is ignored.
  • If the on-disk copy is absent, the bundled copy is installed. Pass --no-install to skip this step.
  • If the on-disk copy is present but is missing or has an unparseable version:, it is assumed user-modified and is left alone.
  • If the bundled version: is newer than the on-disk version:, the on-disk copy is overwritten.
  • Otherwise the on-disk copy is left alone.

Run knosh update after upgrading Knosh to pick up newly shipped bundled commands and improvements to existing ones, without touching commands you have customised.

Options

--dry-run
Print the actions that would be taken without writing any files.
--no-install
Skip installing bundled commands that are not yet on disk. Only update existing files.

Output

One line per bundled command summarising the action:

  • Installed: <name> (<version>) — file was new on disk and was written.
  • Updated: <name> (<old> → <new>) — file was overwritten with a newer bundled copy.
  • Skipped: <name> (already <version>) — on-disk version is equal or newer.
  • Skipped: <name> (user-modified) — on-disk file has no parseable version:.
  • Skipped: <name> (--no-install) — file is missing on disk and --no-install was supplied.
  • Skipped: <name> (bundled has no version) — bundled file is missing or has an unparseable version: (this is a Knosh bug; please report it).

With --dry-run, "Installed" and "Updated" messages are prefixed with [dry-run] Would.

Example

knosh update
# Updating /Users/alice/.config/knosh/commands
# Installed: review-plan.md (0.2.0)

Dry-run preview before upgrading:

knosh update --dry-run
# Updating /Users/alice/.config/knosh/commands
# [dry-run] Would update: review-plan.md (0.1.0 → 0.2.0)

See Also