@astryxdesign/cli 0.1.4-canary.ce93640 → 0.1.4-canary.cfe8ece
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@astryxdesign/cli",
|
|
3
|
-
"version": "0.1.4-canary.
|
|
3
|
+
"version": "0.1.4-canary.cfe8ece",
|
|
4
4
|
"displayName": "CLI",
|
|
5
5
|
"description": "Scaffold projects, browse templates, generate themes, and get agent-ready docs from the command line.",
|
|
6
6
|
"author": "Meta Open Source",
|
|
@@ -75,10 +75,10 @@
|
|
|
75
75
|
"zod": "^4.4.3"
|
|
76
76
|
},
|
|
77
77
|
"peerDependencies": {
|
|
78
|
-
"@astryxdesign/charts": "0.1.4-canary.
|
|
79
|
-
"@astryxdesign/core": "0.1.4-canary.
|
|
80
|
-
"@astryxdesign/lab": "0.1.4-canary.
|
|
81
|
-
"@astryxdesign/theme-neutral": "0.1.4-canary.
|
|
78
|
+
"@astryxdesign/charts": "0.1.4-canary.cfe8ece",
|
|
79
|
+
"@astryxdesign/core": "0.1.4-canary.cfe8ece",
|
|
80
|
+
"@astryxdesign/lab": "0.1.4-canary.cfe8ece",
|
|
81
|
+
"@astryxdesign/theme-neutral": "0.1.4-canary.cfe8ece",
|
|
82
82
|
"gpt-tokenizer": "^3.4.0"
|
|
83
83
|
},
|
|
84
84
|
"peerDependenciesMeta": {
|
|
@@ -96,10 +96,10 @@
|
|
|
96
96
|
}
|
|
97
97
|
},
|
|
98
98
|
"devDependencies": {
|
|
99
|
-
"@astryxdesign/charts": "0.1.4-canary.
|
|
100
|
-
"@astryxdesign/core": "0.1.4-canary.
|
|
101
|
-
"@astryxdesign/lab": "0.1.4-canary.
|
|
102
|
-
"@astryxdesign/theme-neutral": "0.1.4-canary.
|
|
99
|
+
"@astryxdesign/charts": "0.1.4-canary.cfe8ece",
|
|
100
|
+
"@astryxdesign/core": "0.1.4-canary.cfe8ece",
|
|
101
|
+
"@astryxdesign/lab": "0.1.4-canary.cfe8ece",
|
|
102
|
+
"@astryxdesign/theme-neutral": "0.1.4-canary.cfe8ece",
|
|
103
103
|
"gpt-tokenizer": "^3.4.0"
|
|
104
104
|
},
|
|
105
105
|
"scripts": {
|
|
@@ -9,12 +9,11 @@
|
|
|
9
9
|
* - Claude Code: CLAUDE.md (root) or .claude/CLAUDE.md
|
|
10
10
|
* - Cursor: .cursorrules
|
|
11
11
|
* - Codex/generic: AGENTS.md
|
|
12
|
-
* - Hermes Agent: .hermes.md or HERMES.md (existing), else AGENTS.md
|
|
13
12
|
*
|
|
14
13
|
* Auto-detect: discovers existing files and updates them in place.
|
|
15
14
|
* Default (no existing files): creates .claude/CLAUDE.md.
|
|
16
15
|
*
|
|
17
|
-
* --agent <tool>: target a specific tool preset (claude, cursor, codex,
|
|
16
|
+
* --agent <tool>: target a specific tool preset (claude, cursor, codex, all)
|
|
18
17
|
* --agent-docs-path <path>: explicit file path(s)
|
|
19
18
|
*/
|
|
20
19
|
|
|
@@ -47,7 +46,6 @@ const AGENT_PRESETS = {
|
|
|
47
46
|
claude: [CLAUDE_MD, CLAUDE_DIR_MD],
|
|
48
47
|
cursor: ['.cursorrules', AGENTS_MD],
|
|
49
48
|
codex: [AGENTS_MD],
|
|
50
|
-
hermes: ['.hermes.md', 'HERMES.md', AGENTS_MD],
|
|
51
49
|
};
|
|
52
50
|
|
|
53
51
|
/**
|
|
@@ -66,7 +64,7 @@ export function discoverAgentDocs(targetDir) {
|
|
|
66
64
|
* Searches for existing files first, falls back to default creation path.
|
|
67
65
|
*
|
|
68
66
|
* @param {string} targetDir
|
|
69
|
-
* @param {string} agent - Preset name: 'claude', 'cursor', 'codex', '
|
|
67
|
+
* @param {string} agent - Preset name: 'claude', 'cursor', 'codex', 'all'
|
|
70
68
|
* @returns {{inject: string[], create: string[]}} Files to inject into vs create fresh
|
|
71
69
|
*/
|
|
72
70
|
export function resolveAgentPaths(targetDir, agent) {
|
|
@@ -388,7 +386,7 @@ export function removeAgentDocs(targetDir) {
|
|
|
388
386
|
* @param {object} [options]
|
|
389
387
|
* @param {boolean} [options.zh]
|
|
390
388
|
* @param {string} [options.lang]
|
|
391
|
-
* @param {string} [options.agent] - Tool preset: 'claude', 'cursor', 'codex', '
|
|
389
|
+
* @param {string} [options.agent] - Tool preset: 'claude', 'cursor', 'codex', 'all'
|
|
392
390
|
* @param {string[]} [options.paths] - Explicit paths (overrides agent/auto-detect)
|
|
393
391
|
* @param {boolean} [options.onlyReplace] - Only update files that already have Astryx markers (for upgrades)
|
|
394
392
|
* @returns {string[]} List of files written
|
|
@@ -470,14 +468,14 @@ export function installAgentDocs(targetDir, {zh = false, lang, agent, paths, onl
|
|
|
470
468
|
return written;
|
|
471
469
|
}
|
|
472
470
|
|
|
473
|
-
const VALID_AGENTS = ['claude', 'cursor', 'codex', '
|
|
471
|
+
const VALID_AGENTS = ['claude', 'cursor', 'codex', 'all'];
|
|
474
472
|
|
|
475
473
|
export function registerAgentDocs(program) {
|
|
476
474
|
program
|
|
477
475
|
.command('agent-docs')
|
|
478
476
|
.description('Install/update the component index for AI coding agents')
|
|
479
477
|
.option('--remove', 'Remove the design system section from all agent doc files')
|
|
480
|
-
.option('--agent <tool>', 'Target tool: claude, cursor, codex,
|
|
478
|
+
.option('--agent <tool>', 'Target tool: claude, cursor, codex, all')
|
|
481
479
|
.option('--agent-docs-path <path...>', 'Explicit file path(s) to write to')
|
|
482
480
|
.action(options => {
|
|
483
481
|
const targetDir = process.cwd();
|
|
@@ -449,17 +449,6 @@ describe('installAgentDocs', () => {
|
|
|
449
449
|
expect(fs.existsSync(path.join(tmpDir, 'AGENTS.md'))).toBe(true);
|
|
450
450
|
});
|
|
451
451
|
|
|
452
|
-
it('respects --agent hermes preset: creates AGENTS.md', () => {
|
|
453
|
-
setupCorePackage(tmpDir);
|
|
454
|
-
|
|
455
|
-
const written = installAgentDocs(tmpDir, {agent: 'hermes'});
|
|
456
|
-
|
|
457
|
-
expect(written).toEqual(['AGENTS.md']);
|
|
458
|
-
const content = fs.readFileSync(path.join(tmpDir, 'AGENTS.md'), 'utf-8');
|
|
459
|
-
expect(content).toContain('<!-- ASTRYX:START -->');
|
|
460
|
-
expect(fs.existsSync(path.join(tmpDir, '.claude'))).toBe(false);
|
|
461
|
-
});
|
|
462
|
-
|
|
463
452
|
it('respects explicit --paths', () => {
|
|
464
453
|
setupCorePackage(tmpDir);
|
|
465
454
|
|
|
@@ -559,26 +548,4 @@ describe('resolveAgentPaths', () => {
|
|
|
559
548
|
expect(result.create).toContain('AGENTS.md');
|
|
560
549
|
expect(result.create).toContain('.claude/CLAUDE.md');
|
|
561
550
|
});
|
|
562
|
-
|
|
563
|
-
it('hermes preset creates AGENTS.md when nothing exists', () => {
|
|
564
|
-
const result = resolveAgentPaths(tmpDir, 'hermes');
|
|
565
|
-
expect(result).toEqual({inject: [], create: ['AGENTS.md']});
|
|
566
|
-
});
|
|
567
|
-
|
|
568
|
-
it('hermes preset finds existing .hermes.md', () => {
|
|
569
|
-
fs.writeFileSync(path.join(tmpDir, '.hermes.md'), '');
|
|
570
|
-
const result = resolveAgentPaths(tmpDir, 'hermes');
|
|
571
|
-
expect(result).toEqual({inject: ['.hermes.md'], create: []});
|
|
572
|
-
});
|
|
573
|
-
|
|
574
|
-
it('hermes preset finds existing HERMES.md when no .hermes.md', () => {
|
|
575
|
-
fs.writeFileSync(path.join(tmpDir, 'HERMES.md'), '');
|
|
576
|
-
const result = resolveAgentPaths(tmpDir, 'hermes');
|
|
577
|
-
expect(result).toEqual({inject: ['HERMES.md'], create: []});
|
|
578
|
-
});
|
|
579
|
-
|
|
580
|
-
it('claude preset still creates .claude/CLAUDE.md when nothing exists (hermes is additive)', () => {
|
|
581
|
-
const result = resolveAgentPaths(tmpDir, 'claude');
|
|
582
|
-
expect(result).toEqual({inject: [], create: ['.claude/CLAUDE.md']});
|
|
583
|
-
});
|
|
584
551
|
});
|
package/src/commands/init.mjs
CHANGED
|
@@ -198,7 +198,7 @@ export function registerInit(program) {
|
|
|
198
198
|
.option('--features <list>', 'Comma-separated features to install (agents, theme, template)')
|
|
199
199
|
.option('--all', 'Install all features, no prompts')
|
|
200
200
|
.option('--remove-agents', 'Remove AI agent docs from all agent doc files')
|
|
201
|
-
.option('--agent <tool>', 'Target AI tool for agent docs: claude, cursor, codex,
|
|
201
|
+
.option('--agent <tool>', 'Target AI tool for agent docs: claude, cursor, codex, all')
|
|
202
202
|
.option('--agent-docs-path <path...>', 'Explicit file path(s) for agent docs')
|
|
203
203
|
.action(async (options) => {
|
|
204
204
|
const targetDir = process.cwd();
|