xtr_recipes.command ¶
The five commands that drive a project's recipes.
Importing this package declares all of them: @as_command writes to the
console's registry as each module is read, which is why the entry point
imports this and nothing else. A command holds no logic of its own — it reads
--project-dir, asks :mod:~xtr_recipes.command_support for a
synchronizer, reports the plan and returns an exit code. That module sits
beside this package rather than in it, so a command can reach it without this
package being imported back into the command that it imports.
AddCommand ¶
Add a requirement to the project, then sync the recipes it brought.
One step for what is otherwise two: the dependency is installed, and whatever recipe arrived with it is applied. The sync runs as a fresh process, because installing has changed the environment under this one.
InstallCommand ¶
Re-apply one package's recipe and leave the rest of the lock alone.
Unconditional, which is what makes it the way to restore a file that went missing: a sync would find the recipe unchanged and do nothing, while this renders it again. The rest of the project is read but never planned, so one package cannot be repaired at another's expense.
RemoveCommand ¶
Drop a dependency from the project, then unconfigure what it left.
The lock alone says what to take back, so the recipe does not have to be installed any more by the time the sync runs — which it will not be. That sync is a fresh process, because removing has changed the environment under this one.
ShowCommand ¶
List the project's recipes and their standing, or read one of them.
Writes nothing. Named without a package it answers "what is configured here, and what would a sync have to do?"; named with one it answers "what does this package's recipe actually declare?" — the bundles, the files, the environment keys, the ignore lines and the notes, as the recipe ships them.
SyncCommand ¶
Configure what is new, re-apply what changed, undo what is gone.
The whole run is planned before any of it is done, so the three ways of
asking are one code path: --check refuses a project the plan would
change, --dry-run prints the plan and stops, and the default prints it
and carries it out. Nothing cares how a package arrived or left, so the
second run of any of them finds nothing to do.