Collectivenix fleet

30 machines · 4 platform classes · 1 registry

Reference

cltv CLI

cltv is Collective's command line: switching, evaluation, caches, secrets, state and devices. Each command is declared in Nix and generated as its own executable. This reference is generated from those executables' --help, so it cannot drift from what they accept.

How commands are made

Commands are declared as a tree in pkgs/collective-scripts/cltv.nix with collective-lib's script framework. Branches are commandTrees, and leaves are bashScripts with typed options and a body:

kv = {  type = commandTree;  summary = "Manage the Collective KV store";  subcommands = {    create = {      type = bashScript;      summary = "Create a new KV store.";      opts = {        FORCE = {          short = "f";          long = "force";          switch = true;          description = "If set, overwrite any existing store";        };      };      body = ''        function main() {          ${log.info "…"}        }      '';    };  };};

From that, the framework generates:

Edited commands can be tried without a system switch: cltv script run --name NAME builds the scripts package from the checkout and runs one. The same package ships about a hundred helpers beyond cltv, including the agent checkout commands, tmux and window-manager helpers, and nod for Android.

cltv system env --get name                # this machine's registry namecltv nix eval outputs -e 'registry.lists.nodes'scripts/site/cli-help.sh                  # regenerate this page's reference

Switching

cltv switch

Rebuild and switch the current system with logging.

cltv switch [--all] [--cores BUILD_CORES] [--cached] [--check-jobs] [--cpu-profile CPU_PROFILE] [--drain-args DRAIN_ARGS] [--fallback FALLBACK] [--flakehub] [--no-tui] [--machines MACHINES] [--max-jobs MAX_JOBS] [--drain] [--no-archive] [--no-drain] [-q | --quiet] [--remote REMOTE] [--remote-cores REMOTE_CORES] [--repin-inputs] [--retry RETRY_SECONDS] [--seed] [--skip-seed] [--skip-update] [--system-architecture SYSTEM_ARCHITECTURE] [--uac] [--update] [--update-only] [--raw] [--no-work]
OptionDefaultMeaning
--allfalseSwitch every machine discovered from the flake matrix through cltv-daemon fleet orchestration.
--cores BUILD_CORES''Cores per local derivation (0 = all), overriding --cpu-profile.
--cachedfalseActivate the latest generation published by this machine's assigned prebuild cache instead of evaluating the flake locally.
--check-jobsfalseOnly show a read-only snapshot of local jobs at risk during activation; do not update, rebuild or switch.
--cpu-profile CPU_PROFILE''Local build parallelism (default fast): fast = 2 jobs x 8 cores, medium = 2 x 4, slow = 1 x 2, all = no limits (auto jobs, all cores), config = this machine's Nix settings. Profile cores are capped at this machine's CPU count.
--drain-args DRAIN_ARGS''Extra flags for caco node drain, split on whitespace, for example "--interrupt-runners" or "--runner-wait-secs 600". Fleet switches forward it.
--fallback FALLBACKnoneWith --flakehub, what to do without a newer FlakeHub generation: none (fail), missing (build normally when none is published or usable here, do nothing when it is not newer than the installed one) or always (build normally unless a newer one was activated). Also accepted as --fallback=MODE.
--flakehubfalseActivate the latest generation the FlakeHub machine-build workflow published for this machine (flakehub-generations branch, closure verified in FlakeHub Cache) instead of evaluating the flake locally. Refuses generations older than the installed one, like --cached.
--no-tuifalseDisable the fleet switch ratatui dashboard and print line updates instead.
--machines MACHINESComma-separated machine list to switch through cltv-daemon fleet orchestration.
--max-jobs MAX_JOBS''Local Nix build jobs (a number or auto), overriding --cpu-profile. With --remote and no override, 0: build only on the remote builder.
--drainfalseIf set, drain this node through Cacophony around activation. Off by default: nothing is drained, held or parked. With it, where caco has caco node drain, the new generation is built (or, with --cached, downloaded) first, the node is drained (new work held, idle runner listeners stopped once their jobs finish, local agents checkpointed and parked), the generation is activated, and caco node undrain runs whether or not activation succeeded.
--no-archivefalseSkip the pre-switch nix flake archive entirely. Only safe when the privileged rebuild can fetch every private flake input itself (or they are already in the store).
--no-drainfalseDeprecated no-op, accepted for backwards compatibility. Not draining is now the default; pass --drain to opt in.
-q | --quietfalseIf set, do not print build logs or stack traces.
--remote REMOTEIf set, build remotely on the given host or IP via ssh
--remote-cores REMOTE_CORES4The number of CPU cores to use on the remote builder. Only used if --remote is set.
--repin-inputsfalseForce the flake-input GC roots to be rebuilt even if the archive was skipped because every input was already present in the store.
--retry RETRY_SECONDSIf set, retry upon switch-failure after RETRY_SECONDS seconds.
--seedfalseIf set, seed the Attic binary cache after a successful/degraded-success switch by running scripts/seed-cache. Off by default.
--skip-seedfalseDeprecated no-op, accepted for backwards compatibility. Skipping the Attic cache seed is now the default; pass --seed to opt in.
--skip-updatefalseDeprecated no-op, accepted for backwards compatibility. Skipping flake input updates is now the default; pass --update to opt in.
--system-architecture SYSTEM_ARCHITECTURE'x86_64-linux'The architecture of the Collective system.
--uacfalseOn devbox nodes, once the switch and every post-switch step have succeeded, start devbox-windows-admin in the background so its single UAC prompt appears on the Windows desktop. Nothing waits for the consent. Other systems skip it with a notice; fleet switches forward it.
--updatefalseIf set, run the always-update input parser and all flake input updates (including the work flake update). Off by default: the existing flake.lock is used as-is.
--update-onlyfalseUpdate and publish only inputs marked cltv:always-update, then exit without rebuilding or activating. Takes precedence over switch, cached activation, fleet and seed options.
--rawfalseIf set, do not construct the build command. Instead run the command __COLLECTIVE_NIX_SWITCH_CMD.
--no-worktrueIf set, skip work-specific steps (flake update of private inputs, corp SSH key and access token).

Nix

cltv nix Nix-related system management

cltv nix cache flakehub status

Show FlakeHub token, release, machine builds and whether this system is cached.

cltv nix cache flakehub status

cltv nix cache prebuild status

Show scheduled prebuild state and published machine generations.

cltv nix cache prebuild status

cltv nix cache push

Commit, push, and tag to trigger cache build workflow.

cltv nix cache push [-b BUMP | --bump BUMP] [-m COMMIT_MSG | --message COMMIT_MSG] [-t EXPLICIT_TAG | --tag EXPLICIT_TAG]
OptionDefaultMeaning
-b BUMP | --bump BUMPpatchVersion bump type: patch (default), minor, or major.
-m COMMIT_MSG | --message COMMIT_MSG'[rapid commit; squash later]'Commit message.
-t EXPLICIT_TAG | --tag EXPLICIT_TAGAn explicit tag to use instead of auto-bumping.

cltv nix cache seed

Push the current system's Nix closure to the self-hosted Attic cache(s).

cltv nix cache seed [-c ONLY_CACHE | --cache ONLY_CACHE] [-p STORE_PATH | --path STORE_PATH]
OptionDefaultMeaning
-c ONLY_CACHE | --cache ONLY_CACHE''Only push to this cache handle (a cache node name). Default: push to all (mirror).
-p STORE_PATH | --path STORE_PATHA specific Nix store path to push. If not set, auto-detects the current system closure.

cltv nix cache status

Check health of the self-hosted Attic binary caches on the tailnet.

cltv nix cache status

cltv nix cache tag

Push a version tag to trigger the Build & Cache Collective workflow.

cltv nix cache tag [-b BUMP | --bump BUMP] [-t EXPLICIT_TAG | --tag EXPLICIT_TAG]
OptionDefaultMeaning
-b BUMP | --bump BUMPpatchVersion bump type: patch (default), minor, or major.
-t EXPLICIT_TAG | --tag EXPLICIT_TAGAn explicit tag to use instead of auto-bumping.

cltv nix eval home

Evaluate an expression in a Collective system's config root.

cltv nix eval home --expr EXPR [-d FLAKE_DIR | --flake-dir FLAKE_DIR] [--system-name SYSTEM_NAME] [--system-type SYSTEM_TYPE] [-u USERNAME | --username USERNAME]
OptionDefaultMeaning
-e EXPR | --expr EXPRrequiredThe expression to evaluate.
-d FLAKE_DIR | --flake-dir FLAKE_DIR'~/collective'The directory containing the system flake.
--system-name SYSTEM_NAME'<machine>'The name of the Collective system.
--system-type SYSTEM_TYPE'nixos'The type of the Collective system.
-u USERNAME | --username USERNAME''The username to operate over.

cltv nix eval outputs

Evaluate an expression in the Collective flake's outputs.

cltv nix eval outputs --expr EXPR [-d FLAKE_DIR | --flake-dir FLAKE_DIR]
OptionDefaultMeaning
-e EXPR | --expr EXPRrequiredThe expression to evaluate.
-d FLAKE_DIR | --flake-dir FLAKE_DIR'~/collective'The directory containing the system flake.

cltv nix eval system

Evaluate an expression in a Collective system's config root.

cltv nix eval system --expr EXPR [-d FLAKE_DIR | --flake-dir FLAKE_DIR] [--system-name SYSTEM_NAME] [--system-type SYSTEM_TYPE]
OptionDefaultMeaning
-e EXPR | --expr EXPRrequiredThe expression to evaluate.
-d FLAKE_DIR | --flake-dir FLAKE_DIR'~/collective'The directory containing the system flake.
--system-name SYSTEM_NAME'<machine>'The name of the Collective system.
--system-type SYSTEM_TYPE'nixos'The type of the Collective system.

cltv nix gc reap zombies nod

Reap GC-blocking zombies on nix-on-droid, including affected Herdr client bridges

cltv nix gc reap zombies nod

cltv nix rebuild

Rebuild the system from the given flake directory and system name.

cltv nix rebuild [-d FLAKE_DIR | --flake-dir FLAKE_DIR]
OptionDefaultMeaning
-d FLAKE_DIR | --flake-dir FLAKE_DIR'~/collective'The directory containing the system flake.

cltv nix repair store

Repair the Nix store

cltv nix repair store

cltv nix revert

Rebuild the system from the Nix store copy of the flake.

cltv nix revert
Useful for undoing a specialisation switch without picking up new changes.

cltv nix specialise

Switch to a system specialisation.

cltv nix specialise --specialisation SPECIALISATION
OptionDefaultMeaning
-s SPECIALISATION | --specialisation SPECIALISATIONrequiredSets SPECIALISATION to the value provided

cltv nix status

Show Attic prebuild state, published machine generations and FlakeHub state.

cltv nix status

cltv nix update inputs

Update marked flake inputs without switching; optionally select one input or defer publishing.

cltv nix update inputs [-d FLAKE_DIR | --flake-dir FLAKE_DIR] [--input INPUT_NAME] [--no-publish]
OptionDefaultMeaning
-d FLAKE_DIR | --flake-dir FLAKE_DIR'~/collective'The directory containing the system flake.
--input INPUT_NAME''Update only this input, which must be marked cltv:always-update. Omit to update all marked inputs.
--no-publishfalseLeave the updated lockfile uncommitted for review; do not run git add, commit, or push.

Running and scripting

cltv run

Run a package (or a specific binary from it) from the current Collective system flake pkgs.

cltv run [-b BIN_NAME | --bin BIN_NAME] [-d FLAKE_DIR | --flake-dir FLAKE_DIR] [--system-name SYSTEM_NAME] [--system-type SYSTEM_TYPE]
cltv run PACKAGE [-- PACKAGE_ARGS...]: run PACKAGE's main program from the current system configuration's pkgs setcltv run PACKAGE#BIN [-- BIN_ARGS...]: run bin/BIN from PACKAGE (everything after the first '#' selects the binary)cltv run PACKAGE -b BIN [-- BIN_ARGS...]: same, selecting the binary via the --bin flag
OptionDefaultMeaning
-b BIN_NAME | --bin BIN_NAME''Run a specific binary from the package's bin/ dir. Alternatively use the PACKAGE#BIN convention.
-d FLAKE_DIR | --flake-dir FLAKE_DIR'~/collective'The directory containing the system flake.
--system-name SYSTEM_NAME'<machine>'The name of the Collective system.
--system-type SYSTEM_TYPE'nixos'The type of the Collective system.

cltv script Build and run collective-scripts without a full system rebuild.

cltv script run

Build collective-scripts and run a script by name.

cltv script run --name SCRIPT_NAME [-d FLAKE_DIR | --flake-dir FLAKE_DIR] [--system-architecture SYSTEM_ARCHITECTURE]
OptionDefaultMeaning
-d FLAKE_DIR | --flake-dir FLAKE_DIR'~/collective'The directory containing the system flake.
-n SCRIPT_NAME | --name SCRIPT_NAMErequiredThe name of the script to run.
--system-architecture SYSTEM_ARCHITECTURE'x86_64-linux'The architecture of the Collective system.

cltv shell

Enter the Collective devshell DEVSHELL with 'nix develop' args NIX_DEVELOP_ARGS

cltv shell [-s DEVSHELL | --shell DEVSHELL]
cltv shell -s DEVSHELL [NIX_DEVELOP_ARGS...]: Enter the Collective devshell DEVSHELL with 'nix develop' args NIX_DEVELOP_ARGS
OptionDefaultMeaning
-s DEVSHELL | --shell DEVSHELLdefaultThe name of the devshell to enter.

cltv repl

Enter an augmented nix-repl with preloaded Collective system environment.

cltv repl [--flake] [-p | --public]
OptionDefaultMeaning
--flakefalseIf set, open against the current flake.
-p | --publicfalseIf set, open against the working copy of collective-public.

cltv template Project template management via flake templates

cltv template init

Initialise a new project from a template

cltv template init [-t TEMPLATE_NAME | --template TEMPLATE_NAME]
cltv template -t TEMPLATE_NAME: Project template management via flake templates
OptionDefaultMeaning
-t TEMPLATE_NAME | --template TEMPLATE_NAMEThe name of the template to initialise.

System, files and secrets

cltv system Manage the current Collective system

cltv system env

Get information about the current Collective system environment.

cltv system env [-s COLLECTIVE_SYSTEM | --system COLLECTIVE_SYSTEM] [-g ENV_VAR | --get ENV_VAR]
OptionDefaultMeaning
-s COLLECTIVE_SYSTEM | --system COLLECTIVE_SYSTEMselfThe system whose env to use, or 'self' to refer to the current system.
-g ENV_VAR | --get ENV_VARThe environment variable to get. One of: - name: The name of the collective system. If COLLECTIVE_SYSTEM is 'self' then returns the current system name. Otherwise, returns COLLECTIVE_SYSTEM - type: The type of the current collective system (ignoring COLLECTIVE_SYSTEM). Returns one of: nixos, nix-darwin, or nix-on-droid - architecture: The architecture of the current collective system Returns e.g. x86_64-linux

cltv system temperature

List thermal-zone and hwmon temperatures with Waybar configuration paths.

cltv system temperature [-i INTERVAL | --interval INTERVAL] [-w | --watch]
OptionDefaultMeaning
-i INTERVAL | --interval INTERVAL2Refresh interval in seconds when watching.
-w | --watchfalseContinuously refresh the temperature listing.

cltv file Manage files in the Collective system

cltv file home

Build and echo the contents of a Nix-generated file in ~

cltv file home --path CONFIG_PATH [-d FLAKE_DIR | --flake-dir FLAKE_DIR] [--system-name SYSTEM_NAME] [--system-type SYSTEM_TYPE] [-u USERNAME | --username USERNAME]
OptionDefaultMeaning
-p CONFIG_PATH | --path CONFIG_PATHrequiredThe path to evaluate rooted at home.file.
-d FLAKE_DIR | --flake-dir FLAKE_DIR'~/collective'The directory containing the system flake.
--system-name SYSTEM_NAME''The name of the Collective system.
--system-type SYSTEM_TYPE''The type of the Collective system.
-u USERNAME | --username USERNAME''The username to operate over.

cltv file xdg

Build and echo the contents of a Nix-generated file in ~/.config.

cltv file xdg --path CONFIG_PATH [-d FLAKE_DIR | --flake-dir FLAKE_DIR] [--system-name SYSTEM_NAME] [--system-type SYSTEM_TYPE] [-u USERNAME | --username USERNAME]
OptionDefaultMeaning
-p CONFIG_PATH | --path CONFIG_PATHrequiredThe path to evaluate rooted at xdg.configFile.
-d FLAKE_DIR | --flake-dir FLAKE_DIR'~/collective'The directory containing the system flake.
--system-name SYSTEM_NAME''The name of the Collective system.
--system-type SYSTEM_TYPE''The type of the Collective system.
-u USERNAME | --username USERNAME''The username to operate over.

cltv config Manage configs in the current Collective system

cltv config keyboard unexpected

Manage Unexpected Keyboard configs

cltv config keyboard unexpected [-c | --copy] [-d LAYOUTS_DIR | --layouts_dir LAYOUTS_DIR] [-l LAYOUT_NAMES | --layouts LAYOUT_NAMES] [-v | --verbose]
OptionDefaultMeaning
-c | --copyfalseIf set, copy the layouts to the clipboard. Remaining args passed to clip.
-d LAYOUTS_DIR | --layouts_dir LAYOUTS_DIR/etc/unexpected_keyboard/layoutsThe keyboard layout directory
-l LAYOUT_NAMES | --layouts LAYOUT_NAMESThe keyboard layout names to show, without the .xml extension
-v | --verbosefalseIf set, show the layout XML as well as the name

cltv config terminal ghostty

Manage Ghostty config

cltv config terminal ghostty

cltv secret Manage secrets in the Collective system

cltv secret edit

Edit the Collective secrets YAML file with SOPS

cltv secret edit

cltv secret get

Output the contents of a secret to stdout

cltv secret get --secret SECRET_PATH
OptionDefaultMeaning
-s SECRET_PATH | --secret SECRET_PATHrequiredThe path to the secret in .parent.child format.

cltv secret reinstall

Re-run sops-nix activation to install new/updated secrets

cltv secret reinstall

State and debugging

cltv kv Manage the Collective KV store

cltv kv check

Check the validity of the KV store.

cltv kv check [-s STORE | --store STORE]
OptionDefaultMeaning
-s STORE | --store STORE'~/.config/collective/kvstore'The name of the KV store to use for the check operation.

cltv kv create

Create a new KV store.

cltv kv create [-f | --force] [-e | --return-error] [-s STORE | --store STORE]
OptionDefaultMeaning
-f | --forcefalseIf set, overwrite any existing store
-e | --return-errorfalseIf set, exit with error if the store already exists.
-s STORE | --store STORE'~/.config/collective/kvstore'The name of the KV store to use for the create operation.

cltv kv get

Get a value from a KV store.

cltv kv get [-o DEFAULT_VALUE | --or DEFAULT_VALUE] [-k KEY | --key KEY] [-s STORE | --store STORE]
If no key is specified, the entire KV store will be printed.
OptionDefaultMeaning
-o DEFAULT_VALUE | --or DEFAULT_VALUEA default value to return if the key is not found.
-k KEY | --key KEYThe key to get in the KV store.
-s STORE | --store STORE'~/.config/collective/kvstore'The name of the KV store to use for the get operation.

cltv kv rm

Remove a value from a KV store.

cltv kv rm --key KEY [-s STORE | --store STORE]
OptionDefaultMeaning
-k KEY | --key KEYrequiredThe key to remove in the KV store.
-s STORE | --store STORE'~/.config/collective/kvstore'The name of the KV store to use for the remove operation.

cltv kv set

Set a value in a KV store.

cltv kv set --key KEY --value VALUE [--no-overwrite] [-s STORE | --store STORE]
OptionDefaultMeaning
-k KEY | --key KEYrequiredThe key to set in the KV store.
--no-overwritetrueIf set, do not allow overwriting an existing key
-s STORE | --store STORE'~/.config/collective/kvstore'The name of the KV store to use for the set operation.
-v VALUE | --value VALUErequiredThe value to set for the key in the KV store.

cltv debug

Enable or disable command debugging.

cltv debug [-d | --disable]
Enables debugging unless --disable is passed.
OptionDefaultMeaning
-d | --disablefalseDisable debugging.

Agents and the public flake

cltv pi Pi coding agent management

cltv pi test

Run the Pi extension test harness.

cltv pi test [-e EXTENSION | --extension EXTENSION] [-d EXTENSIONS_DIR | --extensions-dir EXTENSIONS_DIR] [-j | --json] [-v | --verbose]
Validates all .mjs extensions in the given directory can be imported,export a default function, and register against a mock Pi objectwithout errors. Optionally runs extension-specific smoke testsdefined in <extension>.test.json files alongside extensions.
OptionDefaultMeaning
-e EXTENSION | --extension EXTENSIONOnly test a specific extension by name (without .mjs suffix).
-d EXTENSIONS_DIR | --extensions-dir EXTENSIONS_DIR'~/collective/standalone/pi/extensions'The directory containing Pi extensions to test.
-j | --jsonfalseOutput results as JSON (for CI / caco test integration).
-v | --verbosefalseShow detailed output per extension.

cltv public Manage the collective-public subtree

cltv public install hooks

Point this clone's core.hooksPath at scripts/git-hooks so every in-tree hook is live (per-clone, idempotent). Cheap; safe to run on every shell entry.

cltv public install hooks

cltv public migrate

Clean up stale submodule state after switching collective-public from submodule to subtree. Idempotent.

cltv public migrate

cltv public pull

Pull upstream changes from the public GitHub mirror into the collective-public/ subtree.

cltv public pull

cltv public push

Push local collective-public/ changes up to the public GitHub mirror (subtree push).

cltv public push

Devices

cltv apk Manage APK release watcher staging and installs

cltv apk check

Poll GitHub releases once, stage new APKs, and install staged APKs.

cltv apk check [-c CONFIG | --config CONFIG]
OptionDefaultMeaning
-c CONFIG | --config CONFIG'~/.config/collective/apk-watcher/config.json'Path to the nod-apk-watcher JSON config.

cltv apk daemon

Run the APK watcher polling loop in the foreground.

cltv apk daemon [-c CONFIG | --config CONFIG]
OptionDefaultMeaning
-c CONFIG | --config CONFIG'~/.config/collective/apk-watcher/config.json'Path to the nod-apk-watcher JSON config.

cltv apk install

Retry installation of all locally staged APKs.

cltv apk install [-c CONFIG | --config CONFIG]
OptionDefaultMeaning
-c CONFIG | --config CONFIG'~/.config/collective/apk-watcher/config.json'Path to the nod-apk-watcher JSON config.

cltv apk status

Print APK watcher status as JSON.

cltv apk status [-c CONFIG | --config CONFIG]
OptionDefaultMeaning
-c CONFIG | --config CONFIG'~/.config/collective/apk-watcher/config.json'Path to the nod-apk-watcher JSON config.

cltv bt

Manage Bluetooth devices

cltv bt

cltv desktop Desktop session-related management

cltv desktop server name

Get the desktop server name

cltv desktop server name

cltv desktop wm name

Get the window manager name (hyprland, sway, i3)

cltv desktop wm name