feat: phase 2 — modèles locaux + catalogue distant + suggest (closes #70 #71 #73 #60 #67 #61)

Axe 11 (modèles) :
- am models : inventaire des runtimes locaux (ollama list --format json,
  llama.cpp .gguf sur disque, LM Studio API locale) avec cache façon
  probe.rs (TTL 30s) et absence de runtime signalée sans erreur fatale
- am run <agent> --model <m> : résolution dans l'inventaire, transmission
  via model_env/model_arg de l'agent (défaut AM_MODEL), tracé en session
- am models --prune : candidats inutilisés depuis settings.models_prune_days
  (défaut 30), :latest toujours protégé, dry-run + confirmation + événement
  EventKind::Model journalisé

Axes 7/9 (catalogue) :
- am catalog update : fetch du catalogue officiel, diff (ajoutés/retirés/
  modifiés), confirmation, enregistrement en include
- am catalog add <url> : validation du format (parse + validate), cache
  catalog-cache.json (TTL 3600s), événement EventKind::Catalog journalisé
- include par URL (http/https/file) dans config.yaml, résolu au chargement
  avec cache + TTL ; override local toujours prioritaire (issue #67)
- am suggest <requête> : réutilise le scoring fuzzy du catalogue, boost par
  usage réel (lancements + durée depuis le journal), top 5 justifié, --json

REPL : commandes models/catalog/suggest (parse, complétion, descriptions),
help specs, tip cheat sheet, man pages régénérées (49 pages, dont 3 nouvelles).
Version bump 0.4.5, ROADMAP cases cochées, 266 tests verts.
This commit is contained in:
2026-08-18 09:06:16 -04:00
parent 890ad953e5
commit 22bc529818
31 changed files with 2122 additions and 40 deletions
+26
View File
@@ -0,0 +1,26 @@
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.TH am-catalog 1 "catalog "
.SH NAME
catalog \- Manage remote catalogs: update the official one, add external ones
.SH SYNOPSIS
\fBcatalog\fR [\fB\-h\fR|\fB\-\-help\fR] <\fIsubcommands\fR>
.SH DESCRIPTION
Manage remote catalogs: update the official one, add external ones
.SH OPTIONS
.TP
\fB\-h\fR, \fB\-\-help\fR
Print help
.SH SUBCOMMANDS
.TP
catalog\-update(1)
Fetch the official catalog, show the diff and register it as an include
.TP
catalog\-add(1)
Register an external catalog (same YAML format) by URL
.TP
catalog\-list(1)
List the registered remote catalogs
.TP
catalog\-help(1)
Print this message or the help of the given subcommand(s)
+25
View File
@@ -0,0 +1,25 @@
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.TH am-models 1 "models "
.SH NAME
models \- List local models (ollama, llama.cpp, LM Studio) and prune unused ones
.SH SYNOPSIS
\fBmodels\fR [\fB\-\-prune\fR] [\fB\-\-dry\-run\fR] [\fB\-\-yes\fR] [\fB\-\-days\fR] [\fB\-h\fR|\fB\-\-help\fR]
.SH DESCRIPTION
List local models (ollama, llama.cpp, LM Studio) and prune unused ones
.SH OPTIONS
.TP
\fB\-\-prune\fR
Purge unused models instead of listing them
.TP
\fB\-\-dry\-run\fR
Only list what would be pruned, delete nothing
.TP
\fB\-\-yes\fR
Answer yes to the deletion prompt
.TP
\fB\-\-days\fR \fI<DAYS>\fR
Consider a model unused after N days (default: 30)
.TP
\fB\-h\fR, \fB\-\-help\fR
Print help
+4 -1
View File
@@ -4,7 +4,7 @@
.SH NAME
restart \- Restart an agent: stop, then start with the same options
.SH SYNOPSIS
\fBrestart\fR [\fB\-b\fR|\fB\-\-background\fR] [\fB\-f\fR|\fB\-\-foreground\fR] [\fB\-\-args\fR] [\fB\-\-env\fR] [\fB\-\-notify\fR] [\fB\-\-profile\fR] [\fB\-\-force\fR] [\fB\-\-timeout\fR] [\fB\-h\fR|\fB\-\-help\fR] [\fIAGENT\fR]
\fBrestart\fR [\fB\-b\fR|\fB\-\-background\fR] [\fB\-f\fR|\fB\-\-foreground\fR] [\fB\-\-args\fR] [\fB\-\-env\fR] [\fB\-\-notify\fR] [\fB\-\-profile\fR] [\fB\-\-model\fR] [\fB\-\-force\fR] [\fB\-\-timeout\fR] [\fB\-h\fR|\fB\-\-help\fR] [\fIAGENT\fR]
.SH DESCRIPTION
Restart an agent: stop, then start with the same options
.SH OPTIONS
@@ -27,6 +27,9 @@ Send a desktop notification once the agent has started
\fB\-\-profile\fR \fI<NAME>\fR
Apply an environment profile (env + args, defined in the config)
.TP
\fB\-\-model\fR \fI<MODEL>\fR
Local model to use for this run (validated against the local runtimes)
.TP
\fB\-\-force\fR
Kill immediately instead of terminating gracefully
.TP
+4 -1
View File
@@ -4,11 +4,14 @@
.SH NAME
run \- Run the agent command directly with the given arguments (no process management)
.SH SYNOPSIS
\fBrun\fR [\fB\-h\fR|\fB\-\-help\fR] <\fIAGENT\fR> [\fIARGS...\fR]
\fBrun\fR [\fB\-\-model\fR] [\fB\-h\fR|\fB\-\-help\fR] <\fIAGENT\fR> [\fIARGS...\fR]
.SH DESCRIPTION
Run the agent command directly with the given arguments (no process management)
.SH OPTIONS
.TP
\fB\-\-model\fR \fI<MODEL>\fR
Local model to use for this run (validated against the local runtimes)
.TP
\fB\-h\fR, \fB\-\-help\fR
Print help
.TP
+4 -1
View File
@@ -4,7 +4,7 @@
.SH NAME
start \- Start an agent (foreground by default, or detached with \-\-background)
.SH SYNOPSIS
\fBstart\fR [\fB\-b\fR|\fB\-\-background\fR] [\fB\-f\fR|\fB\-\-foreground\fR] [\fB\-\-args\fR] [\fB\-\-env\fR] [\fB\-\-notify\fR] [\fB\-\-profile\fR] [\fB\-h\fR|\fB\-\-help\fR] [\fIAGENT\fR]
\fBstart\fR [\fB\-b\fR|\fB\-\-background\fR] [\fB\-f\fR|\fB\-\-foreground\fR] [\fB\-\-args\fR] [\fB\-\-env\fR] [\fB\-\-notify\fR] [\fB\-\-profile\fR] [\fB\-\-model\fR] [\fB\-h\fR|\fB\-\-help\fR] [\fIAGENT\fR]
.SH DESCRIPTION
Start an agent (foreground by default, or detached with \-\-background)
.SH OPTIONS
@@ -27,6 +27,9 @@ Send a desktop notification once the agent has started
\fB\-\-profile\fR \fI<NAME>\fR
Apply an environment profile (env + args, defined in the config)
.TP
\fB\-\-model\fR \fI<MODEL>\fR
Local model to use for this run (validated against the local runtimes)
.TP
\fB\-h\fR, \fB\-\-help\fR
Print help
.TP
+16
View File
@@ -0,0 +1,16 @@
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.TH am-suggest 1 "suggest "
.SH NAME
suggest \- Suggest agents matching a query, boosted by real usage (issue #61)
.SH SYNOPSIS
\fBsuggest\fR [\fB\-h\fR|\fB\-\-help\fR] <\fIQUERY\fR>
.SH DESCRIPTION
Suggest agents matching a query, boosted by real usage (issue #61)
.SH OPTIONS
.TP
\fB\-h\fR, \fB\-\-help\fR
Print help
.TP
<\fIQUERY\fR>
Free\-form request ("un agent pour du Python")
+16
View File
@@ -0,0 +1,16 @@
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.TH am-theme 1 "theme "
.SH NAME
theme \- Set or show the active color theme (persisted for the next run)
.SH SYNOPSIS
\fBtheme\fR [\fB\-h\fR|\fB\-\-help\fR] [\fINAME\fR]
.SH DESCRIPTION
Set or show the active color theme (persisted for the next run)
.SH OPTIONS
.TP
\fB\-h\fR, \fB\-\-help\fR
Print help
.TP
[\fINAME\fR]
Theme name (omit to list available themes)
+16
View File
@@ -0,0 +1,16 @@
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.TH am-tip 1 "tip "
.SH NAME
tip \- Cheat sheet: the most useful commands, their key options, your most\-used commands and a rotating tip of the day
.SH SYNOPSIS
\fBtip\fR [\fB\-\-random\fR] [\fB\-h\fR|\fB\-\-help\fR]
.SH DESCRIPTION
Cheat sheet: the most useful commands, their key options, your most\-used commands and a rotating tip of the day
.SH OPTIONS
.TP
\fB\-\-random\fR
Show a single random tip instead of the whole page
.TP
\fB\-h\fR, \fB\-\-help\fR
Print help
+17 -2
View File
@@ -1,6 +1,6 @@
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.TH am 1 "am 0.4.3"
.TH am 1 "am 0.4.5"
.SH NAME
am \- agent\-manager (am) — manage local AI coding agents
.SH SYNOPSIS
@@ -84,12 +84,24 @@ Manage environment profiles (dev, prod, ...)
am\-man(1)
Generate a man page for am (or for one command)
.TP
am\-theme(1)
Set or show the active color theme (persisted for the next run)
.TP
am\-alias(1)
Manage command aliases (cc \-> claude\-code)
.TP
am\-secret(1)
Manage secrets in the OS keyring (never in plaintext config)
.TP
am\-models(1)
List local models (ollama, llama.cpp, LM Studio) and prune unused ones
.TP
am\-catalog(1)
Manage remote catalogs: update the official one, add external ones
.TP
am\-suggest(1)
Suggest agents matching a query, boosted by real usage (issue #61)
.TP
am\-start(1)
Start an agent (foreground by default, or detached with \-\-background)
.TP
@@ -150,6 +162,9 @@ Display help: the overview, a command, the command list, or a search
am\-version(1)
Display version and build information
.TP
am\-tip(1)
Cheat sheet: the most useful commands, their key options, your most\-used commands and a rotating tip of the day
.TP
am\-config(1)
Manage the configuration file
.TP
@@ -174,4 +189,4 @@ Export the configuration and installation state (backup)
am\-import(1)
Import a previously exported configuration and state
.SH VERSION
v0.4.3
v0.4.5