klim install
klim install installs one or more tools (positional) and/or every tool
in one or more packs (--pack). Each tool is installed via its
preferred system package manager — klim does not bundle any binaries.
klim install [tool...] [flags]At least one positional tool name or --pack is required.
Source precedence
Section titled “Source precedence”klim picks the package manager for each tool using this precedence (highest wins):
--source <pm>flag (per invocation)defaults.preferred_sourceinconfig.yaml(global default)- OS-priority fallback — first available manager from the per-OS
priority list (
brew → npmon macOS,winget → choco → scoop → npmon Windows,apt → snap → brew → npmon Linux)
If the preferred source has no package id for a particular tool, klim falls through to the next level rather than failing.
| Flag | Short | Description |
|---|---|---|
--source <pm> | Package manager: winget, choco, scoop, brew, apt, snap, npm | |
--pack <name> | Pack name to expand into a tool list (repeatable) | |
--dry-run | Print the plan without executing | |
--yes | -y | Skip the confirmation prompt |
--refresh | Ignore the scan cache and rescan PATH | |
--output <fmt> | text (default) or json |
Examples
Section titled “Examples”# Install two tools using the OS-default package managerklim install jq fzf
# Install everything in a curated packklim install --pack go-developer
# Force a specific package manager and skip the promptklim install jq --source brew --yes
# Combine multiple packs and preview the planklim install --pack rust-dev --pack web-dev --dry-run
# Machine-readable output for CI / scriptsklim install jq --output jsonBehavior
Section titled “Behavior”For each target:
- Already installed → skipped (listed under “Already installed” in
the plan summary, and as
skipped: already_installedin JSON). - Not in catalog → reported as a warning, skipped.
- No package on this OS → reported, skipped.
- No package manager available → reported, skipped.
- Otherwise → install command runs, output streams live to your terminal.
After execution klim invalidates its scan cache so subsequent commands
(klim list, klim info, klim security health) rescan PATH.
Exit codes
Section titled “Exit codes”| Code | Meaning |
|---|---|
| 0 | All targets succeeded (or were already installed) |
| 1 | Runtime error |
| 2 | Usage error (unknown source, unknown pack, no targets) |
| 3 | At least one install failed |
JSON output
Section titled “JSON output”--output json writes a single object to stdout. Human-readable
progress (the plan summary, package-manager output, success/failure
markers) goes to stderr — stdout is reserved for the final JSON
payload so it remains parseable for scripts and CI.
Schema (every field always present — empty arrays / false instead of missing keys for scripts and CI):
{ "action": "install", "dry_run": false, "planned": [ { "name": "jq", "display": "jq", "source": "brew", "cmd": ["brew", "install", "jq"] } ], "succeeded": ["jq"], "failed": [], "skipped": [ { "name": "fzf", "reason": "already_installed" } ], "errors": []}--output=json implies non-interactive — there’s no prompt.
See also
Section titled “See also”klim upgrade— bring installed tools to the latest versionklim remove— uninstall toolsklim import— bulk install from a manifest fileklim config— setdefaults.preferred_source