tools-manager 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md ADDED
@@ -0,0 +1,376 @@
1
+ # Tools Manager
2
+
3
+ [中文文档](README.zh-CN.md)
4
+
5
+ Tools Manager (`tm`) is a Bun-powered CLI for managing AI agent skills and MCP server configuration across Codex, Claude Code, and Cursor.
6
+
7
+ It gives you one local source of truth for:
8
+
9
+ - Skills stored under `~/.tools-manager/skills`
10
+ - Skill presets that group skills for different agents or workflows
11
+ - MCP servers stored in the Tools Manager database and synced into agent config files
12
+
13
+ Open `tm` with no arguments when you want a guided command picker instead of remembering every subcommand:
14
+
15
+ ![Tools Manager interactive menu](docs/images/menu.svg)
16
+
17
+ The diagram below shows how skills and MCP servers move between local agents and the Tools Manager store:
18
+
19
+ ![Tools Manager workflow](docs/images/workflow.svg)
20
+
21
+ ## Requirements
22
+
23
+ - Bun `>= 1.3.0`
24
+ - Git, for importing skills from Git URLs and running `tm backup`
25
+
26
+ ## Installation
27
+
28
+ Install globally:
29
+
30
+ ```bash
31
+ npm install -g tools-manager
32
+ ```
33
+
34
+ Verify the CLI:
35
+
36
+ ```bash
37
+ tm status
38
+ ```
39
+
40
+ For source checkout usage, see [Development](#development).
41
+
42
+
43
+ ## Quick Start
44
+
45
+ Import all existing local agent skills into Tools Manager, then apply the default preset back to all supported agents:
46
+
47
+ ```bash
48
+ tm init
49
+ tm skills add --tool all
50
+ tm skills list
51
+ tm presets apply
52
+ ```
53
+
54
+ If you have not linked or installed the package yet, use:
55
+
56
+ ```bash
57
+ bun run tm init
58
+ bun run tm skills add --tool all
59
+ bun run tm skills list
60
+ bun run tm presets apply
61
+ ```
62
+
63
+ By default, Tools Manager writes state to:
64
+
65
+ ```text
66
+ ~/.tools-manager
67
+ ```
68
+
69
+ Set `TOOLS_MANAGER_HOME` to use a custom manager root.
70
+
71
+ Run `tm` with no arguments to open an interactive command menu:
72
+
73
+ ```bash
74
+ tm
75
+ ```
76
+
77
+ The menu lets you choose common skill, skill preset, MCP, agent, and backup commands with arrow keys. It includes manual add flows for skill sources and MCP servers, plus import flows from existing agents. Tool parameters use an option picker with `all` selected by default. After a command runs, press `Enter` or `Esc` to return to the menu.
78
+
79
+ ## Skills
80
+
81
+ Add a local skill directory:
82
+
83
+ ```bash
84
+ tm skills add ./my-skill
85
+ ```
86
+
87
+ Add existing skills from one local agent:
88
+
89
+ ```bash
90
+ tm skills add --tool codex
91
+ tm skills add --tool cursor
92
+ tm skills add --tool claude_code
93
+ ```
94
+
95
+ Import existing skills from all supported local agents:
96
+
97
+ ```bash
98
+ tm skills add --tool all
99
+ ```
100
+
101
+ Agent imports copy skills into `~/.tools-manager/skills`, then replace the original local agent skill directories with symlinks to the managed copies.
102
+
103
+ Import a skill from Git:
104
+
105
+ ```bash
106
+ tm skills add 'git@gitlab.company.com:group/repo.git#main:path/to/skill'
107
+ ```
108
+
109
+ If the source contains multiple skill directories, all discovered skills are imported. Existing skills with the same name are updated.
110
+
111
+ See [Remote Skill Repositories](docs/remote-skill-repositories.md) for the expected repository layout.
112
+
113
+ List managed skills:
114
+
115
+ ```bash
116
+ tm skills list
117
+ ```
118
+
119
+ List skills currently visible to local agents:
120
+
121
+ ```bash
122
+ tm skills list --tool codex
123
+ tm skills list --tool all
124
+ ```
125
+
126
+ Show one managed skill:
127
+
128
+ ```bash
129
+ tm skills show my-skill
130
+ ```
131
+
132
+ Remove a managed skill:
133
+
134
+ ```bash
135
+ tm skills remove my-skill
136
+ ```
137
+
138
+ If agent skill directories contain symlinks to the managed skill source, Tools Manager shows them and asks for confirmation before deleting both the managed source and those agent symlinks. Use `--yes` for non-interactive removal:
139
+
140
+ ```bash
141
+ tm skills remove my-skill --yes
142
+ ```
143
+
144
+ Sync skills to agent skill directories:
145
+
146
+ ```bash
147
+ tm skills sync
148
+ tm skills sync Work --tool cursor
149
+ tm skills sync --mode copy
150
+ tm skills sync Work --tool codex --mode symlink
151
+ ```
152
+
153
+ `tm skills sync` uses the same preset behavior as `tm presets apply`: it defaults to preset `Default` and tool `all`. Use `--mode symlink` or `--mode copy` to override the configured sync mode for that run.
154
+
155
+ ## Skill Presets
156
+
157
+ Skill presets are named groups of skills. Imported skills are added to the `Default` preset automatically.
158
+
159
+ List skill presets:
160
+
161
+ ```bash
162
+ tm presets list
163
+ ```
164
+
165
+ Move one skill from one preset to another:
166
+
167
+ ```bash
168
+ tm presets move-skill my-skill Default Work
169
+ ```
170
+
171
+ Move all skills from one skill preset to another:
172
+
173
+ ```bash
174
+ tm presets move Default Work
175
+ ```
176
+
177
+ Apply a preset to agent skill directories:
178
+
179
+ ```bash
180
+ tm presets apply
181
+ tm presets apply Work --tool cursor
182
+ tm presets apply --mode copy
183
+ ```
184
+
185
+ Defaults:
186
+
187
+ - `tm presets apply` uses preset `Default`
188
+ - `tm presets apply` uses `--tool all`
189
+ - `tm presets apply` uses `sync_mode` from config unless `--mode symlink|copy` is provided
190
+
191
+ ## MCP Servers
192
+
193
+ Add an MCP server to Tools Manager:
194
+
195
+ ```bash
196
+ tm mcp add playwright --command npx --arg @playwright/mcp@latest --tool codex
197
+ ```
198
+
199
+ Add existing MCP servers from agent config files:
200
+
201
+ ```bash
202
+ tm mcp add --tool codex
203
+ tm mcp add --tool all
204
+ ```
205
+
206
+ List managed MCP servers:
207
+
208
+ ```bash
209
+ tm mcp list
210
+ ```
211
+
212
+ List MCP servers currently configured in local agent config files:
213
+
214
+ ```bash
215
+ tm mcp list --tool codex
216
+ tm mcp list --tool all
217
+ ```
218
+
219
+ Show one managed MCP server:
220
+
221
+ ```bash
222
+ tm mcp show playwright
223
+ ```
224
+
225
+ Remove a managed MCP server:
226
+
227
+ ```bash
228
+ tm mcp remove playwright
229
+ ```
230
+
231
+ Sync managed MCP servers back to agent config files:
232
+
233
+ ```bash
234
+ tm mcp sync
235
+ tm mcp sync --tool codex
236
+ ```
237
+
238
+ Defaults:
239
+
240
+ - `tm mcp sync` uses `--tool all`
241
+ - Sync creates timestamped backups before writing config files
242
+
243
+ Supported config targets:
244
+
245
+ ```text
246
+ codex -> ~/.codex/config.toml
247
+ claude_code -> ~/.claude/mcp.json
248
+ cursor -> ~/.cursor/mcp.json
249
+ ```
250
+
251
+ ## Backup
252
+
253
+ Back up managed skills with Git:
254
+
255
+ ```bash
256
+ tm backup
257
+ ```
258
+
259
+ `tm backup` initializes a Git repo in `~/.tools-manager/skills` if needed, commits skill changes, and pushes when `git_remote` is configured in `~/.tools-manager/config.toml`.
260
+
261
+ ## Command Reference
262
+
263
+ ```bash
264
+ tm init
265
+ tm status [--json]
266
+ tm agents list [--tool <tool|all>] [--json]
267
+ tm skills add <source>
268
+ tm skills add --tool <tool|all>
269
+ tm skills list [--json]
270
+ tm skills list --tool <tool|all> [--json]
271
+ tm skills show <name> [--json]
272
+ tm skills remove <name> [--yes]
273
+ tm skills sync [preset] [--tool <tool|all>] [--mode <symlink|copy>]
274
+ tm presets list [--json]
275
+ tm presets apply [preset] [--tool <tool|all>] [--mode <symlink|copy>]
276
+ tm presets move-skill <skill> <from> <to>
277
+ tm presets move <from> <to>
278
+ tm mcp add <name> --command <cmd> [--arg value] [--env K=V] [--tool <tool|all>]
279
+ tm mcp add --tool <tool|all>
280
+ tm mcp list [--json]
281
+ tm mcp list --tool <tool|all> [--json]
282
+ tm mcp show <name> [--json]
283
+ tm mcp remove <name>
284
+ tm mcp sync [--tool <tool|all>]
285
+ tm backup
286
+ ```
287
+
288
+ Supported tools:
289
+
290
+ ```text
291
+ codex
292
+ claude_code
293
+ cursor
294
+ all
295
+ ```
296
+
297
+ ## Development
298
+
299
+ Install dependencies and run checks:
300
+
301
+ ```bash
302
+ bun install
303
+ bun run check
304
+ ```
305
+
306
+ This repository pins npm and Bun installs to the npmmirror registry through `.npmrc` and `bunfig.toml`.
307
+
308
+ Run the CLI through the package script:
309
+
310
+ ```bash
311
+ bun run tm status
312
+ bun run tm skills list
313
+ ```
314
+
315
+ Build the publishable CLI bundle:
316
+
317
+ ```bash
318
+ bun run build
319
+ ls -la dist
320
+ ```
321
+
322
+ Test the `tm` binary exactly as consumers will run it:
323
+
324
+ ```bash
325
+ npm link
326
+ tm status
327
+ tm skills list
328
+ npm unlink -g tools-manager
329
+ ```
330
+
331
+ ## Publishing
332
+
333
+ Before publishing:
334
+
335
+ ```bash
336
+ bun run release:dry
337
+ ```
338
+
339
+ Review the dry-run output. It should include only:
340
+
341
+ - `package.json`
342
+ - `README.md`
343
+ - `README.zh-CN.md`
344
+ - `dist/**`
345
+ - `docs/**`
346
+
347
+ Publish:
348
+
349
+ ```bash
350
+ bun run release
351
+ ```
352
+
353
+ Publish with a version bump:
354
+
355
+ ```bash
356
+ bun run release:patch
357
+ bun run release:minor
358
+ bun run release:major
359
+ ```
360
+
361
+ After publishing, test install in a clean shell:
362
+
363
+ ```bash
364
+ npm install -g tools-manager
365
+ tm --help
366
+ tm status
367
+ ```
368
+
369
+ ## Notes
370
+
371
+ - `tm skills add` supports local folders, GitHub URLs, internal GitLab URLs, SSH Git URLs, and `#ref:path/to/skill`.
372
+ - Git authentication is delegated to your local Git setup: SSH keys, VPN, credential helpers, and tokens. Private HTTPS repositories with 2FA need a personal access token, or use an SSH Git URL.
373
+ - `tm skills add --codex` and `tm skills add --all` are kept as compatibility aliases.
374
+ - `tm skills remove` deletes the managed skill files, removes preset membership, and removes agent symlinks that point to the managed source after confirmation.
375
+ - `tm mcp remove` deletes the server from Tools Manager; run `tm mcp sync` to update agent config files.
376
+ - `--json` is available on list/status-style commands for scripting.