@testsprite/testsprite-cli 0.2.0 → 0.4.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.
Files changed (68) hide show
  1. package/README.md +35 -26
  2. package/dist/commands/agent.d.ts +43 -0
  3. package/dist/commands/agent.js +200 -18
  4. package/dist/commands/auth.d.ts +5 -0
  5. package/dist/commands/auth.js +38 -27
  6. package/dist/commands/doctor.d.ts +49 -0
  7. package/dist/commands/doctor.js +233 -0
  8. package/dist/commands/init.d.ts +1 -1
  9. package/dist/commands/init.js +24 -14
  10. package/dist/commands/project.d.ts +75 -2
  11. package/dist/commands/project.js +326 -47
  12. package/dist/commands/test.d.ts +281 -2
  13. package/dist/commands/test.js +1658 -177
  14. package/dist/commands/usage.js +13 -12
  15. package/dist/index.js +71 -3
  16. package/dist/lib/agent-targets.d.ts +72 -6
  17. package/dist/lib/agent-targets.js +188 -6
  18. package/dist/lib/bundle.d.ts +34 -0
  19. package/dist/lib/bundle.js +63 -11
  20. package/dist/lib/client-factory.d.ts +31 -0
  21. package/dist/lib/client-factory.js +63 -0
  22. package/dist/lib/config.d.ts +2 -0
  23. package/dist/lib/config.js +11 -2
  24. package/dist/lib/credentials.js +10 -1
  25. package/dist/lib/dry-run/samples.d.ts +5 -0
  26. package/dist/lib/dry-run/samples.js +64 -0
  27. package/dist/lib/errors.d.ts +28 -1
  28. package/dist/lib/errors.js +40 -0
  29. package/dist/lib/failing-fe-resolver.d.ts +15 -0
  30. package/dist/lib/failing-fe-resolver.js +49 -1
  31. package/dist/lib/flaky.d.ts +80 -0
  32. package/dist/lib/flaky.js +76 -0
  33. package/dist/lib/http.d.ts +73 -1
  34. package/dist/lib/http.js +327 -135
  35. package/dist/lib/interrupt.d.ts +116 -0
  36. package/dist/lib/interrupt.js +182 -0
  37. package/dist/lib/junit-report.d.ts +58 -0
  38. package/dist/lib/junit-report.js +210 -0
  39. package/dist/lib/output.d.ts +16 -1
  40. package/dist/lib/output.js +24 -2
  41. package/dist/lib/pagination.d.ts +4 -3
  42. package/dist/lib/pagination.js +34 -6
  43. package/dist/lib/poll.d.ts +11 -0
  44. package/dist/lib/poll.js +70 -5
  45. package/dist/lib/prompt.js +52 -8
  46. package/dist/lib/proxy.d.ts +29 -0
  47. package/dist/lib/proxy.js +30 -0
  48. package/dist/lib/render-error.js +3 -1
  49. package/dist/lib/runs.types.d.ts +9 -0
  50. package/dist/lib/skill-nudge.d.ts +2 -2
  51. package/dist/lib/skill-nudge.js +13 -4
  52. package/dist/lib/target-url.js +8 -1
  53. package/dist/lib/ticker.d.ts +11 -1
  54. package/dist/lib/ticker.js +33 -1
  55. package/dist/lib/update-check.d.ts +67 -0
  56. package/dist/lib/update-check.js +246 -0
  57. package/dist/lib/v3-advisory.d.ts +13 -0
  58. package/dist/lib/v3-advisory.js +24 -0
  59. package/dist/lib/version-notice.d.ts +37 -0
  60. package/dist/lib/version-notice.js +87 -0
  61. package/dist/version-guard.d.ts +33 -0
  62. package/dist/version-guard.js +39 -0
  63. package/dist/version.d.ts +1 -1
  64. package/dist/version.js +1 -1
  65. package/package.json +3 -2
  66. package/skills/testsprite-onboard.skill.md +21 -0
  67. package/skills/testsprite-verify.codex.md +6 -0
  68. package/skills/testsprite-verify.skill.md +48 -4
@@ -0,0 +1,49 @@
1
+ /**
2
+ * `testsprite doctor` — one-shot environment diagnostic.
3
+ *
4
+ * Runs a fixed checklist (CLI version, Node.js runtime, active profile, API
5
+ * endpoint, credentials, live connectivity + key validity, and whether the
6
+ * verify skill is installed in the current project) and prints an OK/WARN/FAIL
7
+ * report. Exits non-zero when any check FAILS so it can gate a CI step or an
8
+ * agent preflight (`testsprite doctor && testsprite test run ...`). Warnings
9
+ * (e.g. skill not installed) do not fail the process.
10
+ *
11
+ * Every check is reused from the same helpers the real commands use, so the
12
+ * report reflects exactly what a subsequent command would resolve: `loadConfig`
13
+ * for profile/endpoint/key, `assertValidEndpointUrl` for the endpoint gate,
14
+ * `makeHttpClient` + `GET /me` for connectivity, and `isVerifySkillInstalled`
15
+ * for the skill check.
16
+ */
17
+ import { Command } from 'commander';
18
+ import { type CommonOptions as FactoryCommonOptions } from '../lib/client-factory.js';
19
+ import type { FetchImpl } from '../lib/http.js';
20
+ export type DoctorStatus = 'ok' | 'warn' | 'fail';
21
+ export interface DoctorCheck {
22
+ /** Short, stable label (also the JSON key-ish name). */
23
+ name: string;
24
+ status: DoctorStatus;
25
+ /** Human-readable one-line result. Never contains the API key. */
26
+ detail: string;
27
+ }
28
+ export interface DoctorReport {
29
+ checks: DoctorCheck[];
30
+ failures: number;
31
+ warnings: number;
32
+ }
33
+ export interface DoctorDeps {
34
+ env?: NodeJS.ProcessEnv;
35
+ credentialsPath?: string;
36
+ fetchImpl?: FetchImpl;
37
+ stdout?: (line: string) => void;
38
+ stderr?: (line: string) => void;
39
+ /** Project dir for the skill check. Defaults to `process.cwd()`. */
40
+ cwd?: string;
41
+ /** Runtime version string (e.g. "22.9.0"). Defaults to `process.versions.node`. */
42
+ nodeVersion?: string;
43
+ existsSync?: (p: string) => boolean;
44
+ readFileSync?: (p: string) => string;
45
+ }
46
+ type CommonOptions = FactoryCommonOptions;
47
+ export declare function runDoctor(opts: CommonOptions, deps?: DoctorDeps): Promise<DoctorReport>;
48
+ export declare function createDoctorCommand(deps?: DoctorDeps): Command;
49
+ export {};
@@ -0,0 +1,233 @@
1
+ /**
2
+ * `testsprite doctor` — one-shot environment diagnostic.
3
+ *
4
+ * Runs a fixed checklist (CLI version, Node.js runtime, active profile, API
5
+ * endpoint, credentials, live connectivity + key validity, and whether the
6
+ * verify skill is installed in the current project) and prints an OK/WARN/FAIL
7
+ * report. Exits non-zero when any check FAILS so it can gate a CI step or an
8
+ * agent preflight (`testsprite doctor && testsprite test run ...`). Warnings
9
+ * (e.g. skill not installed) do not fail the process.
10
+ *
11
+ * Every check is reused from the same helpers the real commands use, so the
12
+ * report reflects exactly what a subsequent command would resolve: `loadConfig`
13
+ * for profile/endpoint/key, `assertValidEndpointUrl` for the endpoint gate,
14
+ * `makeHttpClient` + `GET /me` for connectivity, and `isVerifySkillInstalled`
15
+ * for the skill check.
16
+ */
17
+ import { Command } from 'commander';
18
+ import { assertValidEndpointUrl, makeHttpClient, } from '../lib/client-factory.js';
19
+ import { loadConfig } from '../lib/config.js';
20
+ import { ApiError, CLIError, localValidationError } from '../lib/errors.js';
21
+ import { GLOBAL_OPTS_HINT, Output } from '../lib/output.js';
22
+ import { isVerifySkillInstalled } from '../lib/skill-nudge.js';
23
+ import { emitV3RoutingAdvisory, routingLabel } from '../lib/v3-advisory.js';
24
+ import { VERSION } from '../version.js';
25
+ import { MIN_SUPPORTED_NODE_MAJOR, shouldRejectNodeVersion } from '../version-guard.js';
26
+ export async function runDoctor(opts, deps = {}) {
27
+ const out = makeOutput(opts.output, deps);
28
+ const env = deps.env ?? process.env;
29
+ const cwd = deps.cwd ?? process.cwd();
30
+ const nodeVersion = deps.nodeVersion ?? process.versions.node;
31
+ const config = loadConfig({
32
+ profile: opts.profile,
33
+ endpointUrl: opts.endpointUrl,
34
+ env,
35
+ credentialsPath: deps.credentialsPath,
36
+ });
37
+ const endpointCheck = checkEndpoint(config.apiUrl);
38
+ const hasKey = Boolean(config.apiKey);
39
+ const stderr = deps.stderr ?? ((line) => process.stderr.write(`${line}\n`));
40
+ const connectivity = await checkConnectivity(opts, deps, {
41
+ hasKey,
42
+ endpointOk: endpointCheck.status === 'ok',
43
+ });
44
+ const checks = [
45
+ { name: 'CLI version', status: 'ok', detail: VERSION },
46
+ checkNodeVersion(nodeVersion),
47
+ { name: 'Profile', status: 'ok', detail: config.profile },
48
+ endpointCheck,
49
+ checkCredentials(hasKey, config.profile, opts.dryRun ?? false),
50
+ connectivity.check,
51
+ ];
52
+ // Informational routing line, only when the backend reported it (no new call).
53
+ if (connectivity.v3Enabled !== undefined) {
54
+ const label = routingLabel(connectivity.v3Enabled);
55
+ checks.push({
56
+ name: 'Routing',
57
+ status: 'ok',
58
+ detail: connectivity.v3Enabled === true
59
+ ? `${label} (V3 execution routing is ON)`
60
+ : `${label} (default routing)`,
61
+ });
62
+ }
63
+ checks.push(checkSkill(cwd, deps));
64
+ const failures = checks.filter(check => check.status === 'fail').length;
65
+ const warnings = checks.filter(check => check.status === 'warn').length;
66
+ const report = { checks, failures, warnings };
67
+ out.print(report, () => renderDoctor(report));
68
+ if (connectivity.v3Enabled === true) {
69
+ emitV3RoutingAdvisory(stderr);
70
+ }
71
+ if (failures > 0) {
72
+ // Non-zero exit so `testsprite doctor && ...` gates a CI step or an agent
73
+ // preflight. The full report already printed above; this line is the stderr
74
+ // summary index.ts renders before exiting 1.
75
+ throw new CLIError(`doctor: ${failures} check(s) failed, ${warnings} warning(s)`, 1);
76
+ }
77
+ return report;
78
+ }
79
+ function checkNodeVersion(nodeVersion) {
80
+ // Reuse the CLI's own runtime guard so the verdict matches exactly what the
81
+ // entrypoint enforces at startup, rather than a divergent hardcoded check.
82
+ // The precise engines floor (20.19+/22.13+/24+) is enforced by npm at install
83
+ // time via .npmrc engine-strict. sourceRef: src/version-guard.ts.
84
+ const rejected = shouldRejectNodeVersion(nodeVersion);
85
+ return {
86
+ name: 'Node.js',
87
+ status: rejected ? 'fail' : 'ok',
88
+ detail: rejected
89
+ ? `v${nodeVersion} is below the required Node ${MIN_SUPPORTED_NODE_MAJOR}; upgrade Node.js`
90
+ : `v${nodeVersion} (>=${MIN_SUPPORTED_NODE_MAJOR} required)`,
91
+ };
92
+ }
93
+ function checkEndpoint(apiUrl) {
94
+ try {
95
+ assertValidEndpointUrl(apiUrl);
96
+ return { name: 'API endpoint', status: 'ok', detail: apiUrl };
97
+ }
98
+ catch {
99
+ return {
100
+ name: 'API endpoint',
101
+ status: 'fail',
102
+ detail: `"${apiUrl}" is not a valid http(s) URL`,
103
+ };
104
+ }
105
+ }
106
+ function checkCredentials(hasKey, profile, dryRun) {
107
+ if (hasKey) {
108
+ // Never print any part of the key (security). Confirm presence only.
109
+ return {
110
+ name: 'Credentials',
111
+ status: 'ok',
112
+ detail: `API key configured (profile "${profile}")`,
113
+ };
114
+ }
115
+ // Under --dry-run no key is expected, so a missing key is not a failure.
116
+ return {
117
+ name: 'Credentials',
118
+ status: dryRun ? 'warn' : 'fail',
119
+ detail: dryRun
120
+ ? 'no API key (not needed under --dry-run)'
121
+ : 'no API key found; run `testsprite setup` (or set TESTSPRITE_API_KEY)',
122
+ };
123
+ }
124
+ function checkSkill(cwd, deps) {
125
+ const installed = isVerifySkillInstalled(cwd, {
126
+ existsSync: deps.existsSync,
127
+ readFileSync: deps.readFileSync,
128
+ });
129
+ return {
130
+ name: 'Verify skill',
131
+ status: installed ? 'ok' : 'warn',
132
+ detail: installed
133
+ ? 'installed in this project'
134
+ : 'not installed here; run `testsprite setup` so your agent verifies its changes',
135
+ };
136
+ }
137
+ async function checkConnectivity(opts, deps, ctx) {
138
+ const name = 'Connectivity';
139
+ if (opts.dryRun)
140
+ return { check: { name, status: 'warn', detail: 'skipped under --dry-run' } };
141
+ if (!ctx.hasKey)
142
+ return { check: { name, status: 'warn', detail: 'skipped; no API key to test with' } };
143
+ if (!ctx.endpointOk)
144
+ return { check: { name, status: 'warn', detail: 'skipped; endpoint URL is invalid' } };
145
+ try {
146
+ const client = makeHttpClient(opts, {
147
+ env: deps.env,
148
+ credentialsPath: deps.credentialsPath,
149
+ fetchImpl: deps.fetchImpl,
150
+ stderr: deps.stderr,
151
+ });
152
+ const me = await client.get('/me');
153
+ const who = me.userId ? ` (userId ${me.userId})` : '';
154
+ return {
155
+ check: { name, status: 'ok', detail: `reached GET /me, API key accepted${who}` },
156
+ v3Enabled: me.v3Enabled,
157
+ };
158
+ }
159
+ catch (error) {
160
+ if (error instanceof ApiError) {
161
+ if (error.code === 'AUTH_REQUIRED' ||
162
+ error.code === 'AUTH_INVALID' ||
163
+ error.code === 'AUTH_FORBIDDEN') {
164
+ return { check: { name, status: 'fail', detail: `API key rejected (${error.code})` } };
165
+ }
166
+ return { check: { name, status: 'fail', detail: `GET /me failed (${error.code})` } };
167
+ }
168
+ return {
169
+ check: {
170
+ name,
171
+ status: 'fail',
172
+ detail: `GET /me failed (${error instanceof Error ? error.message : String(error)})`,
173
+ },
174
+ };
175
+ }
176
+ }
177
+ const STATUS_LABEL = {
178
+ ok: '[OK] ',
179
+ warn: '[WARN]',
180
+ fail: '[FAIL]',
181
+ };
182
+ function renderDoctor(report) {
183
+ const nameWidth = Math.max(...report.checks.map(check => check.name.length));
184
+ const lines = ['TestSprite doctor', ''];
185
+ for (const check of report.checks) {
186
+ lines.push(` ${STATUS_LABEL[check.status]} ${check.name.padEnd(nameWidth)} ${check.detail}`);
187
+ }
188
+ lines.push('');
189
+ lines.push(report.failures === 0 && report.warnings === 0
190
+ ? 'All checks passed.'
191
+ : `${report.failures} failure(s), ${report.warnings} warning(s).`);
192
+ return lines.join('\n');
193
+ }
194
+ export function createDoctorCommand(deps = {}) {
195
+ const cmd = new Command('doctor')
196
+ .description('Diagnose CLI setup: version, Node, profile, endpoint, credentials, connectivity, skill')
197
+ .addHelpText('after', GLOBAL_OPTS_HINT)
198
+ .addHelpText('after', '\nExamples:\n' +
199
+ ' testsprite doctor # run all checks (exit 1 if any fails)\n' +
200
+ ' testsprite doctor --output json # machine-readable report\n' +
201
+ ' testsprite doctor && testsprite test run <id> # gate a command on a healthy setup')
202
+ .action(async (_cmdOpts, command) => {
203
+ await runDoctor(resolveCommonOptions(command), deps);
204
+ });
205
+ return cmd;
206
+ }
207
+ function resolveCommonOptions(command) {
208
+ const globals = command.optsWithGlobals();
209
+ return {
210
+ profile: globals.profile ?? 'default',
211
+ output: globals.output ?? 'text',
212
+ endpointUrl: globals.endpointUrl,
213
+ debug: globals.debug ?? false,
214
+ verbose: globals.verbose ?? false,
215
+ dryRun: globals.dryRun ?? false,
216
+ requestTimeoutMs: parseRequestTimeoutFlag(globals.requestTimeout),
217
+ };
218
+ }
219
+ function parseRequestTimeoutFlag(raw) {
220
+ if (raw === undefined)
221
+ return undefined;
222
+ const seconds = Number(raw);
223
+ if (!Number.isFinite(seconds) || seconds <= 0) {
224
+ // Match the other commands: a malformed --request-timeout is a validation
225
+ // error, not a silently-ignored default.
226
+ throw localValidationError('request-timeout', `must be a positive number of seconds (got "${raw}")`);
227
+ }
228
+ return Math.round(seconds * 1000);
229
+ }
230
+ function makeOutput(mode, deps) {
231
+ return new Output(mode, { stdout: deps.stdout, stderr: deps.stderr });
232
+ }
233
+ //# sourceMappingURL=doctor.js.map
@@ -10,7 +10,7 @@
10
10
  * Hard constraint: orchestrate existing exported primitives; never fork them.
11
11
  */
12
12
  import { Command } from 'commander';
13
- import type { CommonOptions as FactoryCommonOptions } from '../lib/client-factory.js';
13
+ import { type CommonOptions as FactoryCommonOptions } from '../lib/client-factory.js';
14
14
  import type { AuthDeps } from './auth.js';
15
15
  import type { AgentFs } from './agent.js';
16
16
  import type { FetchImpl } from '../lib/http.js';
@@ -10,9 +10,11 @@
10
10
  * Hard constraint: orchestrate existing exported primitives; never fork them.
11
11
  */
12
12
  import { Command } from 'commander';
13
+ import { parseRequestTimeoutFlag, } from '../lib/client-factory.js';
14
+ import { normalizeEnvVar } from '../lib/config.js';
13
15
  import { emitDeprecationNotice } from '../lib/deprecate.js';
14
16
  import { CLIError } from '../lib/errors.js';
15
- import { GLOBAL_OPTS_HINT, Output } from '../lib/output.js';
17
+ import { GLOBAL_OPTS_HINT, Output, resolveOutputMode } from '../lib/output.js';
16
18
  import { runConfigure, runWhoami } from './auth.js';
17
19
  import { runInstall } from './agent.js';
18
20
  import { TARGETS, DEFAULT_SKILLS } from '../lib/agent-targets.js';
@@ -29,7 +31,7 @@ const DEFAULT_API_URL = 'https://api.testsprite.com';
29
31
  */
30
32
  function resolveReportedEndpoint(opts, deps) {
31
33
  const env = deps.env ?? process.env;
32
- const envApiUrl = env.TESTSPRITE_API_URL?.trim() || undefined;
34
+ const envApiUrl = normalizeEnvVar(env.TESTSPRITE_API_URL);
33
35
  let existing;
34
36
  try {
35
37
  existing = readProfile(opts.profile, { path: deps.credentialsPath })?.apiUrl;
@@ -298,10 +300,26 @@ function renderInitText(data) {
298
300
  }
299
301
  lines.push('');
300
302
  lines.push('Next steps:');
301
- lines.push(' testsprite test list # list tests in the current project');
302
- lines.push(' testsprite agent list # check installed agent targets');
303
+ lines.push(' # 1. Create your first project (frontend example) — prints a projectId');
304
+ lines.push(' testsprite project create --type frontend --name "My App" --url https://your-app.com');
305
+ lines.push('');
303
306
  if (s.agent) {
304
- lines.push(' testsprite agent install --target=<t> # re-install or install additional targets');
307
+ lines.push(' # 2. Generate tests: ask your coding agent (the testsprite-onboard skill is installed),');
308
+ lines.push(' # or create one yourself, then run them (use the projectId from step 1):');
309
+ lines.push(' testsprite test run --all --project <projectId>');
310
+ lines.push('');
311
+ lines.push(' # Manage installed agent skills');
312
+ lines.push(' testsprite agent list');
313
+ lines.push(' testsprite agent install --target=<t> # re-install or install additional targets');
314
+ }
315
+ else {
316
+ lines.push(' # 2. Create a test, then run it (use the projectId from step 1):');
317
+ lines.push(' testsprite test create --project <projectId> ...');
318
+ lines.push(' testsprite test run --all --project <projectId>');
319
+ lines.push(' # Tip: `testsprite agent install` sets up the onboarding skill for your coding agent');
320
+ lines.push('');
321
+ lines.push(' # Manage installed agent skills');
322
+ lines.push(' testsprite agent list');
305
323
  }
306
324
  return lines.join('\n');
307
325
  }
@@ -312,7 +330,7 @@ function resolveCommonOptions(command) {
312
330
  const globals = command.optsWithGlobals();
313
331
  return {
314
332
  profile: globals.profile ?? 'default',
315
- output: globals.output ?? 'text',
333
+ output: resolveOutputMode(globals.output),
316
334
  endpointUrl: globals.endpointUrl,
317
335
  debug: globals.debug ?? false,
318
336
  verbose: globals.verbose ?? false,
@@ -320,14 +338,6 @@ function resolveCommonOptions(command) {
320
338
  requestTimeoutMs: parseRequestTimeoutFlag(globals.requestTimeout),
321
339
  };
322
340
  }
323
- function parseRequestTimeoutFlag(raw) {
324
- if (raw === undefined)
325
- return undefined;
326
- const n = Number(raw);
327
- if (!Number.isFinite(n) || n <= 0)
328
- return undefined;
329
- return Math.round(n * 1000);
330
- }
331
341
  const SETUP_DESCRIPTION = 'Set up TestSprite: configure your API key and install the TestSprite agent skills for your coding agent';
332
342
  /** Attach the onboarding flags shared by `setup` and the `init` alias. */
333
343
  function addSetupOptions(cmd, validTargets, defaultAgent) {
@@ -32,7 +32,6 @@ export interface CliCreateProjectRequest {
32
32
  type: 'frontend' | 'backend';
33
33
  name: string;
34
34
  targetUrl?: string;
35
- description?: string;
36
35
  username?: string;
37
36
  password?: string;
38
37
  instruction?: string;
@@ -63,10 +62,84 @@ interface UpdateOptions extends CommonOptions {
63
62
  username?: string;
64
63
  password?: string;
65
64
  passwordFile?: string;
66
- description?: string;
67
65
  instruction?: string;
68
66
  idempotencyKey?: string;
69
67
  }
70
68
  export declare function runUpdate(opts: UpdateOptions, deps?: ProjectDeps): Promise<CliUpdateProjectResponse>;
69
+ export interface CliDeleteProjectResponse {
70
+ projectId: string;
71
+ deletedAt: string;
72
+ }
73
+ interface DeleteOptions extends CommonOptions {
74
+ projectId: string;
75
+ /** Hard gate — required (unless `--dry-run` is set). No interactive prompts. */
76
+ confirm: boolean;
77
+ /** Caller-supplied idempotency token; UUIDv4 minted client-side if absent. */
78
+ idempotencyKey?: string;
79
+ }
80
+ /**
81
+ * `project delete <project-id> --confirm` — permanent cascade delete via
82
+ * DELETE /projects/{id}.
83
+ *
84
+ * The server deletes the project together with everything under it — its
85
+ * frontend/backend sub-projects, all their tests, and backend fixtures —
86
+ * matching the Portal's own delete behavior. There is no restore window.
87
+ *
88
+ * **`--confirm` is required** (unless `--dry-run`). Without either, the CLI
89
+ * exits 5 `VALIDATION_ERROR` with a typed envelope explaining the convention.
90
+ * The CLI never prompts interactively (CI-friendly contract). Re-delete on an already-deleted (or missing) project returns 404 from
91
+ * the server; the CLI surfaces the envelope as-is (exit 4), no client branching.
92
+ */
93
+ export declare function runDelete(opts: DeleteOptions, deps?: ProjectDeps): Promise<CliDeleteProjectResponse>;
94
+ export interface CliProjectCredentialResponse {
95
+ projectId: string;
96
+ authType: string;
97
+ rewroteCount: number;
98
+ }
99
+ interface CredentialOptions extends CommonOptions {
100
+ projectId: string;
101
+ authType: string;
102
+ credential?: string;
103
+ credentialFile?: string;
104
+ idempotencyKey?: string;
105
+ }
106
+ export declare function runCredential(opts: CredentialOptions, deps?: ProjectDeps): Promise<CliProjectCredentialResponse>;
107
+ export interface CliProjectAutoAuthResponse {
108
+ projectId: string;
109
+ enabled: boolean;
110
+ method: string;
111
+ inject: string;
112
+ /**
113
+ * Present when the server's trial refresh failed: `enabled` is then `false`
114
+ * and this carries the reason (e.g. a bad refresh token). The config is still
115
+ * stored, but auto-auth won't run until the login succeeds.
116
+ */
117
+ lastRefreshError?: string;
118
+ }
119
+ interface AutoAuthOptions extends CommonOptions {
120
+ projectId: string;
121
+ disable?: boolean;
122
+ method: string;
123
+ inject: string;
124
+ injectKey?: string;
125
+ loginUrl?: string;
126
+ loginMethod?: string;
127
+ loginContentType?: string;
128
+ loginBodyTemplate?: string;
129
+ username?: string;
130
+ password?: string;
131
+ passwordFile?: string;
132
+ tokenPath?: string;
133
+ tokenEndpoint?: string;
134
+ clientId?: string;
135
+ clientSecret?: string;
136
+ clientSecretFile?: string;
137
+ refreshToken?: string;
138
+ refreshTokenFile?: string;
139
+ scope?: string;
140
+ region?: string;
141
+ idempotencyKey?: string;
142
+ }
143
+ export declare function runAutoAuth(opts: AutoAuthOptions, deps?: ProjectDeps): Promise<CliProjectAutoAuthResponse>;
71
144
  export declare function createProjectCommand(deps?: ProjectDeps): Command;
72
145
  export {};