An open source design system that's fully customizable and agent ready
TypeScript
fix(cli): describe swizzle --overwrite as a refusal, not a prompt (#6579)
Joeyef5c0aec4115
diff --git a/.changeset/cli-spec-swizzle-overwrite-doc.md b/.changeset/cli-spec-swizzle-overwrite-doc.mdnew file mode 100644index 0000000000..11e5c16765--- /dev/null+++ b/.changeset/cli-spec-swizzle-overwrite-doc.md@@ -0,0 +1,7 @@+---+'@astryxdesign/cli': patch+---++[fix] The `astryx swizzle --overwrite` help and manifest entry no longer says it skips a prompt. The CLI never prompts. The entry now says that without `--overwrite`, existing files fail the command with `ERR_FILE_EXISTS` and nothing is written.++@josephfarinadiff --git a/packages/cli/clients/cli/commands/swizzle.doc.mjs b/packages/cli/clients/cli/commands/swizzle.doc.mjsindex 8282f1d339..0a5c8a606f 100644--- a/packages/cli/clients/cli/commands/swizzle.doc.mjs+++ b/packages/cli/clients/cli/commands/swizzle.doc.mjs@@ -40,7 +40,8 @@ export const doc = {{flag: '-f, --overwrite',param: 'options.overwrite',- description: 'Overwrite existing files without prompting',+ description:+ 'Replace existing files. Without it, existing files fail the command with ERR_FILE_EXISTS and nothing is written',},],examples: [diff --git a/packages/cli/clients/cli/commands/swizzle.path-safety.test.mjs b/packages/cli/clients/cli/commands/swizzle.path-safety.test.mjsindex 41c66410a8..f3de4f5667 100644--- a/packages/cli/clients/cli/commands/swizzle.path-safety.test.mjs+++ b/packages/cli/clients/cli/commands/swizzle.path-safety.test.mjs@@ -92,4 +92,15 @@ describe('swizzle path safety', () => {// Existing file unchangedexpect(fs.readFileSync(existingPath, 'utf-8')).toBe('// my customizations\n');});++ // The CLI never prompts: without --overwrite it refuses with a code, and the+ // manifest agents read must say so.+ it('describes --overwrite by its refusal, not a prompt', async () => {+ const {project} = buildFakeRepo(tmpDir);+ const result = await runCli(['--json', 'manifest'], project);+ const swizzle = JSON.parse(result.stdout).data.commands.find(c => c.name === 'swizzle');+ const overwrite = swizzle.options.find(o => o.flag.includes('--overwrite'));+ expect(overwrite.description).not.toMatch(/prompt/i);+ expect(overwrite.description).toContain('ERR_FILE_EXISTS');+ });});