@dittowords/spec-cli 0.0.1-alpha.1 → 0.0.1-alpha.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dittowords/spec-cli",
3
- "version": "0.0.1-alpha.1",
3
+ "version": "0.0.1-alpha.2",
4
4
  "description": "CLI for syncing .ditto.md content specs with the Ditto platform.",
5
5
  "main": "src/cli.ts",
6
6
  "bin": {
@@ -109,16 +109,21 @@ type AgentEnv = "claude" | "cursor" | "none";
109
109
  export async function init(opts: InitOptions = {}): Promise<void> {
110
110
  const cwd = process.cwd();
111
111
 
112
- if (fs.existsSync(path.join(cwd, CONFIG_NAME))) {
112
+ const configExists = fs.existsSync(path.join(cwd, CONFIG_NAME));
113
+
114
+ if (configExists && !opts.writeAgent) {
113
115
  console.log(`${CONFIG_NAME} already exists. Nothing to do.`);
116
+ console.log("Run with --agent to add agent configuration (CLAUDE.md, .cursorrules, etc.).");
114
117
  return;
115
118
  }
116
119
 
117
- fs.writeFileSync(path.join(cwd, CONFIG_NAME), DEFAULT_CONFIG + "\n");
118
- console.log(`✓ Created ${CONFIG_NAME}`);
120
+ if (!configExists) {
121
+ fs.writeFileSync(path.join(cwd, CONFIG_NAME), DEFAULT_CONFIG + "\n");
122
+ console.log(`✓ Created ${CONFIG_NAME}`);
119
123
 
120
- fs.writeFileSync(path.join(cwd, WORKSPACE_SPEC_NAME), WORKSPACE_SPEC);
121
- console.log(`✓ Created ${WORKSPACE_SPEC_NAME}`);
124
+ fs.writeFileSync(path.join(cwd, WORKSPACE_SPEC_NAME), WORKSPACE_SPEC);
125
+ console.log(`✓ Created ${WORKSPACE_SPEC_NAME}`);
126
+ }
122
127
 
123
128
  const env = detectAgentEnv(cwd);
124
129
 
@@ -128,7 +133,9 @@ export async function init(opts: InitOptions = {}): Promise<void> {
128
133
  printAgentSuggestions(env);
129
134
  }
130
135
 
131
- printNextSteps();
136
+ if (!configExists) {
137
+ printNextSteps();
138
+ }
132
139
  }
133
140
 
134
141
  function detectAgentEnv(cwd: string): AgentEnv {