create-semaphor-app 0.1.1 → 0.1.3

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 CHANGED
@@ -3,7 +3,7 @@
3
3
  Create a Semaphor Data App starter project.
4
4
 
5
5
  ```bash
6
- npx create-semaphor-app@latest customer-health
6
+ npx create-semaphor-app@latest
7
7
  ```
8
8
 
9
9
  The CLI scaffolds the public Semaphor Data App Starter, installs local
@@ -17,9 +17,11 @@ minting, planning, code generation, validation, save, and publish.
17
17
  ## Usage
18
18
 
19
19
  ```bash
20
- npx create-semaphor-app@latest <app-name>
20
+ npx create-semaphor-app@latest [app-name]
21
21
  ```
22
22
 
23
+ When `app-name` is omitted, the CLI creates `./semaphor-data-app`.
24
+
23
25
  Options:
24
26
 
25
27
  ```text
@@ -48,16 +50,10 @@ projects before exiting.
48
50
  After creation:
49
51
 
50
52
  ```bash
51
- cd customer-health
53
+ cd semaphor-data-app
52
54
  npm run dev
53
55
  ```
54
56
 
55
- Then open Codex or Claude Code in the project and ask:
56
-
57
- ```text
58
- @semaphor Build a Data App from my Semaphor project.
59
- ```
60
-
61
57
  For Codex OAuth, run:
62
58
 
63
59
  ```bash
@@ -72,3 +68,9 @@ claude
72
68
  ```
73
69
 
74
70
  Then complete auth for the `semaphor` server.
71
+
72
+ After Semaphor auth, ask your agent:
73
+
74
+ ```text
75
+ @semaphor Build a Data App from my Semaphor project.
76
+ ```
@@ -10,6 +10,7 @@ import { fileURLToPath } from 'node:url';
10
10
  const DEFAULT_TEMPLATE_REPO =
11
11
  'https://github.com/semaphor-analytics/semaphor-data-app-starter.git';
12
12
  const DEFAULT_TEMPLATE_REF = 'main';
13
+ const DEFAULT_APP_NAME = 'semaphor-data-app';
13
14
  const MARKETPLACE = 'semaphor-analytics/agent-plugin';
14
15
  const PLUGIN_ID = 'semaphor@semaphor-analytics';
15
16
  const canPrompt = Boolean(process.stdin.isTTY && process.stdout.isTTY);
@@ -20,7 +21,7 @@ function usage() {
20
21
  return `Create a Semaphor Data App starter project.
21
22
 
22
23
  Usage:
23
- npx create-semaphor-app@latest <app-name> [options]
24
+ npx create-semaphor-app@latest [app-name] [options]
24
25
 
25
26
  Options:
26
27
  --no-install Skip dependency installation.
@@ -243,10 +244,7 @@ function promptQuestion(rl, question, defaultYes) {
243
244
 
244
245
  async function resolveTarget(args, rl) {
245
246
  if (!args.appName) {
246
- if (!canPrompt) {
247
- throw new Error('App name is required.');
248
- }
249
- args.appName = await rl.question('App name: ');
247
+ args.appName = DEFAULT_APP_NAME;
250
248
  }
251
249
 
252
250
  const trimmed = String(args.appName || '').trim();
@@ -419,11 +417,9 @@ function printNextSteps({ targetDir, packageManager, pluginSummary }) {
419
417
  console.log(` cd ${relativeTarget}`);
420
418
  console.log(` ${packageManager} run dev`);
421
419
 
422
- console.log('\nThen open Codex or Claude Code in this folder and ask:');
423
- console.log(' @semaphor Build a Data App from my Semaphor project.');
424
-
425
420
  if (pluginSummary?.skipped) {
426
421
  printPluginInstructions();
422
+ printBuildPrompt();
427
423
  return;
428
424
  }
429
425
 
@@ -434,6 +430,7 @@ function printNextSteps({ targetDir, packageManager, pluginSummary }) {
434
430
  console.log(` - ${failure.agent}: ${failure.error}`);
435
431
  }
436
432
  printPluginInstructions();
433
+ printBuildPrompt();
437
434
  return;
438
435
  }
439
436
 
@@ -450,10 +447,12 @@ function printNextSteps({ targetDir, packageManager, pluginSummary }) {
450
447
  console.log(' claude');
451
448
  console.log(' /mcp');
452
449
  console.log(' Then complete auth for the semaphor server.');
450
+ printBuildPrompt();
453
451
  return;
454
452
  }
455
453
 
456
454
  printPluginInstructions();
455
+ printBuildPrompt();
457
456
  }
458
457
 
459
458
  function printPluginInstructions() {
@@ -468,6 +467,11 @@ function printPluginInstructions() {
468
467
  console.log(' Use the Claude Code MCP auth flow for the semaphor server.');
469
468
  }
470
469
 
470
+ function printBuildPrompt() {
471
+ console.log('\nAfter Semaphor auth, ask your agent:');
472
+ console.log(' @semaphor Build a Data App from my Semaphor project.');
473
+ }
474
+
471
475
  async function main() {
472
476
  let args;
473
477
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-semaphor-app",
3
- "version": "0.1.1",
3
+ "version": "0.1.3",
4
4
  "description": "Create a Semaphor Data App starter project.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -107,6 +107,20 @@ async function main() {
107
107
  console.log('✓ local starter scaffold');
108
108
  }
109
109
 
110
+ {
111
+ const root = createTempRoot('default-name-');
112
+ const result = runCli([
113
+ '--template',
114
+ defaultLocalStarterPath,
115
+ '--no-install',
116
+ '--skip-plugin',
117
+ '--yes',
118
+ ], { cwd: root });
119
+ assertSuccess(result, 'default app name scaffold');
120
+ assertScaffold(root, 'semaphor-data-app');
121
+ console.log('✓ default app name scaffold');
122
+ }
123
+
110
124
  {
111
125
  const root = createTempRoot('github-');
112
126
  const result = runCli([
@@ -163,4 +177,3 @@ async function main() {
163
177
  }
164
178
 
165
179
  await main();
166
-