NAME
Skilletor::Commands - The CLI's config commands – add, trust, source list, source remove, available, install, uninstall – after the reference's commands.ts
VERSION
version 0.008000
SYNOPSIS
use Skilletor::Commands qw( add available install source_list source_remove trust uninstall );
my $engine = Skilletor::Engine->new( home => $ENV{HOME}, project_dir => $project );
my $added = add( $engine, spec => 'Getty/skills', project => 0 ); # { name, def, kept, report }
my $list = source_list($engine); # [ { name, def, origin }, ... ]
my $r = trust( $engine, 'team' ); # { name, kind, url }
my $report = source_remove( $engine, name => 'extra', project => 0, force => 0 );
my $items = available( $engine, source => 'team' ); # [ { type, name, description, source, installed, ... }, ... ]
$report = install( $engine, items => ['rule:*@team', 'bundle:perl@team'], project => 0, prompt => $prompt );
my $result = uninstall( $engine, items => ['rule:old@team'], project => 0 ); # { report, hints }
DESCRIPTION
The commands of the CLI that read or edit the config, after the reference's src/commands.ts: the same checks in the same order, the same messages, the config files written by Skilletor::Config's edit operations (two-space JSON, the file's key order kept); an edit is followed by the engine's sync, whose report the command returns. available edits nothing: it reads the sources under the sync lock, as a sync does; install plans its edits under it; uninstall validates every removal before editing. Each takes the Skilletor::Engine the CLI runs on as its context – home, project dir, CLAUDE_CONFIG_DIR, state root – as the reference's take its CommandContext.
A refusal is a Skilletor::Error::Command, a spec that does not resolve a Skilletor::Error::Spec, a config file load refuses a Skilletor::Error::Config; none of them changes anything.
add
my $r = add( $engine, spec => $spec, name => $name, project => $bool, probe => $probe );
Adds the source $spec resolves to ("resolve_spec" in Skilletor::Spec) to the user config, or the project config with project, under name or the name the spec derives, trusts it for the backend it names and syncs. Returns { name, def, kept, report }: def the source's fields as written, in their order, report the sync's (its error set when that sync stopped at a config error; the edit stays).
It never replaces a source (k101): when the config already declares the name with the same backend and address – git and url as one source identity, a local path as the directory it names – that entry is kept as it is (kept set, def its fields), trusted and synced. It throws, before anything is written or trusted, for a name config load would refuse (k95), a definition it would refuse (k110: a url not https://), no project scope with project, a taken name with another address, a spec's ref (k119) or path (k126) the kept entry does not have, and a kept entry load would refuse (k116).
A generic host (host.tld[/path]) is probed through probe, by default "make_probe" in Skilletor::Probe's.
config_path
my $file = config_path( $engine, $project );
The config file an edit writes: the user config (<CLAUDE_CONFIG_DIR or ~/.claude>/skilletor.json), or with $project the project's .claude/skilletor.json. With $project and no project scope – the project dir is the home dir, or there is none – it throws, saying which.
source_list
my $list = source_list($engine);
Every source as the project scope sees it, in the merged map's order: { name, def, origin }, def the merged fields in the order git, ref, url, local, path, origin that of the backend author mode would use ("resolve" in Skilletor::Backend).
source_remove
my $report = source_remove( $engine, name => $name, project => $bool, force => $bool );
Removes source $name from the user config, or the project config with project, then syncs and returns the sync's report (its error set when that sync stopped at a config error; the edit stays). It throws, changing nothing, when that config does not declare the name (naming where else it is declared, k114), when the entry gives the source its only backend and another file keeps an entry for it without one (k137), when a config file still fails to load with the entry unchecked (k120), and – without force – when an entry, a wildcard or a bundle of either scope still uses the source.
available
my $items = available( $engine, source => $name );
What the trusted sources offer, or source $name alone: each source resolved – fetched into the cache, as a sync would – and scanned, holding the sync lock ("with_lock" in Skilletor::State; the caches' leftovers swept first, as a sync does). A source is read by the definition install would use: the user config's for a user source, the merged one for a source only a project declares. A source not trusted is skipped, even by name.
Returns a list of { type, name, description, source, installed, error }, in source order, each source's items first, then its bundles. description is there when the item has one, error – why it cannot be built (spec §4.1) – when it cannot. installed (a JSON boolean): an item that an entry of either scope declares or that a lock of either scope holds for that source, under any target, unless it rendered empty there. A bundle is type bundle, installed when either scope's config declares it, with members – its expanded items as type:name and its entries of other sources as written, sorted – and vars, its own var defaults; or error, why it cannot be expanded (spec §15.4).
It throws a Skilletor::Error::Command for a name no source has, a Skilletor::Error::Config for a config file load refuses, and passes on what a lock read, a resolve or a scan throws; the CLI then prints nothing else.
install
my $report = install( $engine, items => \@items, project => $bool, prompt => $prompt );
Adds each item to the user config, or the project config with project, then syncs and returns the sync's report (its error set when that sync stopped at a config error; the edits stay). An item is [type:]name@source, type:pattern@source with a * (a wildcard entry, expanded by the sync; * alone needs a type) or bundle:name@source; a bare name@source that no item of the source has but a bundle does is that bundle (spec §15.5). The source is the one the target scope sees: the user config's for the user scope, the merged one for the project's.
Every item is checked before anything is written, holding the sync lock ("with_lock" in Skilletor::State; the caches' leftovers swept first), the source resolved and scanned as a sync would; the lock is free again for the questions and the sync, which takes it itself. It throws a Skilletor::Error::Command, changing nothing, for an item it cannot read, no project scope with project, an unknown or untrusted source, an unknown or ambiguous name, an item with an error of its own (spec §4.1), and a bundle that does not exist or does not expand (spec §15.4: an entry address config load would refuse, k115, is such an error); a config file load refuses is a Skilletor::Error::Config.
A bundle's entries of other sources whose address no configured source the target scope sees serves are missing sources (spec §15.6), each identity once. Without prompt the command throws, naming the skilletor add commands that would add them. With it each is asked for: prompt is called with the question – bundle <name> needs a source you don't have yet: <spec> → <address> — add it as [<name>]? (name, or n to skip) – and returns the answer: empty takes the proposed name, n or no skips the source (its members then a warning of the sync), any other is the name, asked again with a note before the question when config load would refuse it (k95) or a source with another address – or an entry of the config written, whatever its address (k102) – has it. The proposed name is the address's derived one, else that with -2, -3, … An added source is written after the items and trusted as "add" trusts it.
uninstall
my $r = uninstall( $engine, items => \@items, project => $bool );
# { report => $sync_report, hints => \@warnings }
Removes explicit item, wildcard or bundle entries from the user config, or the project config with project, then syncs. A type prefix restricts removal to that type; a bare item name removes it from every type. A bare name that only a bundle entry has removes that bundle, while a name held both as an item and a bundle is ambiguous. Returns the sync's report and one hints line per removed explicit item a wildcard or bundle in the same config still installs.
Every requested removal is checked before any edit. An entry not declared explicitly throws a Skilletor::Error::Command, naming its covering wildcard or bundle when the scope's lock confirms it, a matching wildcard conditionally when no installed item confirms it, another type in the same config, or the other scope and the needed --project choice. The message gives the command that removes a covering entry and the alternative of gating a template to render empty. A failure leaves the config byte-identical. A sync error after a valid edit is returned in report; the edit stays.
trust
my $r = trust( $engine, $name );
Trusts source $name of the merged map for the backend it would use now – its kind and address, a local one as an absolute path (the real path when the directory exists) – in the state root's trust.json, replacing an earlier entry. Returns { name, kind, url }; an unknown name throws.
SUPPORT
Issues
Please report bugs and feature requests at https://github.com/Getty/skilletor/issues.
CONTRIBUTING
Contributions are welcome! Please fork the repository and submit a pull request.
AUTHOR
Torsten Raudssus <torsten@raudssus.de>
COPYRIGHT AND LICENSE
This software is Copyright (c) 2026 by Torsten Raudssus <torsten@raudssus.de> https://raudssus.de/.
This is free software, licensed under:
The Artistic License 2.0 (GPL Compatible)