@spekn/cli 1.0.0 → 1.0.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.
Files changed (154) hide show
  1. package/README.md +58 -0
  2. package/dist/main.js +40540 -32176
  3. package/dist/prompts/governance-analysis.prompt.md +109 -0
  4. package/dist/resources/prompts/repo-analysis.prompt.md +28 -136
  5. package/dist/resources/prompts/repo-sync-analysis.prompt.md +31 -68
  6. package/dist/tui/chunk-4WEASLXY.mjs +3444 -0
  7. package/dist/tui/chunk-755CADEG.mjs +3401 -0
  8. package/dist/tui/chunk-BUJQVTY5.mjs +3409 -0
  9. package/dist/tui/chunk-BZKKMGFB.mjs +1959 -0
  10. package/dist/tui/chunk-DJYOBCNM.mjs +3159 -0
  11. package/dist/tui/chunk-GTFTFDY4.mjs +3417 -0
  12. package/dist/tui/chunk-IMEBD2KA.mjs +3444 -0
  13. package/dist/tui/chunk-IX6DR5SW.mjs +3433 -0
  14. package/dist/tui/chunk-JKFOY4IF.mjs +2003 -0
  15. package/dist/tui/chunk-OXXZ3O5L.mjs +3378 -0
  16. package/dist/tui/chunk-SHJNIAAJ.mjs +1697 -0
  17. package/dist/tui/chunk-V4SNDRUS.mjs +1666 -0
  18. package/dist/tui/chunk-VXVHNZST.mjs +1666 -0
  19. package/dist/tui/chunk-WCTSFKTA.mjs +3459 -0
  20. package/dist/tui/chunk-X2XP5ACW.mjs +3443 -0
  21. package/dist/tui/chunk-YUYJ7VBG.mjs +2029 -0
  22. package/dist/tui/chunk-ZM3EI5IA.mjs +3384 -0
  23. package/dist/tui/chunk-ZYOX64HP.mjs +1653 -0
  24. package/dist/tui/index.mjs +6999 -6938
  25. package/dist/tui/prompts/spec-creation-system.prompt.md +47 -0
  26. package/dist/tui/prompts/spec-refinement-system.prompt.md +72 -0
  27. package/dist/tui/use-session-store-63YUGUFA.mjs +8 -0
  28. package/dist/tui/use-session-store-ACO2SMJC.mjs +8 -0
  29. package/dist/tui/use-session-store-BVFDAWOB.mjs +8 -0
  30. package/dist/tui/use-session-store-DJIZ3FQZ.mjs +9 -0
  31. package/dist/tui/use-session-store-EAIQA4UG.mjs +9 -0
  32. package/dist/tui/use-session-store-EFBAXC3G.mjs +8 -0
  33. package/dist/tui/use-session-store-FJOR4KTG.mjs +8 -0
  34. package/dist/tui/use-session-store-IJE5KVOC.mjs +8 -0
  35. package/dist/tui/use-session-store-KGAFXCKI.mjs +8 -0
  36. package/dist/tui/use-session-store-KS4DPNDY.mjs +8 -0
  37. package/dist/tui/use-session-store-MMHJENNL.mjs +8 -0
  38. package/dist/tui/use-session-store-OZ6HC4I2.mjs +9 -0
  39. package/dist/tui/use-session-store-PTMWISNJ.mjs +8 -0
  40. package/dist/tui/use-session-store-VCDECQMW.mjs +8 -0
  41. package/dist/tui/use-session-store-VOK5ML5J.mjs +9 -0
  42. package/package.json +33 -13
  43. package/dist/__tests__/export-cli.test.d.ts +0 -1
  44. package/dist/__tests__/export-cli.test.js +0 -70
  45. package/dist/__tests__/tui-args-policy.test.d.ts +0 -1
  46. package/dist/__tests__/tui-args-policy.test.js +0 -50
  47. package/dist/acp-S2MHZOAD.mjs +0 -23
  48. package/dist/acp-UCCI44JY.mjs +0 -25
  49. package/dist/auth/credentials-store.d.ts +0 -2
  50. package/dist/auth/credentials-store.js +0 -5
  51. package/dist/auth/device-flow.d.ts +0 -36
  52. package/dist/auth/device-flow.js +0 -189
  53. package/dist/auth/jwt.d.ts +0 -1
  54. package/dist/auth/jwt.js +0 -6
  55. package/dist/auth/session.d.ts +0 -67
  56. package/dist/auth/session.js +0 -86
  57. package/dist/auth-login.d.ts +0 -34
  58. package/dist/auth-login.js +0 -202
  59. package/dist/auth-logout.d.ts +0 -25
  60. package/dist/auth-logout.js +0 -115
  61. package/dist/auth-status.d.ts +0 -24
  62. package/dist/auth-status.js +0 -109
  63. package/dist/backlog-generate.d.ts +0 -11
  64. package/dist/backlog-generate.js +0 -308
  65. package/dist/backlog-health.d.ts +0 -11
  66. package/dist/backlog-health.js +0 -287
  67. package/dist/bridge-login.d.ts +0 -40
  68. package/dist/bridge-login.js +0 -277
  69. package/dist/chunk-3PAYRI4G.mjs +0 -2428
  70. package/dist/chunk-M4CS3A25.mjs +0 -2426
  71. package/dist/commands/auth/login.d.ts +0 -30
  72. package/dist/commands/auth/login.js +0 -164
  73. package/dist/commands/auth/logout.d.ts +0 -25
  74. package/dist/commands/auth/logout.js +0 -115
  75. package/dist/commands/auth/status.d.ts +0 -24
  76. package/dist/commands/auth/status.js +0 -109
  77. package/dist/commands/backlog/generate.d.ts +0 -11
  78. package/dist/commands/backlog/generate.js +0 -308
  79. package/dist/commands/backlog/health.d.ts +0 -11
  80. package/dist/commands/backlog/health.js +0 -287
  81. package/dist/commands/bridge/login.d.ts +0 -36
  82. package/dist/commands/bridge/login.js +0 -258
  83. package/dist/commands/export.d.ts +0 -35
  84. package/dist/commands/export.js +0 -485
  85. package/dist/commands/marketplace-export.d.ts +0 -21
  86. package/dist/commands/marketplace-export.js +0 -214
  87. package/dist/commands/project-clean.d.ts +0 -1
  88. package/dist/commands/project-clean.js +0 -126
  89. package/dist/commands/repo/common.d.ts +0 -105
  90. package/dist/commands/repo/common.js +0 -775
  91. package/dist/commands/repo/detach.d.ts +0 -2
  92. package/dist/commands/repo/detach.js +0 -120
  93. package/dist/commands/repo/register.d.ts +0 -21
  94. package/dist/commands/repo/register.js +0 -175
  95. package/dist/commands/repo/sync.d.ts +0 -22
  96. package/dist/commands/repo/sync.js +0 -873
  97. package/dist/commands/skills-import-local.d.ts +0 -16
  98. package/dist/commands/skills-import-local.js +0 -352
  99. package/dist/commands/spec/drift-check.d.ts +0 -3
  100. package/dist/commands/spec/drift-check.js +0 -186
  101. package/dist/commands/spec/frontmatter.d.ts +0 -11
  102. package/dist/commands/spec/frontmatter.js +0 -219
  103. package/dist/commands/spec/lint.d.ts +0 -11
  104. package/dist/commands/spec/lint.js +0 -499
  105. package/dist/commands/spec/parse.d.ts +0 -11
  106. package/dist/commands/spec/parse.js +0 -162
  107. package/dist/export.d.ts +0 -35
  108. package/dist/export.js +0 -485
  109. package/dist/main.d.ts +0 -1
  110. package/dist/marketplace-export.d.ts +0 -21
  111. package/dist/marketplace-export.js +0 -214
  112. package/dist/project-clean.d.ts +0 -1
  113. package/dist/project-clean.js +0 -126
  114. package/dist/project-context.d.ts +0 -99
  115. package/dist/project-context.js +0 -376
  116. package/dist/repo-common.d.ts +0 -101
  117. package/dist/repo-common.js +0 -671
  118. package/dist/repo-detach.d.ts +0 -2
  119. package/dist/repo-detach.js +0 -102
  120. package/dist/repo-ingest.d.ts +0 -29
  121. package/dist/repo-ingest.js +0 -305
  122. package/dist/repo-register.d.ts +0 -21
  123. package/dist/repo-register.js +0 -175
  124. package/dist/repo-sync.d.ts +0 -16
  125. package/dist/repo-sync.js +0 -152
  126. package/dist/resources/prompt-loader.d.ts +0 -1
  127. package/dist/resources/prompt-loader.js +0 -62
  128. package/dist/skills-import-local.d.ts +0 -16
  129. package/dist/skills-import-local.js +0 -352
  130. package/dist/spec-drift-check.d.ts +0 -3
  131. package/dist/spec-drift-check.js +0 -186
  132. package/dist/spec-frontmatter.d.ts +0 -11
  133. package/dist/spec-frontmatter.js +0 -219
  134. package/dist/spec-lint.d.ts +0 -11
  135. package/dist/spec-lint.js +0 -499
  136. package/dist/spec-parse.d.ts +0 -11
  137. package/dist/spec-parse.js +0 -162
  138. package/dist/stubs/dotenv.d.ts +0 -5
  139. package/dist/stubs/dotenv.js +0 -6
  140. package/dist/stubs/typeorm.d.ts +0 -22
  141. package/dist/stubs/typeorm.js +0 -28
  142. package/dist/tui-bundle.d.ts +0 -1
  143. package/dist/tui-bundle.js +0 -5
  144. package/dist/tui-entry.mjs +0 -1407
  145. package/dist/utils/cli-runtime.d.ts +0 -5
  146. package/dist/utils/cli-runtime.js +0 -22
  147. package/dist/utils/help-error.d.ts +0 -7
  148. package/dist/utils/help-error.js +0 -14
  149. package/dist/utils/interaction.d.ts +0 -19
  150. package/dist/utils/interaction.js +0 -93
  151. package/dist/utils/structured-log.d.ts +0 -7
  152. package/dist/utils/structured-log.js +0 -112
  153. package/dist/utils/trpc-url.d.ts +0 -4
  154. package/dist/utils/trpc-url.js +0 -15
@@ -1,2 +0,0 @@
1
- #!/usr/bin/env node
2
- export declare function runRepoDetachCli(args: string[]): Promise<number>;
@@ -1,120 +0,0 @@
1
- #!/usr/bin/env node
2
- "use strict";
3
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
4
- if (k2 === undefined) k2 = k;
5
- var desc = Object.getOwnPropertyDescriptor(m, k);
6
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
7
- desc = { enumerable: true, get: function() { return m[k]; } };
8
- }
9
- Object.defineProperty(o, k2, desc);
10
- }) : (function(o, m, k, k2) {
11
- if (k2 === undefined) k2 = k;
12
- o[k2] = m[k];
13
- }));
14
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
15
- Object.defineProperty(o, "default", { enumerable: true, value: v });
16
- }) : function(o, v) {
17
- o["default"] = v;
18
- });
19
- var __importStar = (this && this.__importStar) || (function () {
20
- var ownKeys = function(o) {
21
- ownKeys = Object.getOwnPropertyNames || function (o) {
22
- var ar = [];
23
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
24
- return ar;
25
- };
26
- return ownKeys(o);
27
- };
28
- return function (mod) {
29
- if (mod && mod.__esModule) return mod;
30
- var result = {};
31
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
32
- __setModuleDefault(result, mod);
33
- return result;
34
- };
35
- })();
36
- Object.defineProperty(exports, "__esModule", { value: true });
37
- exports.runRepoDetachCli = runRepoDetachCli;
38
- const fs = __importStar(require("node:fs"));
39
- const path = __importStar(require("node:path"));
40
- const project_context_1 = require("../../project-context");
41
- function printHelp(stderr) {
42
- stderr(`
43
- repo detach - Detach the current repository from local Spekn project context
44
-
45
- USAGE:
46
- spekn repo detach [options]
47
-
48
- OPTIONS:
49
- --path <dir> Repository root path (default: current directory)
50
- --help Show this help message
51
-
52
- EXAMPLES:
53
- spekn repo detach
54
- spekn repo detach --path /path/to/repo
55
- `);
56
- }
57
- function parseArgs(args) {
58
- let repoPath = process.cwd();
59
- for (let index = 0; index < args.length; index += 1) {
60
- const arg = args[index];
61
- if (arg === '--help') {
62
- throw new Error('HELP_REQUESTED');
63
- }
64
- if (arg === '--path' && args[index + 1]) {
65
- repoPath = path.resolve(args[index + 1]);
66
- index += 1;
67
- continue;
68
- }
69
- if (arg?.startsWith('--path=')) {
70
- repoPath = path.resolve(arg.slice('--path='.length));
71
- }
72
- }
73
- return { repoPath };
74
- }
75
- async function runRepoDetachCli(args) {
76
- try {
77
- const options = parseArgs(args);
78
- const localContextPath = path.join(options.repoPath, '.spekn');
79
- const localContext = (0, project_context_1.loadLocalContext)(options.repoPath);
80
- const globalCleanup = (0, project_context_1.clearRepoFromGlobalContext)(options.repoPath, localContext?.projectId);
81
- const hasLocalContext = fs.existsSync(localContextPath);
82
- if (hasLocalContext) {
83
- fs.unlinkSync(localContextPath);
84
- process.stdout.write(`Detached repository context (${localContextPath}).\n`);
85
- }
86
- else {
87
- process.stdout.write('No local .spekn context file found.\n');
88
- }
89
- if (globalCleanup.removedProjectRefs > 0 ||
90
- globalCleanup.removedSyncCheckpoints > 0 ||
91
- globalCleanup.removedProjects > 0 ||
92
- globalCleanup.clearedLastUsedProjectId) {
93
- process.stdout.write(`Cleared global repo context references: ` +
94
- `${globalCleanup.removedProjectRefs} project path(s), ` +
95
- `${globalCleanup.removedSyncCheckpoints} sync checkpoint(s), ` +
96
- `${globalCleanup.removedProjects} project record(s)` +
97
- `${globalCleanup.clearedLastUsedProjectId ? ', lastUsedProjectId cleared' : ''}.\n`);
98
- }
99
- else {
100
- process.stdout.write('No global repo context references found.\n');
101
- }
102
- return 0;
103
- }
104
- catch (error) {
105
- const message = error instanceof Error ? error.message : String(error);
106
- if (message === 'HELP_REQUESTED') {
107
- printHelp(process.stderr.write.bind(process.stderr));
108
- return 0;
109
- }
110
- process.stderr.write(`Error: ${message}\n`);
111
- return 1;
112
- }
113
- }
114
- async function main() {
115
- const exitCode = await runRepoDetachCli(process.argv.slice(2));
116
- process.exit(exitCode);
117
- }
118
- if (require.main === module) {
119
- void main();
120
- }
@@ -1,21 +0,0 @@
1
- #!/usr/bin/env node
2
- /**
3
- * repo-register CLI command
4
- *
5
- * Registers the current git repository with a Spekn project and optionally
6
- * runs AI-powered analysis to discover specs, assess governance, and create
7
- * improvement specifications.
8
- *
9
- * Usage: spekn repo register --project-id <uuid> [--primary] [--analyze] [--no-analyze]
10
- * [--agent <name>] [--path <dir>] [--dry-run] [--api-url <url>]
11
- */
12
- import { type CommonOptions, type Deps } from "./common";
13
- export { repoNameFromUrl, resolveDefaultBranch, discoverFiles, buildAnalysisPrompt, executeAcpSession, runAnalysisWithAgent, verifyMcpServer, } from "./common";
14
- export type { DiscoveredFile } from "./common";
15
- interface RegisterOptions extends CommonOptions {
16
- primary: boolean;
17
- }
18
- declare function parseArgs(args: string[]): RegisterOptions;
19
- export declare function runRepoRegisterCli(args: string[], deps?: Deps): Promise<number>;
20
- declare function main(): Promise<void>;
21
- export { main, parseArgs };
@@ -1,175 +0,0 @@
1
- #!/usr/bin/env node
2
- "use strict";
3
- /**
4
- * repo-register CLI command
5
- *
6
- * Registers the current git repository with a Spekn project and optionally
7
- * runs AI-powered analysis to discover specs, assess governance, and create
8
- * improvement specifications.
9
- *
10
- * Usage: spekn repo register --project-id <uuid> [--primary] [--analyze] [--no-analyze]
11
- * [--agent <name>] [--path <dir>] [--dry-run] [--api-url <url>]
12
- */
13
- Object.defineProperty(exports, "__esModule", { value: true });
14
- exports.verifyMcpServer = exports.runAnalysisWithAgent = exports.executeAcpSession = exports.buildAnalysisPrompt = exports.discoverFiles = exports.resolveDefaultBranch = exports.repoNameFromUrl = void 0;
15
- exports.runRepoRegisterCli = runRepoRegisterCli;
16
- exports.main = main;
17
- exports.parseArgs = parseArgs;
18
- const common_1 = require("./common");
19
- const project_context_1 = require("../../project-context");
20
- const structured_log_1 = require("../../utils/structured-log");
21
- // Re-export shared utilities for backward compatibility
22
- var common_2 = require("./common");
23
- Object.defineProperty(exports, "repoNameFromUrl", { enumerable: true, get: function () { return common_2.repoNameFromUrl; } });
24
- Object.defineProperty(exports, "resolveDefaultBranch", { enumerable: true, get: function () { return common_2.resolveDefaultBranch; } });
25
- Object.defineProperty(exports, "discoverFiles", { enumerable: true, get: function () { return common_2.discoverFiles; } });
26
- Object.defineProperty(exports, "buildAnalysisPrompt", { enumerable: true, get: function () { return common_2.buildAnalysisPrompt; } });
27
- Object.defineProperty(exports, "executeAcpSession", { enumerable: true, get: function () { return common_2.executeAcpSession; } });
28
- Object.defineProperty(exports, "runAnalysisWithAgent", { enumerable: true, get: function () { return common_2.runAnalysisWithAgent; } });
29
- Object.defineProperty(exports, "verifyMcpServer", { enumerable: true, get: function () { return common_2.verifyMcpServer; } });
30
- // ── Help & Args ─────────────────────────────────────────────────────
31
- function printHelp(stderr) {
32
- stderr(`
33
- repo register - Register the current git repository with a Spekn project
34
-
35
- USAGE:
36
- spekn repo register --project-id <uuid> [options]
37
-
38
- OPTIONS:
39
- --project-id <uuid> Project ID to register the repo under (optional if .spekn/context is present)
40
- --primary Set this repository as the primary repo for the project
41
- --analyze Run AI analysis after registration (default: true)
42
- --no-analyze Skip AI analysis (metadata-only registration)
43
- --agent <name> Force a specific agent (claude, codex, opencode, etc.)
44
- --path <dir> Repository root path (default: current directory)
45
- --dry-run Discover files only, skip AI analysis
46
- --api-url <url> API base URL (default: SPEKN_API_URL or https://app.spekn.com)
47
- --mcp-url <url> MCP HTTP server URL (default: MCP_HTTP_URL or https://app.spekn.com/mcp)
48
- --debug Show detailed debug output (tokens, HTTP exchanges)
49
- --help Show this help message
50
-
51
- ENVIRONMENT:
52
- SPEKN_API_URL API base URL
53
- SPEKN_AUTH_TOKEN Bearer token for authentication
54
- SPEKN_ORGANIZATION_ID Organization ID header
55
- MCP_HTTP_URL MCP HTTP server URL (default: https://app.spekn.com/mcp)
56
- AGENT_ARGS Override agent CLI args (skips ACP registry resolution)
57
-
58
- EXAMPLES:
59
- spekn repo register --project-id 11111111-1111-4111-8111-111111111111
60
- spekn repo register --project-id 11111111-1111-4111-8111-111111111111 --primary
61
- spekn repo register --project-id 11111111-1111-4111-8111-111111111111 --no-analyze
62
- spekn repo register --project-id 11111111-1111-4111-8111-111111111111 --dry-run
63
- spekn repo register --project-id 11111111-1111-4111-8111-111111111111 --agent claude
64
- spekn repo register --project-id 11111111-1111-4111-8111-111111111111 --path /path/to/repo
65
- `);
66
- }
67
- function parseArgs(args) {
68
- const opts = { ...(0, common_1.commonDefaults)(true), primary: false };
69
- for (let i = 0; i < args.length;) {
70
- const consumed = (0, common_1.parseCommonFlag)(args, i, opts);
71
- if (consumed > 0) {
72
- i += consumed;
73
- continue;
74
- }
75
- if (args[i] === "--primary") {
76
- opts.primary = true;
77
- i++;
78
- continue;
79
- }
80
- i++; // skip unknown
81
- }
82
- return (0, common_1.finalizeOptions)(opts);
83
- }
84
- // ── Main ────────────────────────────────────────────────────────────
85
- async function runRepoRegisterCli(args, deps = common_1.defaultDeps) {
86
- try {
87
- const options = parseArgs(args);
88
- (0, structured_log_1.appendCliStructuredLog)({
89
- source: "cli.repo.register",
90
- level: "info",
91
- message: "Starting repo register",
92
- details: { repoPath: options.repoPath, analyze: options.analyze, apiUrl: options.apiUrl },
93
- });
94
- const { authToken, organizationId, projectId } = await (0, common_1.resolveAuth)(deps, {
95
- projectId: options.projectId,
96
- repoPath: options.repoPath,
97
- });
98
- // ── Phase 1: Register repository metadata ──────────────────────
99
- const git = (0, common_1.readGitMetadata)(options.repoPath, deps);
100
- if (!git)
101
- return 1;
102
- deps.stdout(`Registering repository "${git.name}" (${git.remoteUrl})\n`);
103
- deps.stdout(` Default branch : ${git.defaultBranch}\n`);
104
- deps.stdout(` Project : ${projectId}\n`);
105
- if (options.primary)
106
- deps.stdout(" Primary : yes\n");
107
- const client = (0, common_1.createApiClient)(options.apiUrl, authToken, organizationId);
108
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
109
- const result = await client.gitRepository.create.mutate({
110
- projectId,
111
- name: git.name,
112
- repositoryUrl: git.remoteUrl,
113
- defaultBranch: git.defaultBranch,
114
- isPrimary: options.primary,
115
- });
116
- deps.stdout(`Repository registered successfully. ID: ${result.id}\n`);
117
- (0, structured_log_1.appendCliStructuredLog)({
118
- source: "cli.repo.register",
119
- level: "info",
120
- message: "Repository metadata registered",
121
- details: { projectId, organizationId, repositoryId: result.id },
122
- });
123
- (0, project_context_1.persistProjectContext)(options.repoPath, { projectId, organizationId: organizationId || undefined });
124
- (0, project_context_1.ensureGitignoreHasSpekn)(options.repoPath);
125
- // ── Phase 2: AI analysis (optional) ─────────────────────────────
126
- if (!options.analyze)
127
- return 0;
128
- if (!organizationId) {
129
- deps.stderr("Warning: No organization ID. Skipping AI analysis. Re-run 'spekn auth login' or set SPEKN_ORGANIZATION_ID.\n");
130
- return 0;
131
- }
132
- const exitCode = await (0, common_1.runAnalysisPhase)({ ...options, projectId }, authToken ?? "", deps, organizationId);
133
- (0, structured_log_1.appendCliStructuredLog)({
134
- source: "cli.repo.register",
135
- level: exitCode === 0 ? "info" : "error",
136
- message: "Repo register completed",
137
- details: { exitCode, analyzed: options.analyze, projectId },
138
- });
139
- return exitCode;
140
- }
141
- catch (error) {
142
- if (error instanceof common_1.HelpRequestedError) {
143
- printHelp(deps.stderr);
144
- return 0;
145
- }
146
- const message = error instanceof Error ? error.message : String(error);
147
- deps.stderr(`Error: ${message}\n`);
148
- // Provide specific guidance for common errors
149
- if (message.includes('organization') || message.includes('Organization')) {
150
- deps.stderr(`\n`);
151
- deps.stderr(`Organization context is required. Try one of:\n`);
152
- deps.stderr(` 1. Run 'spekn auth login' to authenticate and select an organization\n`);
153
- deps.stderr(` 2. Set SPEKN_ORGANIZATION_ID environment variable\n`);
154
- deps.stderr(` 3. Pass --organization-id explicitly (if supported)\n`);
155
- }
156
- else if (message.includes('credentials') || message.includes('auth') || message.includes('token')) {
157
- deps.stderr(`\n`);
158
- deps.stderr(`Authentication required. Run:\n`);
159
- deps.stderr(` spekn auth login\n`);
160
- }
161
- (0, structured_log_1.appendCliStructuredLog)({
162
- source: "cli.repo.register",
163
- level: "error",
164
- message: message,
165
- });
166
- return 1;
167
- }
168
- }
169
- async function main() {
170
- const exitCode = await runRepoRegisterCli(process.argv.slice(2));
171
- process.exit(exitCode);
172
- }
173
- if (require.main === module) {
174
- void main();
175
- }
@@ -1,22 +0,0 @@
1
- #!/usr/bin/env node
2
- /**
3
- * repo-sync CLI command
4
- *
5
- * Syncs metadata for the current git repository with Spekn.
6
- * Looks up the repo by its remote URL and updates name and default branch.
7
- * By default, also runs ingestion drift analysis against project spec storage.
8
- * Must be run from inside a local git clone.
9
- *
10
- * Usage: spekn repo sync --project-id <uuid> [--analyze|--no-analyze] [--import-to-project] [--api-url <url>]
11
- */
12
- import { type CommonOptions, type Deps } from "./common";
13
- interface SyncOptions extends CommonOptions {
14
- importToProject: boolean;
15
- maxFiles: number;
16
- analysisEngine: "ingestion" | "acp" | "both";
17
- acpTimeoutMs?: number;
18
- }
19
- declare function parseArgs(args: string[]): SyncOptions;
20
- export declare function runRepoSyncCli(args: string[], deps?: Deps): Promise<number>;
21
- declare function main(): Promise<void>;
22
- export { main, parseArgs };