Commit 3fbef89
authored
[2/5] Aitools: install writes state, interactive agent selection, idempotent install (#4811)
## PR Stack
1. [1/5] State + release discovery + directory rename (#4810)
2. **[2/5] Install writes state + interactive agent selection** (this
PR)
3. [3/5] Update + uninstall + version commands (#4812)
4. [4/5] List improvements + command restructuring + flags (#4813)
5. [5/5] Project scope (--project/--global) (pending)
**Base**: `simonfaltum/aitools-pr1-state` (PR 1)
## Why
Install currently has no state tracking, no filtering, and outputs every
file download to the console. Users can't tell what version they have,
and there's no way to install for specific agents.
## Changes
Before: `skills install` downloads everything, prints every file, has no
state, no filtering, no agent selection.
Now:
- `InstallSkillsForAgents(ctx, src, agents, opts)` as the core install
function. `InstallAllSkills` becomes a thin wrapper (signature preserved
for `cmd/apps/init.go` compat).
- State written to `.state.json` after successful install. Merges with
existing state (doesn't overwrite).
- Idempotent: second install skips already-present skills with matching
versions.
- Experimental filtering: skip `experimental: true` skills by default.
- `min_cli_version` enforcement: skip incompatible skills with warning
(hard error for single-skill install).
- Interactive agent selection via `charmbracelet/huh` multi-select. Skip
prompt for 1 agent, all detected for non-interactive.
- Legacy install detection: prints "reinstall" message when old install
found without state.
- Concise default output (2 lines). Per-file detail only at debug level.
## Test plan
- [x] State created after install-all and install-single
- [x] Experimental filtering (skip by default, include with flag)
- [x] min_cli_version: warning for all, hard error for single
- [x] Idempotent: skip same version, update changed
- [x] Legacy detection with helpful message
- [x] Interactive prompt for 2+ agents, skip for 1
- [x] Non-interactive: all detected, no prompt
- [x] `InstallAllSkills` signature preserved
- [x] Concise output, per-file at debug level1 parent ead07cf commit 3fbef89
File tree
6 files changed
+965
-101
lines changed- experimental/aitools
- cmd
- lib/installer
6 files changed
+965
-101
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
9 | 11 | | |
10 | 12 | | |
11 | 13 | | |
12 | 14 | | |
13 | 15 | | |
14 | 16 | | |
15 | | - | |
| 17 | + | |
16 | 18 | | |
17 | 19 | | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
18 | 23 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
| 6 | + | |
| 7 | + | |
5 | 8 | | |
6 | 9 | | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
7 | 13 | | |
8 | 14 | | |
9 | 15 | | |
10 | 16 | | |
11 | 17 | | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
12 | 50 | | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
| 51 | + | |
| 52 | + | |
19 | 53 | | |
20 | 54 | | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
26 | 62 | | |
27 | 63 | | |
28 | | - | |
29 | | - | |
30 | | - | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
31 | 74 | | |
32 | 75 | | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
37 | 81 | | |
38 | 82 | | |
39 | | - | |
40 | | - | |
41 | | - | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
42 | 86 | | |
43 | 87 | | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
48 | 100 | | |
49 | 101 | | |
50 | 102 | | |
51 | 103 | | |
52 | 104 | | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
| 105 | + | |
64 | 106 | | |
| 107 | + | |
65 | 108 | | |
66 | | - | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
67 | 113 | | |
68 | 114 | | |
69 | 115 | | |
70 | 116 | | |
71 | | - | |
72 | | - | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
73 | 121 | | |
74 | 122 | | |
75 | 123 | | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
| 7 | + | |
| 8 | + | |
6 | 9 | | |
| 10 | + | |
| 11 | + | |
7 | 12 | | |
8 | 13 | | |
9 | 14 | | |
| 15 | + | |
10 | 16 | | |
11 | | - | |
12 | | - | |
| 17 | + | |
| 18 | + | |
13 | 19 | | |
14 | 20 | | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
15 | 51 | | |
16 | 52 | | |
17 | 53 | | |
| |||
36 | 72 | | |
37 | 73 | | |
38 | 74 | | |
39 | | - | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
40 | 78 | | |
41 | 79 | | |
42 | 80 | | |
| |||
47 | 85 | | |
48 | 86 | | |
49 | 87 | | |
50 | | - | |
| 88 | + | |
51 | 89 | | |
52 | 90 | | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
53 | 94 | | |
54 | 95 | | |
55 | | - | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
56 | 126 | | |
57 | | - | |
| 127 | + | |
58 | 128 | | |
59 | 129 | | |
60 | | - | |
| 130 | + | |
| 131 | + | |
61 | 132 | | |
0 commit comments