@cocaxcode/ai-context-inspector 0.3.2 → 0.4.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 +124 -9
- package/dist/{chunk-G57UDS2C.js → chunk-3NLUFQSB.js} +966 -19
- package/dist/index.js +657 -8
- package/dist/server-22Y7DPSM.js +395 -0
- package/package.json +79 -75
- package/dist/server-BSHVSE33.js +0 -179
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
<h1 align="center">@cocaxcode/ai-context-inspector</h1>
|
|
3
3
|
<p align="center">
|
|
4
4
|
<strong>See everything your AI tools know about your project.</strong><br/>
|
|
5
|
-
19 AI tools · 6 scanners ·
|
|
5
|
+
19 AI tools · 6 scanners · 5 MCP tools · Export/Import across 7 tools · CLI + MCP server
|
|
6
6
|
</p>
|
|
7
7
|
</p>
|
|
8
8
|
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
<a href="https://opensource.org/licenses/MIT"><img src="https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square" alt="License" /></a>
|
|
13
13
|
<img src="https://img.shields.io/badge/node-%3E%3D20-339933?style=flat-square&logo=node.js&logoColor=white" alt="Node" />
|
|
14
14
|
<img src="https://img.shields.io/badge/AI%20tools-19%20supported-blueviolet?style=flat-square" alt="19 AI tools" />
|
|
15
|
-
<img src="https://img.shields.io/badge/tests-
|
|
15
|
+
<img src="https://img.shields.io/badge/tests-104-brightgreen?style=flat-square" alt="104 tests" />
|
|
16
16
|
</p>
|
|
17
17
|
|
|
18
18
|
<p align="center">
|
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
<a href="#the-solution">The Solution</a> ·
|
|
21
21
|
<a href="#installation">Installation</a> ·
|
|
22
22
|
<a href="#cli-usage">CLI Usage</a> ·
|
|
23
|
+
<a href="#exportimport">Export/Import</a> ·
|
|
23
24
|
<a href="#mcp-server">MCP Server</a> ·
|
|
24
25
|
<a href="#what-it-detects">What It Detects</a> ·
|
|
25
26
|
<a href="#html-dashboard">HTML Dashboard</a> ·
|
|
@@ -175,9 +176,78 @@ npx @cocaxcode/ai-context-inspector --dir ./my-project --user --introspect --tim
|
|
|
175
176
|
|
|
176
177
|
---
|
|
177
178
|
|
|
179
|
+
## Export/Import
|
|
180
|
+
|
|
181
|
+
Move your AI configuration between tools. Export from one project, import into another — or the same project with a different AI tool.
|
|
182
|
+
|
|
183
|
+
### Quick Start
|
|
184
|
+
|
|
185
|
+
```bash
|
|
186
|
+
# Export your AI ecosystem to .aci/bundle.json
|
|
187
|
+
npx @cocaxcode/ai-context-inspector export
|
|
188
|
+
|
|
189
|
+
# Import into a project using Cursor
|
|
190
|
+
npx @cocaxcode/ai-context-inspector import --target cursor
|
|
191
|
+
|
|
192
|
+
# Non-interactive export (all categories, no secrets)
|
|
193
|
+
npx @cocaxcode/ai-context-inspector export --only mcp,context --secrets none
|
|
194
|
+
|
|
195
|
+
# Non-interactive import (auto-detect tool, skip confirmation)
|
|
196
|
+
npx @cocaxcode/ai-context-inspector import --yes --force
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
### Export Flags
|
|
200
|
+
|
|
201
|
+
| Flag | Description | Default |
|
|
202
|
+
|------|-------------|---------|
|
|
203
|
+
| `--dir <path>` | Directory to export | `.` (current) |
|
|
204
|
+
| `--output <path>` | Output directory | `.aci/` |
|
|
205
|
+
| `--include-user` | Include user-level configs (`~/`) | `false` |
|
|
206
|
+
| `--only <categories>` | Filter: `mcp,skills,agents,memories,context` | all |
|
|
207
|
+
| `--secrets <mode>` | `none` (redact all) or `all` (include all) | interactive |
|
|
208
|
+
|
|
209
|
+
### Import Flags
|
|
210
|
+
|
|
211
|
+
| Flag | Description | Default |
|
|
212
|
+
|------|-------------|---------|
|
|
213
|
+
| `[file]` | Path to bundle JSON | auto-detect `.aci/bundle.json` |
|
|
214
|
+
| `--dir <path>` | Target directory | `.` (current) |
|
|
215
|
+
| `--target <tool>` | Target tool (see table below) | auto-detect |
|
|
216
|
+
| `--scope <scope>` | `project` or `user` | per-resource |
|
|
217
|
+
| `--force` | Overwrite existing resources | `false` |
|
|
218
|
+
| `--yes` | Skip confirmation prompt | `false` |
|
|
219
|
+
| `--only <categories>` | Filter: `mcp,skills,agents,memories,context` | all |
|
|
220
|
+
| `--secrets <mode>` | `none` or `all` | interactive |
|
|
221
|
+
|
|
222
|
+
### Supported Target Tools
|
|
223
|
+
|
|
224
|
+
| Target | MCP Config | Context File | Rules Dir | Skills | Agents |
|
|
225
|
+
|--------|-----------|-------------|-----------|--------|--------|
|
|
226
|
+
| `claude` | `.mcp.json` | `CLAUDE.md` | — | `.claude/skills/` | `.claude/agents/` |
|
|
227
|
+
| `cursor` | `.cursor/mcp.json` | `.cursorrules` | `.cursor/rules/` | — | — |
|
|
228
|
+
| `windsurf` | `.mcp.json` | `.windsurfrules` | `.windsurf/rules/` | — | — |
|
|
229
|
+
| `copilot` | `.vscode/mcp.json` | `.github/copilot-instructions.md` | `.github/instructions/` | — | `.github/agents/` |
|
|
230
|
+
| `gemini` | `.gemini/settings.json` | `GEMINI.md` | `.gemini/rules/` | — | — |
|
|
231
|
+
| `codex` | `.mcp.json` | `AGENTS.md` | `.codex/rules/` | — | — |
|
|
232
|
+
| `opencode` | `opencode.json` | `OPENCODE.md` | `.opencode/rules/` | — | — |
|
|
233
|
+
|
|
234
|
+
### The `.aci/` Directory
|
|
235
|
+
|
|
236
|
+
Export creates `.aci/bundle.json` — a self-contained, checksummed JSON bundle with all your AI resources. It is automatically added to `.gitignore`. Import auto-detects this directory when no file path is specified.
|
|
237
|
+
|
|
238
|
+
### Secrets Handling
|
|
239
|
+
|
|
240
|
+
Environment variables in MCP server configs (API keys, tokens, passwords) are detected automatically. Three modes:
|
|
241
|
+
|
|
242
|
+
- **`none`** — redact all sensitive values (safe for sharing)
|
|
243
|
+
- **`all`** — include all values as-is
|
|
244
|
+
- **interactive** (default in CLI) — prompt per variable
|
|
245
|
+
|
|
246
|
+
---
|
|
247
|
+
|
|
178
248
|
## MCP Server
|
|
179
249
|
|
|
180
|
-
When running as an MCP server (`--mcp`),
|
|
250
|
+
When running as an MCP server (`--mcp`), five tools are exposed:
|
|
181
251
|
|
|
182
252
|
### `scan`
|
|
183
253
|
|
|
@@ -228,6 +298,40 @@ Generate a standalone HTML dashboard from scan results.
|
|
|
228
298
|
|
|
229
299
|
**Example prompt:** _"Generate an HTML report of my project's AI context"_
|
|
230
300
|
|
|
301
|
+
### `export_ecosystem`
|
|
302
|
+
|
|
303
|
+
Export the complete AI ecosystem to a portable `.aci/bundle.json`.
|
|
304
|
+
|
|
305
|
+
**Parameters:**
|
|
306
|
+
|
|
307
|
+
| Parameter | Type | Required | Description |
|
|
308
|
+
|-----------|------|----------|-------------|
|
|
309
|
+
| `dir` | string | No | Directory to scan (default: cwd) |
|
|
310
|
+
| `include_user` | boolean | No | Include user-level configs |
|
|
311
|
+
| `only` | string[] | No | Categories: `mcp`, `skills`, `agents`, `memories`, `context` |
|
|
312
|
+
| `secrets` | string | No | `"none"` (default), `"all"`, or `["VAR1", "VAR2"]` to include specific vars |
|
|
313
|
+
|
|
314
|
+
**Example prompt:** _"Export my AI ecosystem without secrets"_
|
|
315
|
+
|
|
316
|
+
### `import_ecosystem`
|
|
317
|
+
|
|
318
|
+
Import a bundle into a project, adapting configuration to the target AI tool.
|
|
319
|
+
|
|
320
|
+
**Parameters:**
|
|
321
|
+
|
|
322
|
+
| Parameter | Type | Required | Description |
|
|
323
|
+
|-----------|------|----------|-------------|
|
|
324
|
+
| `file` | string | No | Path to bundle (auto-detects `.aci/bundle.json`) |
|
|
325
|
+
| `dir` | string | No | Target directory (default: cwd) |
|
|
326
|
+
| `target` | string | No | Target tool (auto-detects). One of: `claude`, `cursor`, `windsurf`, `copilot`, `gemini`, `codex`, `opencode` |
|
|
327
|
+
| `scope` | string | No | `project` or `user` |
|
|
328
|
+
| `force` | boolean | No | Overwrite existing resources |
|
|
329
|
+
| `confirm` | boolean | No | Execute import (`false` = dry-run plan only) |
|
|
330
|
+
| `only` | string[] | No | Categories to import |
|
|
331
|
+
| `secrets` | string | No | `"none"`, `"all"`, `["VAR1"]`, or `{"VAR1": "value"}` |
|
|
332
|
+
|
|
333
|
+
**Example prompt:** _"Import the AI bundle into this project for Cursor"_
|
|
334
|
+
|
|
231
335
|
---
|
|
232
336
|
|
|
233
337
|
## What It Detects
|
|
@@ -307,9 +411,9 @@ The CLI generates a **self-contained HTML file** (no external dependencies) with
|
|
|
307
411
|
```
|
|
308
412
|
src/
|
|
309
413
|
├── index.ts # Entry: CLI vs MCP mode routing
|
|
310
|
-
├── cli.ts # CLI arg parsing + orchestration
|
|
414
|
+
├── cli.ts # CLI arg parsing + orchestration (scan, export, import)
|
|
311
415
|
├── server.ts # createServer() MCP factory
|
|
312
|
-
├── scanner/
|
|
416
|
+
├── scanner/ # Discovery engine
|
|
313
417
|
│ ├── types.ts # All TypeScript interfaces
|
|
314
418
|
│ ├── catalog.ts # AI_FILE_CATALOG (50+ entries, 19 tools)
|
|
315
419
|
│ ├── index.ts # runAllScanners() orchestrator
|
|
@@ -319,6 +423,15 @@ src/
|
|
|
319
423
|
│ ├── skills.ts # Scan skill directories + parse frontmatter
|
|
320
424
|
│ ├── agents.ts # Scan agent directories + detect memory
|
|
321
425
|
│ └── memories.ts # Detect engram, openspec, .atl, claude memory
|
|
426
|
+
├── ecosystem/ # Export/import engine
|
|
427
|
+
│ ├── types.ts # Bundle format, import targets, options
|
|
428
|
+
│ ├── index.ts # Public API re-exports
|
|
429
|
+
│ ├── export.ts # Scan → bundle → .aci/bundle.json
|
|
430
|
+
│ ├── import.ts # Load bundle → plan → execute
|
|
431
|
+
│ ├── target-map.ts # Path configs for 7 AI tools
|
|
432
|
+
│ ├── detect-target.ts # Auto-detect AI tool in project
|
|
433
|
+
│ ├── secrets.ts # Env var detection + sensitive patterns
|
|
434
|
+
│ └── prompts.ts # Interactive CLI prompts
|
|
322
435
|
├── report/
|
|
323
436
|
│ ├── generator.ts # generateHtml(ScanResult) → string
|
|
324
437
|
│ ├── sections.ts # HTML section renderers
|
|
@@ -327,11 +440,13 @@ src/
|
|
|
327
440
|
├── tools/
|
|
328
441
|
│ ├── scan.ts # MCP tool: scan project
|
|
329
442
|
│ ├── introspect.ts # MCP tool: introspect specific MCP
|
|
330
|
-
│
|
|
443
|
+
│ ├── report.ts # MCP tool: generate HTML report
|
|
444
|
+
│ ├── export.ts # MCP tool: export_ecosystem
|
|
445
|
+
│ └── import.ts # MCP tool: import_ecosystem
|
|
331
446
|
└── __tests__/
|
|
332
|
-
├── fixtures/ # Test projects (full, empty, mcp-only)
|
|
447
|
+
├── fixtures/ # Test projects (full, empty, mcp-only, export-project)
|
|
333
448
|
├── helpers.ts # fixture() path helper
|
|
334
|
-
└── *.test.ts #
|
|
449
|
+
└── *.test.ts # 10 test files, 104 tests
|
|
335
450
|
```
|
|
336
451
|
|
|
337
452
|
### 6 Parallel Scanners
|
|
@@ -355,7 +470,7 @@ All scanners run in parallel via `Promise.all()` for maximum speed.
|
|
|
355
470
|
- **@modelcontextprotocol/sdk** — MCP client + server
|
|
356
471
|
- **Zod** — schema validation for MCP tool inputs
|
|
357
472
|
- **tsup** — build (ESM output with shebang)
|
|
358
|
-
- **Vitest** — testing (
|
|
473
|
+
- **Vitest** — testing (104 tests)
|
|
359
474
|
|
|
360
475
|
**Zero runtime dependencies** beyond MCP SDK and Zod.
|
|
361
476
|
|