agdex 0.3.0 → 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 +40 -1
- package/dist/cli/index.js +28 -19
- package/dist/index-pkx4s2ef.js +2100 -0
- package/dist/index-zrmn6fd2.js +1903 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -1
- package/dist/lib/config.d.ts +13 -0
- package/dist/lib/config.d.ts.map +1 -0
- package/dist/lib/providers/ffmpeg.d.ts +10 -0
- package/dist/lib/providers/ffmpeg.d.ts.map +1 -0
- package/dist/lib/providers/index.d.ts +4 -0
- package/dist/lib/providers/index.d.ts.map +1 -1
- package/dist/lib/providers/manim.d.ts +3 -0
- package/dist/lib/providers/manim.d.ts.map +1 -0
- package/dist/lib/providers/obsidian-excalidraw.d.ts +3 -0
- package/dist/lib/providers/obsidian-excalidraw.d.ts.map +1 -0
- package/dist/lib/providers/obsidian.d.ts +3 -0
- package/dist/lib/providers/obsidian.d.ts.map +1 -0
- package/dist/lib/types.d.ts +1 -1
- package/dist/lib/types.d.ts.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -28,6 +28,41 @@ npm install -D agdex
|
|
|
28
28
|
npx agdex
|
|
29
29
|
```
|
|
30
30
|
|
|
31
|
+
## Configuration
|
|
32
|
+
|
|
33
|
+
You can configure agdex defaults using either `.agdexrc.json` or the `agdex` field in `package.json`.
|
|
34
|
+
|
|
35
|
+
### Using .agdexrc.json
|
|
36
|
+
|
|
37
|
+
Create a `.agdexrc.json` file in your project root:
|
|
38
|
+
|
|
39
|
+
```json
|
|
40
|
+
{
|
|
41
|
+
"output": "CLAUDE.md"
|
|
42
|
+
}
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
### Using package.json
|
|
46
|
+
|
|
47
|
+
Add an `agdex` field to your `package.json`:
|
|
48
|
+
|
|
49
|
+
```json
|
|
50
|
+
{
|
|
51
|
+
"name": "my-project",
|
|
52
|
+
"agdex": {
|
|
53
|
+
"output": "CLAUDE.md"
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
**Note:** `.agdexrc.json` takes priority over `package.json` if both are present.
|
|
59
|
+
|
|
60
|
+
### Configuration Options
|
|
61
|
+
|
|
62
|
+
| Option | Type | Default | Description |
|
|
63
|
+
|----------|--------|-------------|-------------|
|
|
64
|
+
| `output` | string | `CLAUDE.md` | Default output file for indexes |
|
|
65
|
+
|
|
31
66
|
## CLI Usage
|
|
32
67
|
|
|
33
68
|
### Interactive Mode
|
|
@@ -77,7 +112,7 @@ npx agdex --provider nextjs --description "Project uses App Router only"
|
|
|
77
112
|
```bash
|
|
78
113
|
-p, --provider <name> Documentation provider (nextjs, react, etc.)
|
|
79
114
|
--fw-version <version> Framework version (auto-detected if not provided)
|
|
80
|
-
-o, --output <file> Target file (default:
|
|
115
|
+
-o, --output <file> Target file (default: from config or CLAUDE.md)
|
|
81
116
|
-d, --description <text> Additional description to include in the index
|
|
82
117
|
-g, --global Store docs in global cache (~/.cache/agdex/)
|
|
83
118
|
```
|
|
@@ -236,6 +271,10 @@ This format:
|
|
|
236
271
|
| Convex | ✓ | get-convex/convex-backend |
|
|
237
272
|
| Polars | ✓ | pola-rs/polars |
|
|
238
273
|
| delta-rs | ✓ | delta-io/delta-rs |
|
|
274
|
+
| Obsidian | ✓ | obsidianmd/obsidian-developer-docs |
|
|
275
|
+
| Obsidian Excalidraw | ✓ | zsviczian/obsidian-excalidraw-plugin |
|
|
276
|
+
| FFmpeg | ✓ | FFmpeg/FFmpeg |
|
|
277
|
+
| Manim | ✓ | ManimCommunity/manim |
|
|
239
278
|
| Vue | ○ | Coming soon |
|
|
240
279
|
| Astro | ○ | Coming soon |
|
|
241
280
|
|
package/dist/cli/index.js
CHANGED
|
@@ -13,7 +13,9 @@ import {
|
|
|
13
13
|
deltaRsProvider,
|
|
14
14
|
embed,
|
|
15
15
|
embedSkills,
|
|
16
|
+
ffmpegProvider,
|
|
16
17
|
generateIndex,
|
|
18
|
+
getDefaultOutput,
|
|
17
19
|
getDefaultSkillSources,
|
|
18
20
|
getProvider,
|
|
19
21
|
hasExistingIndex,
|
|
@@ -21,7 +23,10 @@ import {
|
|
|
21
23
|
injectIndex,
|
|
22
24
|
isProviderAvailable,
|
|
23
25
|
listProviders,
|
|
26
|
+
manimProvider,
|
|
24
27
|
nextjsProvider,
|
|
28
|
+
obsidianExcalidrawProvider,
|
|
29
|
+
obsidianProvider,
|
|
25
30
|
pixiProvider,
|
|
26
31
|
polarsProvider,
|
|
27
32
|
rattlerBuildProvider,
|
|
@@ -32,7 +37,7 @@ import {
|
|
|
32
37
|
tailwindProvider,
|
|
33
38
|
tauriProvider,
|
|
34
39
|
tyProvider
|
|
35
|
-
} from "../index-
|
|
40
|
+
} from "../index-pkx4s2ef.js";
|
|
36
41
|
|
|
37
42
|
// node_modules/commander/lib/error.js
|
|
38
43
|
var require_error = __commonJS((exports) => {
|
|
@@ -6937,7 +6942,7 @@ async function runEmbed(options) {
|
|
|
6937
6942
|
await executeEmbed(cwd, provider, version, output, options.global, result.description);
|
|
6938
6943
|
return;
|
|
6939
6944
|
}
|
|
6940
|
-
output = options.output ||
|
|
6945
|
+
output = options.output || getDefaultOutput();
|
|
6941
6946
|
if (!version && !provider.detectVersion) {
|
|
6942
6947
|
console.error(import_picocolors.default.red(`Provider ${provider.displayName} requires --version flag since auto-detection is not supported.`));
|
|
6943
6948
|
process.exit(1);
|
|
@@ -6978,7 +6983,7 @@ Downloading ${import_picocolors.default.cyan(provider.displayName)} ${import_pic
|
|
|
6978
6983
|
console.log("");
|
|
6979
6984
|
}
|
|
6980
6985
|
function autoDetectProvider(cwd) {
|
|
6981
|
-
const providers = [nextjsProvider, pixiProvider, rattlerBuildProvider, tauriProvider, bunProvider, svelteProvider, tailwindProvider, ruffProvider, tyProvider, basedpyrightProvider, convexProvider, polarsProvider, deltaRsProvider];
|
|
6986
|
+
const providers = [nextjsProvider, pixiProvider, rattlerBuildProvider, tauriProvider, bunProvider, svelteProvider, tailwindProvider, ruffProvider, tyProvider, basedpyrightProvider, convexProvider, polarsProvider, deltaRsProvider, obsidianProvider, obsidianExcalidrawProvider, ffmpegProvider, manimProvider];
|
|
6982
6987
|
for (const provider of providers) {
|
|
6983
6988
|
if (provider.detectVersion) {
|
|
6984
6989
|
const result = provider.detectVersion(cwd);
|
|
@@ -7179,23 +7184,27 @@ agdex - Documentation Index for AI Coding Agents
|
|
|
7179
7184
|
};
|
|
7180
7185
|
}
|
|
7181
7186
|
async function promptForOutputFile() {
|
|
7187
|
+
const defaultOutput = getDefaultOutput();
|
|
7188
|
+
const choices = [
|
|
7189
|
+
{ title: "AGENTS.md", value: "AGENTS.md" },
|
|
7190
|
+
{ title: "CLAUDE.md", value: "CLAUDE.md" },
|
|
7191
|
+
{ title: "Custom...", value: "__custom__" }
|
|
7192
|
+
];
|
|
7193
|
+
const defaultIndex = choices.findIndex((c) => c.value === defaultOutput);
|
|
7194
|
+
const initial = defaultIndex >= 0 ? defaultIndex : 0;
|
|
7182
7195
|
const response = await import_prompts.default({
|
|
7183
7196
|
type: "select",
|
|
7184
7197
|
name: "output",
|
|
7185
7198
|
message: "Target file",
|
|
7186
|
-
choices
|
|
7187
|
-
|
|
7188
|
-
{ title: "CLAUDE.md", value: "CLAUDE.md" },
|
|
7189
|
-
{ title: "Custom...", value: "__custom__" }
|
|
7190
|
-
],
|
|
7191
|
-
initial: 0
|
|
7199
|
+
choices,
|
|
7200
|
+
initial
|
|
7192
7201
|
}, { onCancel });
|
|
7193
7202
|
if (response.output === "__custom__") {
|
|
7194
7203
|
const customOutput = await import_prompts.default({
|
|
7195
7204
|
type: "text",
|
|
7196
7205
|
name: "file",
|
|
7197
7206
|
message: "Custom file path",
|
|
7198
|
-
initial:
|
|
7207
|
+
initial: defaultOutput,
|
|
7199
7208
|
validate: (v) => v.trim() ? true : "Please enter a file path"
|
|
7200
7209
|
}, { onCancel });
|
|
7201
7210
|
return customOutput.file;
|
|
@@ -7360,7 +7369,7 @@ async function runLocal(docsPath, options) {
|
|
|
7360
7369
|
process.exit(1);
|
|
7361
7370
|
}
|
|
7362
7371
|
const name = options.name || path.basename(docsPath);
|
|
7363
|
-
const output = options.output ||
|
|
7372
|
+
const output = options.output || getDefaultOutput();
|
|
7364
7373
|
const extensions = options.extensions?.split(",") || [".md", ".mdx"];
|
|
7365
7374
|
console.log(`
|
|
7366
7375
|
Building index from ${import_picocolors.default.cyan(docsPath)}...`);
|
|
@@ -7432,12 +7441,12 @@ Sources you can index:
|
|
|
7432
7441
|
• Claude Code skills
|
|
7433
7442
|
|
|
7434
7443
|
Run 'agdex' without arguments for interactive mode.`).version("0.2.0");
|
|
7435
|
-
program2.command("embed", { isDefault: true }).description("Embed documentation index into AGENTS.md/CLAUDE.md").option("-p, --provider <name>", "Documentation provider (nextjs, react, etc.)").option("--fw-version <version>", "Framework version (auto-detected if not provided)").option("-o, --output <file>", "Target file (default:
|
|
7436
|
-
program2.command("local <docs-path>").description("Build index from local documentation directory").option("-n, --name <name>", "Display name for the documentation").option("-o, --output <file>", "Target file (default:
|
|
7444
|
+
program2.command("embed", { isDefault: true }).description("Embed documentation index into AGENTS.md/CLAUDE.md").option("-p, --provider <name>", "Documentation provider (nextjs, react, etc.)").option("--fw-version <version>", "Framework version (auto-detected if not provided)").option("-o, --output <file>", "Target file (default: from config or CLAUDE.md)").option("--repo <owner/repo>", "Custom GitHub repository").option("--docs-path <path>", "Path to docs folder in repository").option("-g, --global", "Store docs in global cache (~/.cache/agdex/) instead of local .agdex/").option("-d, --description <text>", "Additional description to include in the index").action(runEmbed);
|
|
7445
|
+
program2.command("local <docs-path>").description("Build index from local documentation directory").option("-n, --name <name>", "Display name for the documentation").option("-o, --output <file>", "Target file (default: from config or CLAUDE.md)").option("-e, --extensions <exts>", "File extensions to include (comma-separated, default: .md,.mdx)").action(runLocal);
|
|
7437
7446
|
program2.command("list").description("List available documentation providers").action(runList);
|
|
7438
7447
|
function runRemove(options) {
|
|
7439
7448
|
const cwd = process.cwd();
|
|
7440
|
-
const output = options.output ||
|
|
7449
|
+
const output = options.output || getDefaultOutput();
|
|
7441
7450
|
const targetPath = path.join(cwd, output);
|
|
7442
7451
|
if (!fs.existsSync(targetPath)) {
|
|
7443
7452
|
console.error(import_picocolors.default.red(`File not found: ${output}`));
|
|
@@ -7477,11 +7486,11 @@ No indices found to remove.
|
|
|
7477
7486
|
console.log(import_picocolors.default.gray(` (${formatSize(sizeBefore)} → ${formatSize(sizeAfter)})`));
|
|
7478
7487
|
console.log("");
|
|
7479
7488
|
}
|
|
7480
|
-
program2.command("remove").description("Remove embedded indices from AGENTS.md/CLAUDE.md").option("-o, --output <file>", "Target file (default:
|
|
7489
|
+
program2.command("remove").description("Remove embedded indices from AGENTS.md/CLAUDE.md").option("-o, --output <file>", "Target file (default: from config or CLAUDE.md)").option("--docs", "Remove only docs index").option("--skills", "Remove only skills index").option("-p, --provider <name>", "Remove only a specific provider's docs index").action(runRemove);
|
|
7481
7490
|
var skillsCommand = program2.command("skills").description("Manage Claude Code skills indexing");
|
|
7482
7491
|
async function runSkillsEmbed(options) {
|
|
7483
7492
|
const cwd = process.cwd();
|
|
7484
|
-
const output = options.output ||
|
|
7493
|
+
const output = options.output || getDefaultOutput();
|
|
7485
7494
|
const sources = getDefaultSkillSources(cwd, {
|
|
7486
7495
|
includeUser: options.user !== false,
|
|
7487
7496
|
includeProject: options.project !== false,
|
|
@@ -7561,7 +7570,7 @@ async function runSkillsLocal(skillsPath, options) {
|
|
|
7561
7570
|
console.error(import_picocolors.default.red(`Skills directory not found: ${skillsPath}`));
|
|
7562
7571
|
process.exit(1);
|
|
7563
7572
|
}
|
|
7564
|
-
const output = options.output ||
|
|
7573
|
+
const output = options.output || getDefaultOutput();
|
|
7565
7574
|
const label = options.name || path.basename(skillsPath);
|
|
7566
7575
|
const hasPluginsDir = fs.existsSync(path.join(absolutePath, "plugins"));
|
|
7567
7576
|
const sources = [{
|
|
@@ -7582,7 +7591,7 @@ Discovering skills from ${import_picocolors.default.cyan(skillsPath)}...`);
|
|
|
7582
7591
|
console.log(`${import_picocolors.default.green("✓")} Indexed ${import_picocolors.default.bold(result.skillCount.toString())} skills`);
|
|
7583
7592
|
console.log("");
|
|
7584
7593
|
}
|
|
7585
|
-
skillsCommand.command("embed").description("Embed skills index into AGENTS.md").option("-o, --output <file>", "Target file (default:
|
|
7594
|
+
skillsCommand.command("embed").description("Embed skills index into AGENTS.md").option("-o, --output <file>", "Target file (default: from config or CLAUDE.md)").option("--plugin <path...>", "Additional plugin repo paths (with plugins/ structure)").option("--plugins", "Include enabled plugins from settings.json (default: true)").option("--no-plugins", "Exclude enabled plugins from settings.json").option("--user", "Include ~/.claude/skills (default: true)").option("--no-user", "Exclude ~/.claude/skills").option("--project", "Include .claude/skills (default: true)").option("--no-project", "Exclude .claude/skills").action(runSkillsEmbed);
|
|
7586
7595
|
skillsCommand.command("list").description("List discovered skills").option("--plugin <path...>", "Additional plugin repo paths (with plugins/ structure)").option("--plugins", "Include enabled plugins from settings.json (default: true)").option("--no-plugins", "Exclude enabled plugins from settings.json").option("--user", "Include ~/.claude/skills (default: true)").option("--no-user", "Exclude ~/.claude/skills").option("--project", "Include .claude/skills (default: true)").option("--no-project", "Exclude .claude/skills").action(runSkillsList);
|
|
7587
|
-
skillsCommand.command("local <skills-path>").description("Index skills from a local path").option("-o, --output <file>", "Target file (default:
|
|
7596
|
+
skillsCommand.command("local <skills-path>").description("Index skills from a local path").option("-o, --output <file>", "Target file (default: from config or CLAUDE.md)").option("-n, --name <name>", "Label for this skill source").action(runSkillsLocal);
|
|
7588
7597
|
program2.parse();
|