airc-cli 0.1.0 → 0.1.2
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 +34 -652
- package/dist/index.js +200 -263
- package/package.json +28 -20
package/README.md
CHANGED
|
@@ -2,32 +2,16 @@
|
|
|
2
2
|
|
|
3
3
|
AI Config Manager - A TypeScript-based CLI tool to manage and install AI tool configuration files across multiple AI development tools.
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
- ✅ **Multi-Tool Support** - Install configs for Claude, Gemini CLI, Cursor, Antigravity, GitHub Copilot, and OpenCode
|
|
8
|
-
- ✅ **Centralized Config Management** - User-level config directory (~/.airc) with git-based source management
|
|
9
|
-
- ✅ **Git Source Integration** - Add configs from GitHub/GitLab/Bitbucket repositories
|
|
10
|
-
- ✅ **Automatic Config Copying** - Add sources and configs are automatically copied to your local directory
|
|
11
|
-
- ✅ **Format Conversion** - Automatically converts commands to tool-specific formats (TOML, prompt.md, YAML)
|
|
12
|
-
- ✅ **Config Discovery** - Browse available configs from sources
|
|
13
|
-
- ✅ **Smart Updates** - Keep configs in sync with source updates (only updates changed files)
|
|
14
|
-
- ✅ **Sparse Checkout** - Support GitHub tree URLs for subfolder-only checkout
|
|
15
|
-
- ✅ **Safe Installation** - Prevents accidental overwrites (with force option available)
|
|
16
|
-
- ✅ **Migration Tool** - Easy migration from old project-based configs to new user config workflow
|
|
17
|
-
- ✅ **Comprehensive Testing** - 532+ tests with full coverage
|
|
18
|
-
- ✅ **TypeScript Support** - Fully typed for better development experience
|
|
5
|
+
Idea is manage your AI tools config in same place and then reuse everywhere.
|
|
19
6
|
|
|
20
7
|
## Installation
|
|
21
8
|
|
|
22
9
|
```bash
|
|
23
|
-
|
|
24
|
-
|
|
10
|
+
npm install airc-cli -g
|
|
11
|
+
airc --help
|
|
25
12
|
|
|
26
|
-
#
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
# Install globally (optional)
|
|
30
|
-
bun link
|
|
13
|
+
# Or use npx directly
|
|
14
|
+
npx airc-cli --help
|
|
31
15
|
```
|
|
32
16
|
|
|
33
17
|
## Quick Start
|
|
@@ -41,34 +25,35 @@ airc init
|
|
|
41
25
|
```
|
|
42
26
|
|
|
43
27
|
This creates:
|
|
28
|
+
|
|
44
29
|
- `~/.airc/` - User config directory
|
|
45
|
-
- `~/.airc/config
|
|
46
|
-
- `~/.airc/
|
|
47
|
-
- `~/.
|
|
30
|
+
- `~/.airc/config/skills/` - Local skills config storage
|
|
31
|
+
- `~/.airc/config/commands/` - Local commands config storage
|
|
32
|
+
- `~/.airc/config/agents/` - Local commands config storage
|
|
33
|
+
- `~/.aircrc` - Configuration file for airc cli
|
|
48
34
|
|
|
49
35
|
### 2. Add a Source
|
|
50
36
|
|
|
51
|
-
Add a git repository containing AI configs. This automatically
|
|
37
|
+
Add a git repository containing AI configs. This automatically copies config files to your local directory:
|
|
52
38
|
|
|
53
39
|
```bash
|
|
54
40
|
# Add from GitHub (full repository)
|
|
55
|
-
airc source add https://github.com/
|
|
41
|
+
airc source add https://github.com/vercel-labs/agent-skills
|
|
56
42
|
|
|
57
43
|
# Add with custom name
|
|
58
|
-
airc source add https://github.com/
|
|
44
|
+
airc source add https://github.com/vercel-labs/agent-skills --name vercel-skills
|
|
59
45
|
|
|
60
|
-
# Add
|
|
61
|
-
airc source add https://github.com/
|
|
62
|
-
|
|
63
|
-
# Add from GitHub tree URL (sparse checkout - only specified subfolder)
|
|
64
|
-
airc source add https://github.com/username/ai-configs/tree/main/custom-skills
|
|
46
|
+
# Add from GitHub tree URL
|
|
47
|
+
airc source add https://github.com/vercel-labs/agent-skills/tree/main/skills/react-best-practices
|
|
65
48
|
```
|
|
66
49
|
|
|
67
50
|
**What happens:**
|
|
68
|
-
|
|
51
|
+
|
|
52
|
+
- Repository is cloned to `~/.airc/temp/`
|
|
69
53
|
- Config folders (skills, commands, agents) are automatically discovered
|
|
70
54
|
- Config files are copied to `~/.airc/config/{type}/{source-name}/`
|
|
71
|
-
- Metadata is tracked for smart updates
|
|
55
|
+
- Metadata is tracked in `~/.aircrc` for smart updates
|
|
56
|
+
- Remove temp repo
|
|
72
57
|
|
|
73
58
|
### 3. View Your Configs
|
|
74
59
|
|
|
@@ -87,638 +72,35 @@ airc list --type skills
|
|
|
87
72
|
Install your configs to specific AI tools:
|
|
88
73
|
|
|
89
74
|
```bash
|
|
90
|
-
# Install to Claude
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
# Install globally
|
|
94
|
-
airc install cursor --global
|
|
95
|
-
```
|
|
96
|
-
|
|
97
|
-
## Usage
|
|
98
|
-
|
|
99
|
-
### Workflow Overview
|
|
100
|
-
|
|
101
|
-
The workflow is simple and streamlined:
|
|
102
|
-
|
|
103
|
-
1. **Initialize** - Set up your user config directory (`airc init`)
|
|
104
|
-
2. **Add Sources** - Add git repositories containing configs (`airc source add <url>`)
|
|
105
|
-
- Automatically clones repository and copies configs
|
|
106
|
-
3. **List** - View available configs in your local directory (`airc list`)
|
|
107
|
-
4. **Install** - Deploy configs to specific AI tools (`airc install <tool>`)
|
|
108
|
-
5. **Update** - Keep configs up-to-date with sources (`airc source update <name>`)
|
|
109
|
-
|
|
110
|
-
### Commands
|
|
111
|
-
|
|
112
|
-
#### `init`
|
|
113
|
-
|
|
114
|
-
Initialize airc user config directory.
|
|
115
|
-
|
|
116
|
-
```bash
|
|
117
|
-
airc init [options]
|
|
118
|
-
```
|
|
119
|
-
|
|
120
|
-
**Options:**
|
|
121
|
-
- `-f, --force` - Reinitialize even if already initialized
|
|
122
|
-
|
|
123
|
-
#### `source add <url>`
|
|
124
|
-
|
|
125
|
-
Add a git repository as a config source. Automatically clones the repository and copies config files to your local directory.
|
|
126
|
-
|
|
127
|
-
```bash
|
|
128
|
-
airc source add <url> [options]
|
|
129
|
-
```
|
|
130
|
-
|
|
131
|
-
**Arguments:**
|
|
132
|
-
- `url` - Git repository URL (GitHub/GitLab/Bitbucket, HTTPS or SSH)
|
|
133
|
-
- Regular URL: `https://github.com/user/configs`
|
|
134
|
-
- GitHub tree URL (sparse checkout): `https://github.com/user/configs/tree/main/subfolder`
|
|
135
|
-
|
|
136
|
-
**Options:**
|
|
137
|
-
- `-n, --name <name>` - Custom source name (default: extracted from URL)
|
|
138
|
-
- `-b, --branch <branch>` - Git branch to checkout (default: repository default)
|
|
139
|
-
- `--depth <number>` - Scan depth for config folders (default: 3)
|
|
140
|
-
- `-f, --force` - Replace existing source if it exists
|
|
141
|
-
|
|
142
|
-
**Examples:**
|
|
143
|
-
```bash
|
|
144
|
-
# Full repository clone
|
|
145
|
-
airc source add https://github.com/user/configs
|
|
146
|
-
|
|
147
|
-
# Custom name
|
|
148
|
-
airc source add git@github.com:user/configs.git --name my-configs
|
|
149
|
-
|
|
150
|
-
# Specific branch
|
|
151
|
-
airc source add https://github.com/user/configs --branch main
|
|
152
|
-
|
|
153
|
-
# GitHub tree URL (sparse checkout - only specified subfolder)
|
|
154
|
-
airc source add https://github.com/user/configs/tree/main/custom-skills
|
|
155
|
-
|
|
156
|
-
# Custom scan depth
|
|
157
|
-
airc source add https://github.com/user/configs --depth 5
|
|
158
|
-
```
|
|
159
|
-
|
|
160
|
-
**What happens:**
|
|
161
|
-
- Repository is cloned to `~/.airc/sources/{source-name}/`
|
|
162
|
-
- Config folders (skills, commands, agents) are discovered up to specified depth
|
|
163
|
-
- Config files (*.md) are copied to `~/.airc/config/{type}/{source-name}/`
|
|
164
|
-
- Metadata is tracked in `.aircrc` for smart updates
|
|
165
|
-
|
|
166
|
-
#### `source list`
|
|
167
|
-
|
|
168
|
-
List all added sources.
|
|
169
|
-
|
|
170
|
-
```bash
|
|
171
|
-
airc source list [options]
|
|
172
|
-
```
|
|
173
|
-
|
|
174
|
-
**Options:**
|
|
175
|
-
- `-v, --verbose` - Show detailed information (URL, branch, path)
|
|
176
|
-
|
|
177
|
-
#### `source update [name]`
|
|
178
|
-
|
|
179
|
-
Update source(s) to latest version with smart update logic.
|
|
180
|
-
|
|
181
|
-
```bash
|
|
182
|
-
airc source update [name] [options]
|
|
183
|
-
```
|
|
184
|
-
|
|
185
|
-
**Arguments:**
|
|
186
|
-
- `name` - Source name to update (optional)
|
|
187
|
-
|
|
188
|
-
**Options:**
|
|
189
|
-
- `-a, --all` - Update all sources
|
|
190
|
-
|
|
191
|
-
**Examples:**
|
|
192
|
-
```bash
|
|
193
|
-
# Update specific source
|
|
194
|
-
airc source update my-configs
|
|
195
|
-
|
|
196
|
-
# Update all sources
|
|
197
|
-
airc source update --all
|
|
198
|
-
```
|
|
199
|
-
|
|
200
|
-
**Smart Update Behavior:**
|
|
201
|
-
- **UPDATE**: Files with changed hashes are updated
|
|
202
|
-
- **ADD**: New files from source are added
|
|
203
|
-
- **SKIP**: Files with unchanged hashes are skipped
|
|
204
|
-
- **KEEP**: Files deleted from source are kept (conservative approach)
|
|
205
|
-
|
|
206
|
-
**Example Output:**
|
|
207
|
-
```
|
|
208
|
-
Updating source 'my-configs'...
|
|
209
|
-
✓ Updated: skills/my-configs/web-design.md
|
|
210
|
-
+ Added: skills/my-configs/api-helper.md
|
|
211
|
-
📦 Kept: skills/my-configs/old-config.md (deleted from source)
|
|
212
|
-
|
|
213
|
-
Summary: 1 updated, 1 added, 5 unchanged, 1 kept
|
|
214
|
-
Tip: Run 'airc install <tool>' to apply changes
|
|
215
|
-
```
|
|
216
|
-
|
|
217
|
-
#### `source remove [name]`
|
|
218
|
-
|
|
219
|
-
Remove source(s).
|
|
220
|
-
|
|
221
|
-
```bash
|
|
222
|
-
airc source remove [name] [options]
|
|
223
|
-
```
|
|
224
|
-
|
|
225
|
-
**Arguments:**
|
|
226
|
-
- `name` - Source name to remove (optional)
|
|
227
|
-
|
|
228
|
-
**Options:**
|
|
229
|
-
- `-f, --force` - Confirm removal without prompt (required)
|
|
230
|
-
- `-a, --all` - Remove all sources
|
|
231
|
-
|
|
232
|
-
#### `source check [name]`
|
|
233
|
-
|
|
234
|
-
Check if source(s) have updates available.
|
|
235
|
-
|
|
236
|
-
```bash
|
|
237
|
-
airc source check [name] [options]
|
|
238
|
-
```
|
|
239
|
-
|
|
240
|
-
**Arguments:**
|
|
241
|
-
- `name` - Source name to check (optional)
|
|
242
|
-
|
|
243
|
-
**Options:**
|
|
244
|
-
- `-a, --all` - Check all sources
|
|
245
|
-
|
|
246
|
-
#### `browse`
|
|
247
|
-
|
|
248
|
-
Browse available configs in `~/.airc/config/` directory.
|
|
249
|
-
|
|
250
|
-
```bash
|
|
251
|
-
airc browse
|
|
252
|
-
```
|
|
253
|
-
|
|
254
|
-
Opens the config directory in your file browser for easy exploration.
|
|
255
|
-
|
|
256
|
-
#### `remove <path>`
|
|
257
|
-
|
|
258
|
-
Remove a config file from your local directory.
|
|
259
|
-
|
|
260
|
-
```bash
|
|
261
|
-
airc remove <path> [options]
|
|
262
|
-
```
|
|
263
|
-
|
|
264
|
-
**Arguments:**
|
|
265
|
-
- `path` - Config file path relative to `~/.airc/config/` (e.g., `skills/my-source/web-design.md`)
|
|
266
|
-
|
|
267
|
-
**Options:**
|
|
268
|
-
- `-f, --force` - Confirm removal without prompt (required)
|
|
269
|
-
|
|
270
|
-
**Examples:**
|
|
271
|
-
```bash
|
|
272
|
-
airc remove skills/my-source/web-design.md --force
|
|
273
|
-
airc remove commands/external/check-types.md --force
|
|
274
|
-
```
|
|
275
|
-
|
|
276
|
-
**What happens:**
|
|
277
|
-
- Config file is deleted from `~/.airc/config/`
|
|
278
|
-
- Metadata is cleaned up from `.aircrc`
|
|
279
|
-
- Helpful restore hint is displayed (use `airc source update` to restore)
|
|
280
|
-
|
|
281
|
-
#### `list`
|
|
282
|
-
|
|
283
|
-
List all configs in user config directory with their details.
|
|
284
|
-
|
|
285
|
-
```bash
|
|
286
|
-
airc list [options]
|
|
287
|
-
```
|
|
288
|
-
|
|
289
|
-
**Options:**
|
|
290
|
-
- `-t, --type <type>` - Filter by type (commands, skills, agents)
|
|
291
|
-
- `-v, --verbose` - Show detailed information (file counts, last updated time)
|
|
292
|
-
|
|
293
|
-
#### `status`
|
|
294
|
-
|
|
295
|
-
Show status of sources and configs.
|
|
296
|
-
|
|
297
|
-
```bash
|
|
298
|
-
airc status
|
|
299
|
-
```
|
|
300
|
-
|
|
301
|
-
Shows:
|
|
302
|
-
- Initialization status
|
|
303
|
-
- Sources status (up-to-date, behind, ahead, diverged)
|
|
304
|
-
- Configs status (total, linked, imported, by type)
|
|
305
|
-
|
|
306
|
-
#### `create <type> <name>`
|
|
307
|
-
|
|
308
|
-
Create a new config in user directory.
|
|
309
|
-
|
|
310
|
-
```bash
|
|
311
|
-
airc create <type> <name> [options]
|
|
312
|
-
```
|
|
313
|
-
|
|
314
|
-
**Arguments:**
|
|
315
|
-
- `type` - Config type (command, skill, agent)
|
|
316
|
-
- `name` - Config name (lowercase, numbers, hyphens only)
|
|
317
|
-
|
|
318
|
-
**Options:**
|
|
319
|
-
- `-d, --description <description>` - Config description
|
|
320
|
-
- `-f, --force` - Overwrite existing config
|
|
321
|
-
|
|
322
|
-
#### `edit <type> <name>`
|
|
323
|
-
|
|
324
|
-
Edit a config in your default editor.
|
|
325
|
-
|
|
326
|
-
```bash
|
|
327
|
-
airc edit <type> <name>
|
|
328
|
-
```
|
|
329
|
-
|
|
330
|
-
**Arguments:**
|
|
331
|
-
- `type` - Config type (command, skill, agent)
|
|
332
|
-
- `name` - Config name
|
|
333
|
-
|
|
334
|
-
Uses `$EDITOR` or `$VISUAL` environment variable (defaults to vi).
|
|
335
|
-
|
|
336
|
-
#### `install <tool>`
|
|
337
|
-
|
|
338
|
-
Install configuration files to a specific AI tool.
|
|
339
|
-
|
|
340
|
-
```bash
|
|
341
|
-
airc install <tool> [options]
|
|
342
|
-
```
|
|
343
|
-
|
|
344
|
-
**Arguments:**
|
|
345
|
-
- `tool` - AI tool name (claude, gemini, cursor, copilot, antigravity, opencode)
|
|
346
|
-
|
|
347
|
-
**Options:**
|
|
348
|
-
- `-c, --config-path <path>` - Path to config folder (default: user config)
|
|
349
|
-
- `-f, --force` - Overwrite existing files without prompting
|
|
350
|
-
- `-g, --global` - Install to global directory (~/.tool) instead of project directory
|
|
351
|
-
|
|
352
|
-
**Supported AI Tools:**
|
|
353
|
-
|
|
354
|
-
| Tool | Project Path | Global Path | Format Conversion |
|
|
355
|
-
|------|-------------|-------------|-------------------|
|
|
356
|
-
| `claude` | `.claude/` | `~/.claude/` | None (native format) |
|
|
357
|
-
| `gemini` | `.gemini/` | `~/.gemini/` | Commands → TOML |
|
|
358
|
-
| `cursor` | `.cursor/` | `~/.cursor/` | None (native format) |
|
|
359
|
-
| `copilot` | `.github/` | `~/.copilot/` | Commands → .prompt.md |
|
|
360
|
-
| `antigravity` | `.gemini/antigravity/` | `~/.gemini/antigravity/` | Commands → YAML workflows |
|
|
361
|
-
| `opencode` | `.opencode/` | `~/.config/opencode/` | None (native format) |
|
|
362
|
-
|
|
363
|
-
## Common Workflows
|
|
364
|
-
|
|
365
|
-
### First Time Setup
|
|
366
|
-
|
|
367
|
-
```bash
|
|
368
|
-
# 1. Initialize airc
|
|
369
|
-
airc init
|
|
370
|
-
|
|
371
|
-
# 2. Add your config sources
|
|
372
|
-
airc source add https://github.com/myteam/ai-configs --name team-configs
|
|
373
|
-
airc source add https://github.com/personal/my-skills --name personal
|
|
374
|
-
|
|
375
|
-
# 3. View what was copied
|
|
376
|
-
airc list
|
|
377
|
-
|
|
378
|
-
# 4. Install to your AI tool (e.g., Claude)
|
|
75
|
+
# Install to Claude for your project only(<project-root>/.claude)
|
|
76
|
+
cd <project-root>
|
|
379
77
|
airc install claude
|
|
380
|
-
```
|
|
381
|
-
|
|
382
|
-
### Using Sparse Checkout for Large Repositories
|
|
383
|
-
|
|
384
|
-
```bash
|
|
385
|
-
# Clone only the "custom-prompts" subfolder
|
|
386
|
-
airc source add https://github.com/bigorg/ai-resources/tree/main/custom-prompts
|
|
387
78
|
|
|
388
|
-
#
|
|
389
|
-
```
|
|
390
|
-
|
|
391
|
-
### Updating Configs from Upstream
|
|
392
|
-
|
|
393
|
-
```bash
|
|
394
|
-
# Update specific source
|
|
395
|
-
airc source update team-configs
|
|
396
|
-
|
|
397
|
-
# Or update all sources at once
|
|
398
|
-
airc source update --all
|
|
399
|
-
|
|
400
|
-
# Then reinstall to apply changes
|
|
401
|
-
airc install claude --force
|
|
402
|
-
```
|
|
403
|
-
|
|
404
|
-
### Managing Multiple Sources with Conflicts
|
|
405
|
-
|
|
406
|
-
```bash
|
|
407
|
-
# Add multiple sources that might have overlapping file names
|
|
408
|
-
airc source add https://github.com/team-a/configs --name team-a
|
|
409
|
-
airc source add https://github.com/team-b/configs --name team-b
|
|
410
|
-
|
|
411
|
-
# Files are organized by source prefix
|
|
412
|
-
airc list
|
|
413
|
-
# Output shows:
|
|
414
|
-
# skills/team-a/web-design.md
|
|
415
|
-
# skills/team-b/web-design.md
|
|
416
|
-
|
|
417
|
-
# Both versions are installed without conflicts
|
|
418
|
-
airc install claude
|
|
419
|
-
```
|
|
420
|
-
|
|
421
|
-
### Removing Unwanted Configs
|
|
422
|
-
|
|
423
|
-
```bash
|
|
424
|
-
# Remove a specific config file
|
|
425
|
-
airc remove skills/team-a/old-skill.md --force
|
|
426
|
-
|
|
427
|
-
# If you change your mind, restore it from source
|
|
428
|
-
airc source update team-a
|
|
429
|
-
```
|
|
430
|
-
|
|
431
|
-
### Working Across Multiple Projects
|
|
432
|
-
|
|
433
|
-
```bash
|
|
434
|
-
# Install to project-specific directory (default)
|
|
435
|
-
cd ~/projects/my-app
|
|
436
|
-
airc install claude
|
|
437
|
-
|
|
438
|
-
# Install globally for all projects
|
|
79
|
+
# Install globally(~/.claude)
|
|
439
80
|
airc install claude --global
|
|
440
81
|
```
|
|
441
82
|
|
|
442
|
-
###
|
|
443
|
-
|
|
444
|
-
```
|
|
445
|
-
airc/
|
|
446
|
-
├── config/ # Default configuration files
|
|
447
|
-
│ └── .claude/ # Source configs (Claude format)
|
|
448
|
-
│ ├── commands/ # Command definitions
|
|
449
|
-
│ ├── skills/ # Skill definitions
|
|
450
|
-
│ └── agents/ # Agent definitions
|
|
451
|
-
├── src/ # Source code
|
|
452
|
-
│ ├── commands/ # CLI commands
|
|
453
|
-
│ │ ├── init.ts # Initialize user config
|
|
454
|
-
│ │ ├── sourceAdd.ts # Add git sources (with auto-copy)
|
|
455
|
-
│ │ ├── sourceList.ts # List sources
|
|
456
|
-
│ │ ├── sourceRemove.ts # Remove sources
|
|
457
|
-
│ │ ├── sourceUpdate.ts # Update sources (smart update)
|
|
458
|
-
│ │ ├── sourceCheck.ts # Check source status
|
|
459
|
-
│ │ ├── browse.ts # Browse available configs
|
|
460
|
-
│ │ ├── remove.ts # Remove configs
|
|
461
|
-
│ │ ├── list.ts # List local configs
|
|
462
|
-
│ │ ├── status.ts # Show status
|
|
463
|
-
│ │ ├── create.ts # Create new configs
|
|
464
|
-
│ │ ├── edit.ts # Edit configs
|
|
465
|
-
│ │ └── install.ts # Install to AI tools
|
|
466
|
-
│ ├── utils/ # Utility functions
|
|
467
|
-
│ │ ├── copy.ts # File copying with conversion
|
|
468
|
-
│ │ ├── converters.ts # Format converters
|
|
469
|
-
│ │ ├── paths.ts # Path resolution
|
|
470
|
-
│ │ ├── validation.ts # Input validation
|
|
471
|
-
│ │ ├── userConfig.ts # User config management
|
|
472
|
-
│ │ └── sourceUtils.ts # Git source utilities
|
|
473
|
-
│ ├── cli.ts # CLI entry point
|
|
474
|
-
│ └── types.ts # TypeScript types
|
|
475
|
-
├── dist/ # Compiled JavaScript
|
|
476
|
-
├── package.json
|
|
477
|
-
├── tsconfig.json
|
|
478
|
-
└── README.md
|
|
479
|
-
```
|
|
480
|
-
|
|
481
|
-
### User Config Directory Structure
|
|
482
|
-
|
|
483
|
-
After running `airc init`, your user config directory:
|
|
484
|
-
|
|
485
|
-
```
|
|
486
|
-
~/.airc/
|
|
487
|
-
├── config/ # Local config storage
|
|
488
|
-
│ ├── skills/ # Skills by source
|
|
489
|
-
│ │ ├── my-configs/ # From source "my-configs"
|
|
490
|
-
│ │ │ └── web-design.md
|
|
491
|
-
│ │ └── other-source/ # From source "other-source"
|
|
492
|
-
│ │ └── api-helper.md
|
|
493
|
-
│ ├── commands/ # Commands by source
|
|
494
|
-
│ │ └── my-configs/
|
|
495
|
-
│ │ └── check-types.md
|
|
496
|
-
│ └── agents/ # Agents by source
|
|
497
|
-
│ └── my-configs/
|
|
498
|
-
│ └── code-reviewer.md
|
|
499
|
-
├── sources/ # Git source repositories
|
|
500
|
-
│ ├── my-configs/ # Cloned source repository
|
|
501
|
-
│ │ └── (repository files)
|
|
502
|
-
│ └── other-source/
|
|
503
|
-
│ └── (repository files)
|
|
504
|
-
└── .aircrc # User configuration file (with metadata)
|
|
505
|
-
```
|
|
506
|
-
|
|
507
|
-
## Development
|
|
508
|
-
|
|
509
|
-
### Scripts
|
|
510
|
-
|
|
511
|
-
- `bun run build` - Build the TypeScript project
|
|
512
|
-
- `bun test` - Run tests (532+ tests, >80% coverage)
|
|
513
|
-
- `bun run test:watch` - Run tests in watch mode
|
|
514
|
-
- `bun run lint` - Lint the source code using oxlint
|
|
515
|
-
- `bun run airc` - Run CLI during development
|
|
516
|
-
|
|
517
|
-
### Adding a New AI Tool
|
|
518
|
-
|
|
519
|
-
To add support for a new AI tool:
|
|
520
|
-
|
|
521
|
-
1. **Update types** (`src/types.ts`):
|
|
522
|
-
- Add to `AIType` union
|
|
523
|
-
- Add to `AI_FOLDERS` mapping
|
|
524
|
-
- Add to `AI_SUBFOLDERS` mapping
|
|
525
|
-
|
|
526
|
-
2. **Update paths** (`src/utils/paths.ts`):
|
|
527
|
-
- Add entry to `TOOL_PATHS` with project/global paths and subfolders
|
|
528
|
-
|
|
529
|
-
3. **Add converter** (`src/utils/converters.ts`):
|
|
530
|
-
- Add converter function if format transformation is needed
|
|
531
|
-
|
|
532
|
-
4. **Update copy logic** (`src/utils/copy.ts`):
|
|
533
|
-
- Add tool-specific limitations if any
|
|
534
|
-
|
|
535
|
-
5. **Update documentation**:
|
|
536
|
-
- Update README.md with supported tools table
|
|
537
|
-
- Add format conversion examples if applicable
|
|
538
|
-
|
|
539
|
-
### Format Conversions
|
|
540
|
-
|
|
541
|
-
The tool automatically converts Claude command format to tool-specific formats:
|
|
542
|
-
|
|
543
|
-
**Gemini CLI (.toml):**
|
|
544
|
-
```toml
|
|
545
|
-
[[command]]
|
|
546
|
-
name = "command-name"
|
|
547
|
-
description = "Command description"
|
|
548
|
-
|
|
549
|
-
[prompt]
|
|
550
|
-
type = "text"
|
|
551
|
-
content = """
|
|
552
|
-
Command content
|
|
553
|
-
"""
|
|
554
|
-
```
|
|
555
|
-
|
|
556
|
-
**GitHub Copilot (.prompt.md):**
|
|
557
|
-
```markdown
|
|
558
|
-
# Command Description
|
|
559
|
-
|
|
560
|
-
Command content
|
|
561
|
-
```
|
|
562
|
-
|
|
563
|
-
**Antigravity (.yaml):**
|
|
564
|
-
```yaml
|
|
565
|
-
name: "command-name"
|
|
566
|
-
description: "Command description"
|
|
567
|
-
|
|
568
|
-
rules:
|
|
569
|
-
- "Analyze the user's request"
|
|
570
|
-
- "Follow the task instructions below"
|
|
571
|
-
|
|
572
|
-
prompt: |
|
|
573
|
-
Command content
|
|
574
|
-
```
|
|
575
|
-
|
|
576
|
-
## Testing
|
|
577
|
-
|
|
578
|
-
The project includes comprehensive tests:
|
|
83
|
+
### 4. Update imported config
|
|
579
84
|
|
|
580
85
|
```bash
|
|
581
|
-
|
|
582
|
-
bun test
|
|
583
|
-
|
|
584
|
-
# Run tests in watch mode
|
|
585
|
-
bun run test:watch
|
|
86
|
+
airc source update react-best-practices
|
|
586
87
|
```
|
|
587
88
|
|
|
588
|
-
|
|
589
|
-
- Type definitions and validation
|
|
590
|
-
- User config initialization and management
|
|
591
|
-
- Git source operations (add, list, remove, update, check)
|
|
592
|
-
- GitHub tree URL parsing and sparse checkout
|
|
593
|
-
- Folder scanning and categorization (with fuzzy matching)
|
|
594
|
-
- File hashing and change detection
|
|
595
|
-
- Config file copying with source prefix
|
|
596
|
-
- Metadata tracking and smart updates
|
|
597
|
-
- Config browsing and discovery
|
|
598
|
-
- Config removal with metadata cleanup
|
|
599
|
-
- Config creation and editing
|
|
600
|
-
- Path resolution for all tools and scopes
|
|
601
|
-
- Format conversion for all target tools
|
|
602
|
-
- Copy operations with and without force flag
|
|
603
|
-
- Global vs project-level installations
|
|
604
|
-
- Integration tests for full workflows
|
|
605
|
-
- Error handling and edge cases
|
|
606
|
-
|
|
607
|
-
**Test Stats:**
|
|
608
|
-
- 532+ tests across 29+ test files
|
|
609
|
-
- ~111ms execution time
|
|
610
|
-
- Full coverage of all commands and utilities
|
|
611
|
-
|
|
612
|
-
## Key Concepts
|
|
613
|
-
|
|
614
|
-
### Source-Based Config Management
|
|
615
|
-
|
|
616
|
-
Sources are git repositories containing config files:
|
|
617
|
-
- Automatically cloned to `~/.airc/sources/` when added
|
|
618
|
-
- Config files are automatically copied to `~/.airc/config/{type}/{source-name}/`
|
|
619
|
-
- Can be updated with `airc source update` (smart update - only changed files)
|
|
620
|
-
- Metadata is tracked in `.aircrc` for efficient updates
|
|
621
|
-
|
|
622
|
-
### Sparse Checkout Support
|
|
623
|
-
|
|
624
|
-
GitHub tree URLs enable sparse checkout (only specified subfolder):
|
|
625
|
-
```bash
|
|
626
|
-
# Regular URL - clones entire repository
|
|
627
|
-
airc source add https://github.com/user/configs
|
|
628
|
-
|
|
629
|
-
# Tree URL - clones only "custom-skills" subfolder
|
|
630
|
-
airc source add https://github.com/user/configs/tree/main/custom-skills
|
|
631
|
-
```
|
|
632
|
-
|
|
633
|
-
### Smart Updates
|
|
634
|
-
|
|
635
|
-
When you run `airc source update`, the tool intelligently:
|
|
636
|
-
- **UPDATE**: Files with changed hashes (re-copies with updated content)
|
|
637
|
-
- **ADD**: New files from source (copies to local directory)
|
|
638
|
-
- **SKIP**: Files with unchanged hashes (no action needed)
|
|
639
|
-
- **KEEP**: Files deleted from source (conservative approach - doesn't delete)
|
|
89
|
+
### 5. Removing Unwanted Configs
|
|
640
90
|
|
|
641
|
-
### Conflict Resolution
|
|
642
|
-
|
|
643
|
-
Multiple sources can have files with the same name. Source prefix directories prevent conflicts and allow easy identification:
|
|
644
|
-
|
|
645
|
-
**Example Scenario:**
|
|
646
91
|
```bash
|
|
647
|
-
|
|
648
|
-
airc source add https://github.com/team-a/configs --name team-a
|
|
649
|
-
|
|
650
|
-
# Add second source also containing web-design.md
|
|
651
|
-
airc source add https://github.com/team-b/configs --name team-b
|
|
92
|
+
airc remove react-best-practices
|
|
652
93
|
```
|
|
653
94
|
|
|
654
|
-
|
|
655
|
-
```
|
|
656
|
-
~/.airc/config/
|
|
657
|
-
├── skills/
|
|
658
|
-
│ ├── team-a/
|
|
659
|
-
│ │ └── web-design.md ← From team-a's repository
|
|
660
|
-
│ └── team-b/
|
|
661
|
-
│ └── web-design.md ← From team-b's repository
|
|
662
|
-
```
|
|
663
|
-
|
|
664
|
-
**Installation:**
|
|
665
|
-
```bash
|
|
666
|
-
# Both versions coexist and can be installed
|
|
667
|
-
airc list --type skills
|
|
668
|
-
# Output:
|
|
669
|
-
# skills/team-a/web-design.md (source: team-a)
|
|
670
|
-
# skills/team-b/web-design.md (source: team-b)
|
|
671
|
-
|
|
672
|
-
# Install to Claude (both will be installed)
|
|
673
|
-
airc install claude
|
|
674
|
-
```
|
|
95
|
+
### 6. Add your own configs
|
|
675
96
|
|
|
676
|
-
|
|
97
|
+
Initially we have three folders in config folder(skills / commands / agents), but you can add your own custom folder, they will be copied to target folder when using `airc install` command:
|
|
677
98
|
|
|
678
99
|
```
|
|
679
|
-
|
|
100
|
+
airc/
|
|
101
|
+
├── config/ # Default configuration files
|
|
102
|
+
│ ├── commands/ # Command definitions
|
|
103
|
+
│ ├── skills/ # Skill definitions
|
|
104
|
+
│ ├── agents/ # Agent definitions
|
|
105
|
+
│ └── scripts/ # Add your own config folder
|
|
680
106
|
```
|
|
681
|
-
|
|
682
|
-
1. Add source repository (`airc source add`)
|
|
683
|
-
2. Configs are automatically copied to local directory
|
|
684
|
-
3. Install configs to specific AI tools (`airc install`)
|
|
685
|
-
|
|
686
|
-
## Error Handling
|
|
687
|
-
|
|
688
|
-
The CLI provides clear error messages for common issues:
|
|
689
|
-
|
|
690
|
-
- **Invalid AI tool**: Shows list of supported tools
|
|
691
|
-
- **Missing config path**: Prompts to initialize airc or add sources
|
|
692
|
-
- **Target exists**: Warns about existing files and suggests --force flag
|
|
693
|
-
- **Conversion failures**: Logs warnings for files that couldn't be converted
|
|
694
|
-
- **Unsupported features**: Notes when a tool doesn't support certain features (e.g., Copilot global agents)
|
|
695
|
-
|
|
696
|
-
## Special Behaviors
|
|
697
|
-
|
|
698
|
-
### Tool-Specific Limitations
|
|
699
|
-
|
|
700
|
-
- **Gemini**: Does not support agents (agents folder is skipped)
|
|
701
|
-
- **Antigravity**: Does not support commands or agents (only workflows/skills)
|
|
702
|
-
- **Copilot Global**: Does not support agents (agents folder is skipped with info message)
|
|
703
|
-
|
|
704
|
-
### File Format Handling
|
|
705
|
-
|
|
706
|
-
- **.md files**: Converted based on target tool format
|
|
707
|
-
- **Other files**: Copied as-is without conversion
|
|
708
|
-
|
|
709
|
-
## License
|
|
710
|
-
|
|
711
|
-
MIT
|
|
712
|
-
|
|
713
|
-
## Contributing
|
|
714
|
-
|
|
715
|
-
Contributions are welcome! Please ensure:
|
|
716
|
-
|
|
717
|
-
1. All tests pass (`bun test`)
|
|
718
|
-
2. Test coverage remains above 80%
|
|
719
|
-
3. Code follows the existing style
|
|
720
|
-
4. Commit messages are clear and descriptive
|
|
721
|
-
|
|
722
|
-
## Support
|
|
723
|
-
|
|
724
|
-
For issues and questions, please open an issue on the project repository.
|