@spekn/cli 1.0.0
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/dist/__tests__/export-cli.test.d.ts +1 -0
- package/dist/__tests__/export-cli.test.js +70 -0
- package/dist/__tests__/tui-args-policy.test.d.ts +1 -0
- package/dist/__tests__/tui-args-policy.test.js +50 -0
- package/dist/acp-S2MHZOAD.mjs +23 -0
- package/dist/acp-UCCI44JY.mjs +25 -0
- package/dist/auth/credentials-store.d.ts +2 -0
- package/dist/auth/credentials-store.js +5 -0
- package/dist/auth/device-flow.d.ts +36 -0
- package/dist/auth/device-flow.js +189 -0
- package/dist/auth/jwt.d.ts +1 -0
- package/dist/auth/jwt.js +6 -0
- package/dist/auth/session.d.ts +67 -0
- package/dist/auth/session.js +86 -0
- package/dist/auth-login.d.ts +34 -0
- package/dist/auth-login.js +202 -0
- package/dist/auth-logout.d.ts +25 -0
- package/dist/auth-logout.js +115 -0
- package/dist/auth-status.d.ts +24 -0
- package/dist/auth-status.js +109 -0
- package/dist/backlog-generate.d.ts +11 -0
- package/dist/backlog-generate.js +308 -0
- package/dist/backlog-health.d.ts +11 -0
- package/dist/backlog-health.js +287 -0
- package/dist/bridge-login.d.ts +40 -0
- package/dist/bridge-login.js +277 -0
- package/dist/chunk-3PAYRI4G.mjs +2428 -0
- package/dist/chunk-M4CS3A25.mjs +2426 -0
- package/dist/commands/auth/login.d.ts +30 -0
- package/dist/commands/auth/login.js +164 -0
- package/dist/commands/auth/logout.d.ts +25 -0
- package/dist/commands/auth/logout.js +115 -0
- package/dist/commands/auth/status.d.ts +24 -0
- package/dist/commands/auth/status.js +109 -0
- package/dist/commands/backlog/generate.d.ts +11 -0
- package/dist/commands/backlog/generate.js +308 -0
- package/dist/commands/backlog/health.d.ts +11 -0
- package/dist/commands/backlog/health.js +287 -0
- package/dist/commands/bridge/login.d.ts +36 -0
- package/dist/commands/bridge/login.js +258 -0
- package/dist/commands/export.d.ts +35 -0
- package/dist/commands/export.js +485 -0
- package/dist/commands/marketplace-export.d.ts +21 -0
- package/dist/commands/marketplace-export.js +214 -0
- package/dist/commands/project-clean.d.ts +1 -0
- package/dist/commands/project-clean.js +126 -0
- package/dist/commands/repo/common.d.ts +105 -0
- package/dist/commands/repo/common.js +775 -0
- package/dist/commands/repo/detach.d.ts +2 -0
- package/dist/commands/repo/detach.js +120 -0
- package/dist/commands/repo/register.d.ts +21 -0
- package/dist/commands/repo/register.js +175 -0
- package/dist/commands/repo/sync.d.ts +22 -0
- package/dist/commands/repo/sync.js +873 -0
- package/dist/commands/skills-import-local.d.ts +16 -0
- package/dist/commands/skills-import-local.js +352 -0
- package/dist/commands/spec/drift-check.d.ts +3 -0
- package/dist/commands/spec/drift-check.js +186 -0
- package/dist/commands/spec/frontmatter.d.ts +11 -0
- package/dist/commands/spec/frontmatter.js +219 -0
- package/dist/commands/spec/lint.d.ts +11 -0
- package/dist/commands/spec/lint.js +499 -0
- package/dist/commands/spec/parse.d.ts +11 -0
- package/dist/commands/spec/parse.js +162 -0
- package/dist/export.d.ts +35 -0
- package/dist/export.js +485 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.js +21 -0
- package/dist/main.d.ts +1 -0
- package/dist/main.js +115280 -0
- package/dist/marketplace-export.d.ts +21 -0
- package/dist/marketplace-export.js +214 -0
- package/dist/project-clean.d.ts +1 -0
- package/dist/project-clean.js +126 -0
- package/dist/project-context.d.ts +99 -0
- package/dist/project-context.js +376 -0
- package/dist/repo-common.d.ts +101 -0
- package/dist/repo-common.js +671 -0
- package/dist/repo-detach.d.ts +2 -0
- package/dist/repo-detach.js +102 -0
- package/dist/repo-ingest.d.ts +29 -0
- package/dist/repo-ingest.js +305 -0
- package/dist/repo-register.d.ts +21 -0
- package/dist/repo-register.js +175 -0
- package/dist/repo-sync.d.ts +16 -0
- package/dist/repo-sync.js +152 -0
- package/dist/resources/prompt-loader.d.ts +1 -0
- package/dist/resources/prompt-loader.js +62 -0
- package/dist/resources/prompts/README.md +21 -0
- package/dist/resources/prompts/prompts/repo-analysis.prompt.md +126 -0
- package/dist/resources/prompts/repo-analysis.prompt.md +151 -0
- package/dist/resources/prompts/repo-sync-analysis.prompt.md +85 -0
- package/dist/skills-import-local.d.ts +16 -0
- package/dist/skills-import-local.js +352 -0
- package/dist/spec-drift-check.d.ts +3 -0
- package/dist/spec-drift-check.js +186 -0
- package/dist/spec-frontmatter.d.ts +11 -0
- package/dist/spec-frontmatter.js +219 -0
- package/dist/spec-lint.d.ts +11 -0
- package/dist/spec-lint.js +499 -0
- package/dist/spec-parse.d.ts +11 -0
- package/dist/spec-parse.js +162 -0
- package/dist/stubs/dotenv.d.ts +5 -0
- package/dist/stubs/dotenv.js +6 -0
- package/dist/stubs/typeorm.d.ts +22 -0
- package/dist/stubs/typeorm.js +28 -0
- package/dist/tui/app.d.ts +7 -0
- package/dist/tui/app.js +122 -0
- package/dist/tui/args.d.ts +8 -0
- package/dist/tui/args.js +57 -0
- package/dist/tui/capabilities/policy.d.ts +7 -0
- package/dist/tui/capabilities/policy.js +64 -0
- package/dist/tui/components/frame.d.ts +8 -0
- package/dist/tui/components/frame.js +8 -0
- package/dist/tui/components/status-bar.d.ts +8 -0
- package/dist/tui/components/status-bar.js +8 -0
- package/dist/tui/index.d.ts +2 -0
- package/dist/tui/index.js +23 -0
- package/dist/tui/index.mjs +7563 -0
- package/dist/tui/keymap/use-global-keymap.d.ts +19 -0
- package/dist/tui/keymap/use-global-keymap.js +82 -0
- package/dist/tui/navigation/nav-items.d.ts +3 -0
- package/dist/tui/navigation/nav-items.js +18 -0
- package/dist/tui/screens/bridge.d.ts +8 -0
- package/dist/tui/screens/bridge.js +19 -0
- package/dist/tui/screens/decisions.d.ts +5 -0
- package/dist/tui/screens/decisions.js +28 -0
- package/dist/tui/screens/export.d.ts +5 -0
- package/dist/tui/screens/export.js +16 -0
- package/dist/tui/screens/home.d.ts +5 -0
- package/dist/tui/screens/home.js +33 -0
- package/dist/tui/screens/locked.d.ts +5 -0
- package/dist/tui/screens/locked.js +9 -0
- package/dist/tui/screens/specs.d.ts +5 -0
- package/dist/tui/screens/specs.js +31 -0
- package/dist/tui/services/client.d.ts +1 -0
- package/dist/tui/services/client.js +18 -0
- package/dist/tui/services/context-service.d.ts +19 -0
- package/dist/tui/services/context-service.js +246 -0
- package/dist/tui/shared-enums.d.ts +16 -0
- package/dist/tui/shared-enums.js +19 -0
- package/dist/tui/state/use-app-state.d.ts +35 -0
- package/dist/tui/state/use-app-state.js +177 -0
- package/dist/tui/types.d.ts +77 -0
- package/dist/tui/types.js +2 -0
- package/dist/tui-bundle.d.ts +1 -0
- package/dist/tui-bundle.js +5 -0
- package/dist/tui-entry.mjs +1407 -0
- package/dist/utils/cli-runtime.d.ts +5 -0
- package/dist/utils/cli-runtime.js +22 -0
- package/dist/utils/help-error.d.ts +7 -0
- package/dist/utils/help-error.js +14 -0
- package/dist/utils/interaction.d.ts +19 -0
- package/dist/utils/interaction.js +93 -0
- package/dist/utils/structured-log.d.ts +7 -0
- package/dist/utils/structured-log.js +112 -0
- package/dist/utils/trpc-url.d.ts +4 -0
- package/dist/utils/trpc-url.js +15 -0
- package/package.json +59 -0
|
@@ -0,0 +1,277 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
/**
|
|
4
|
+
* bridge login CLI command
|
|
5
|
+
*
|
|
6
|
+
* Authenticates the CLI user via the Keycloak Device Authorization Grant,
|
|
7
|
+
* then registers the bridge device with the Spekn SaaS API. This combines
|
|
8
|
+
* `auth login` (credentials) with bridge device registration in a single step.
|
|
9
|
+
*
|
|
10
|
+
* Usage: spekn bridge login [--name <device-name>] [--api-url <url>] [--force]
|
|
11
|
+
*/
|
|
12
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
13
|
+
if (k2 === undefined) k2 = k;
|
|
14
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
15
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
16
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
17
|
+
}
|
|
18
|
+
Object.defineProperty(o, k2, desc);
|
|
19
|
+
}) : (function(o, m, k, k2) {
|
|
20
|
+
if (k2 === undefined) k2 = k;
|
|
21
|
+
o[k2] = m[k];
|
|
22
|
+
}));
|
|
23
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
24
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
25
|
+
}) : function(o, v) {
|
|
26
|
+
o["default"] = v;
|
|
27
|
+
});
|
|
28
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
29
|
+
var ownKeys = function(o) {
|
|
30
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
31
|
+
var ar = [];
|
|
32
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
33
|
+
return ar;
|
|
34
|
+
};
|
|
35
|
+
return ownKeys(o);
|
|
36
|
+
};
|
|
37
|
+
return function (mod) {
|
|
38
|
+
if (mod && mod.__esModule) return mod;
|
|
39
|
+
var result = {};
|
|
40
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
41
|
+
__setModuleDefault(result, mod);
|
|
42
|
+
return result;
|
|
43
|
+
};
|
|
44
|
+
})();
|
|
45
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
46
|
+
exports.runBridgeLoginCli = runBridgeLoginCli;
|
|
47
|
+
exports.main = main;
|
|
48
|
+
exports.parseArgs = parseArgs;
|
|
49
|
+
exports.decodeJwtPayload = decodeJwtPayload;
|
|
50
|
+
const os = __importStar(require("node:os"));
|
|
51
|
+
const client_1 = require("@trpc/client");
|
|
52
|
+
const device_flow_js_1 = require("./auth/device-flow.js");
|
|
53
|
+
const credentials_store_js_1 = require("./auth/credentials-store.js");
|
|
54
|
+
const bridge_1 = require("@spekn/bridge");
|
|
55
|
+
const trpc_url_1 = require("./utils/trpc-url");
|
|
56
|
+
const help_error_1 = require("./utils/help-error");
|
|
57
|
+
const structured_log_1 = require("./utils/structured-log");
|
|
58
|
+
const defaultDeps = {
|
|
59
|
+
stdout: process.stdout,
|
|
60
|
+
stderr: process.stderr,
|
|
61
|
+
performDeviceFlow: device_flow_js_1.performDeviceFlow,
|
|
62
|
+
credentialsStore: new credentials_store_js_1.CredentialsStore(),
|
|
63
|
+
bridgeConfigStore: new bridge_1.BridgeConfigStore(),
|
|
64
|
+
};
|
|
65
|
+
function resolveDeps(deps) {
|
|
66
|
+
return {
|
|
67
|
+
stdout: deps?.stdout ?? defaultDeps.stdout,
|
|
68
|
+
stderr: deps?.stderr ?? defaultDeps.stderr,
|
|
69
|
+
performDeviceFlow: deps?.performDeviceFlow ?? defaultDeps.performDeviceFlow,
|
|
70
|
+
credentialsStore: deps?.credentialsStore ?? defaultDeps.credentialsStore,
|
|
71
|
+
bridgeConfigStore: deps?.bridgeConfigStore ?? defaultDeps.bridgeConfigStore,
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
function printHelp(stderr) {
|
|
75
|
+
stderr.write(`
|
|
76
|
+
bridge login - Authenticate and register the bridge with Spekn SaaS
|
|
77
|
+
|
|
78
|
+
USAGE:
|
|
79
|
+
spekn bridge login [options]
|
|
80
|
+
|
|
81
|
+
OPTIONS:
|
|
82
|
+
--name <name> Device name (default: system hostname)
|
|
83
|
+
--api-url <url> API base URL (default: SPEKN_API_URL or https://app.spekn.com)
|
|
84
|
+
--keycloak-url <url> Keycloak base URL (default: KEYCLOAK_URL or https://auth.spekn.com)
|
|
85
|
+
--realm <realm> Keycloak realm name (default: KEYCLOAK_REALM or spekn)
|
|
86
|
+
--force Re-register even if bridge is already paired
|
|
87
|
+
--help Show this help message
|
|
88
|
+
|
|
89
|
+
ENVIRONMENT:
|
|
90
|
+
SPEKN_API_URL API base URL
|
|
91
|
+
KEYCLOAK_URL Keycloak base URL
|
|
92
|
+
KEYCLOAK_REALM Keycloak realm name
|
|
93
|
+
|
|
94
|
+
EXAMPLES:
|
|
95
|
+
spekn bridge login
|
|
96
|
+
spekn bridge login --name my-dev-machine
|
|
97
|
+
spekn bridge login --api-url https://api.spekn.dev --force
|
|
98
|
+
`);
|
|
99
|
+
}
|
|
100
|
+
function parseArgs(args) {
|
|
101
|
+
let deviceName = os.hostname();
|
|
102
|
+
let apiUrl = process.env["SPEKN_API_URL"] ?? "https://app.spekn.com";
|
|
103
|
+
let keycloakUrl = process.env["KEYCLOAK_URL"] ?? "https://auth.spekn.com";
|
|
104
|
+
let realm = process.env["KEYCLOAK_REALM"] ?? "spekn";
|
|
105
|
+
let force = false;
|
|
106
|
+
for (let index = 0; index < args.length; index++) {
|
|
107
|
+
const arg = args[index];
|
|
108
|
+
if (arg === "--help" || arg === "-h") {
|
|
109
|
+
throw new help_error_1.HelpRequestedError();
|
|
110
|
+
}
|
|
111
|
+
if (arg === "--name" && args[index + 1]) {
|
|
112
|
+
deviceName = args[++index];
|
|
113
|
+
continue;
|
|
114
|
+
}
|
|
115
|
+
if (arg?.startsWith("--name=")) {
|
|
116
|
+
deviceName = arg.slice("--name=".length);
|
|
117
|
+
continue;
|
|
118
|
+
}
|
|
119
|
+
if (arg === "--api-url" && args[index + 1]) {
|
|
120
|
+
apiUrl = args[++index];
|
|
121
|
+
continue;
|
|
122
|
+
}
|
|
123
|
+
if (arg?.startsWith("--api-url=")) {
|
|
124
|
+
apiUrl = arg.slice("--api-url=".length);
|
|
125
|
+
continue;
|
|
126
|
+
}
|
|
127
|
+
if (arg === "--keycloak-url" && args[index + 1]) {
|
|
128
|
+
keycloakUrl = args[++index];
|
|
129
|
+
continue;
|
|
130
|
+
}
|
|
131
|
+
if (arg?.startsWith("--keycloak-url=")) {
|
|
132
|
+
keycloakUrl = arg.slice("--keycloak-url=".length);
|
|
133
|
+
continue;
|
|
134
|
+
}
|
|
135
|
+
if (arg === "--realm" && args[index + 1]) {
|
|
136
|
+
realm = args[++index];
|
|
137
|
+
continue;
|
|
138
|
+
}
|
|
139
|
+
if (arg?.startsWith("--realm=")) {
|
|
140
|
+
realm = arg.slice("--realm=".length);
|
|
141
|
+
continue;
|
|
142
|
+
}
|
|
143
|
+
if (arg === "--force") {
|
|
144
|
+
force = true;
|
|
145
|
+
continue;
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
return { deviceName, apiUrl, keycloakUrl, realm, force };
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* Decode the payload of a JWT access token without verification.
|
|
152
|
+
* Returns the raw claims object, or null if decoding fails.
|
|
153
|
+
*/
|
|
154
|
+
function decodeJwtPayload(token) {
|
|
155
|
+
try {
|
|
156
|
+
const parts = token.split(".");
|
|
157
|
+
if (parts.length !== 3) {
|
|
158
|
+
return null;
|
|
159
|
+
}
|
|
160
|
+
const base64 = parts[1]
|
|
161
|
+
.replace(/-/g, "+")
|
|
162
|
+
.replace(/_/g, "/");
|
|
163
|
+
const padded = base64.padEnd(base64.length + ((4 - (base64.length % 4)) % 4), "=");
|
|
164
|
+
const json = Buffer.from(padded, "base64").toString("utf-8");
|
|
165
|
+
return JSON.parse(json);
|
|
166
|
+
}
|
|
167
|
+
catch {
|
|
168
|
+
return null;
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
async function runBridgeLoginCli(args, deps) {
|
|
172
|
+
const resolved = resolveDeps(deps);
|
|
173
|
+
try {
|
|
174
|
+
const options = parseArgs(args);
|
|
175
|
+
(0, structured_log_1.appendCliStructuredLog)({
|
|
176
|
+
source: "cli.bridge.login",
|
|
177
|
+
level: "info",
|
|
178
|
+
message: "Starting bridge login",
|
|
179
|
+
details: { deviceName: options.deviceName, apiUrl: options.apiUrl, force: options.force },
|
|
180
|
+
});
|
|
181
|
+
// Load bridge config
|
|
182
|
+
resolved.bridgeConfigStore.load();
|
|
183
|
+
// Check if already paired — require --force to re-register
|
|
184
|
+
if (resolved.bridgeConfigStore.isPaired() && !options.force) {
|
|
185
|
+
resolved.stderr.write("Bridge is already registered. Use --force to re-register.\n");
|
|
186
|
+
return 1;
|
|
187
|
+
}
|
|
188
|
+
// Step 1: Check for existing valid token; if none, run device flow
|
|
189
|
+
let accessToken = await resolved.credentialsStore.getValidToken();
|
|
190
|
+
if (!accessToken) {
|
|
191
|
+
resolved.stdout.write("No valid credentials found. Starting login...\n");
|
|
192
|
+
const result = await resolved.performDeviceFlow(options.keycloakUrl, options.realm, "spekn-cli", { stdout: resolved.stdout, stderr: resolved.stderr });
|
|
193
|
+
// Step 2: Save Keycloak credentials (bridge login doubles as auth login)
|
|
194
|
+
const claims = decodeJwtPayload(result.accessToken);
|
|
195
|
+
const sub = typeof claims?.["sub"] === "string" ? claims["sub"] : "unknown";
|
|
196
|
+
const email = typeof claims?.["email"] === "string" ? claims["email"] : "unknown";
|
|
197
|
+
const name = typeof claims?.["name"] === "string"
|
|
198
|
+
? claims["name"]
|
|
199
|
+
: typeof claims?.["preferred_username"] === "string"
|
|
200
|
+
? claims["preferred_username"]
|
|
201
|
+
: undefined;
|
|
202
|
+
const credentials = {
|
|
203
|
+
accessToken: result.accessToken,
|
|
204
|
+
refreshToken: result.refreshToken,
|
|
205
|
+
expiresAt: Date.now() + result.expiresIn * 1000,
|
|
206
|
+
keycloakUrl: options.keycloakUrl,
|
|
207
|
+
realm: options.realm,
|
|
208
|
+
user: { sub, email, name },
|
|
209
|
+
};
|
|
210
|
+
resolved.credentialsStore.save(credentials);
|
|
211
|
+
resolved.stdout.write(`Authenticated as ${email}\n`);
|
|
212
|
+
accessToken = result.accessToken;
|
|
213
|
+
}
|
|
214
|
+
else {
|
|
215
|
+
const storedCreds = resolved.credentialsStore.load();
|
|
216
|
+
const email = storedCreds?.user?.email ?? "unknown";
|
|
217
|
+
resolved.stdout.write(`Using existing credentials (${email})\n`);
|
|
218
|
+
}
|
|
219
|
+
// Resolve organization ID from credentials store or env
|
|
220
|
+
const storedCreds = resolved.credentialsStore.load();
|
|
221
|
+
const organizationId = storedCreds?.organizationId ?? process.env["SPEKN_ORGANIZATION_ID"] ?? "";
|
|
222
|
+
// Step 3: POST to bridge.registerWithToken
|
|
223
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
224
|
+
const client = (0, client_1.createTRPCProxyClient)({
|
|
225
|
+
links: [
|
|
226
|
+
(0, client_1.httpBatchLink)({
|
|
227
|
+
url: (0, trpc_url_1.normalizeTrpcUrl)(options.apiUrl),
|
|
228
|
+
headers: {
|
|
229
|
+
authorization: `Bearer ${accessToken}`,
|
|
230
|
+
"x-organization-id": organizationId,
|
|
231
|
+
},
|
|
232
|
+
}),
|
|
233
|
+
],
|
|
234
|
+
});
|
|
235
|
+
const result = await client.bridge.registerWithToken.mutate({
|
|
236
|
+
deviceName: options.deviceName,
|
|
237
|
+
});
|
|
238
|
+
// Step 4: Save result to BridgeConfigStore
|
|
239
|
+
resolved.bridgeConfigStore.setPairing({
|
|
240
|
+
deviceId: result.deviceId,
|
|
241
|
+
deviceName: options.deviceName,
|
|
242
|
+
credential: result.credential,
|
|
243
|
+
pairedAt: new Date().toISOString(),
|
|
244
|
+
saasOrigin: result.saasOrigin,
|
|
245
|
+
});
|
|
246
|
+
resolved.bridgeConfigStore.update({ saasWsUrl: result.saasWsUrl });
|
|
247
|
+
resolved.stdout.write(`\nBridge registered as '${options.deviceName}'. Run: spekn bridge start\n`);
|
|
248
|
+
(0, structured_log_1.appendCliStructuredLog)({
|
|
249
|
+
source: "cli.bridge.login",
|
|
250
|
+
level: "info",
|
|
251
|
+
message: "Bridge login completed",
|
|
252
|
+
details: { deviceId: result.deviceId, organizationId: result.organizationId },
|
|
253
|
+
});
|
|
254
|
+
return 0;
|
|
255
|
+
}
|
|
256
|
+
catch (error) {
|
|
257
|
+
if (error instanceof help_error_1.HelpRequestedError) {
|
|
258
|
+
printHelp(resolved.stderr);
|
|
259
|
+
return 0;
|
|
260
|
+
}
|
|
261
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
262
|
+
resolved.stderr.write(`Error: ${message}\n`);
|
|
263
|
+
(0, structured_log_1.appendCliStructuredLog)({
|
|
264
|
+
source: "cli.bridge.login",
|
|
265
|
+
level: "error",
|
|
266
|
+
message,
|
|
267
|
+
});
|
|
268
|
+
return 1;
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
async function main() {
|
|
272
|
+
const exitCode = await runBridgeLoginCli(process.argv.slice(2));
|
|
273
|
+
process.exit(exitCode);
|
|
274
|
+
}
|
|
275
|
+
if (require.main === module) {
|
|
276
|
+
void main();
|
|
277
|
+
}
|