@respan/cli 0.7.3 → 0.8.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/commands/auth/logout.d.ts +1 -0
- package/dist/commands/auth/status.d.ts +1 -0
- package/dist/commands/auth/status.js +2 -1
- package/dist/commands/config/get.d.ts +1 -0
- package/dist/commands/config/get.js +5 -0
- package/dist/commands/config/list.d.ts +1 -0
- package/dist/commands/config/list.js +9 -2
- package/dist/commands/config/set.d.ts +1 -0
- package/dist/commands/config/set.js +4 -0
- package/dist/commands/datasets/add-spans.d.ts +1 -0
- package/dist/commands/datasets/create-span.d.ts +1 -0
- package/dist/commands/datasets/create.d.ts +1 -0
- package/dist/commands/datasets/get-span.d.ts +1 -0
- package/dist/commands/datasets/get.d.ts +1 -0
- package/dist/commands/datasets/list.d.ts +1 -0
- package/dist/commands/datasets/spans.d.ts +1 -0
- package/dist/commands/datasets/update.d.ts +1 -0
- package/dist/commands/evaluators/create.d.ts +1 -0
- package/dist/commands/evaluators/get.d.ts +1 -0
- package/dist/commands/evaluators/list.d.ts +1 -0
- package/dist/commands/evaluators/run.d.ts +1 -0
- package/dist/commands/evaluators/update.d.ts +1 -0
- package/dist/commands/experiments/create.d.ts +1 -0
- package/dist/commands/experiments/get.d.ts +1 -0
- package/dist/commands/experiments/list.d.ts +1 -0
- package/dist/commands/logs/create.d.ts +1 -0
- package/dist/commands/logs/get.d.ts +1 -0
- package/dist/commands/logs/list.d.ts +1 -0
- package/dist/commands/logs/summary.d.ts +1 -0
- package/dist/commands/prompts/create-version.d.ts +1 -0
- package/dist/commands/prompts/create.d.ts +1 -0
- package/dist/commands/prompts/get.d.ts +1 -0
- package/dist/commands/prompts/list.d.ts +1 -0
- package/dist/commands/prompts/update.d.ts +1 -0
- package/dist/commands/prompts/versions.d.ts +1 -0
- package/dist/commands/setup/doctor.d.ts +17 -0
- package/dist/commands/setup/doctor.js +224 -0
- package/dist/commands/setup/index.d.ts +45 -0
- package/dist/commands/setup/index.js +915 -0
- package/dist/commands/traces/get.d.ts +1 -0
- package/dist/commands/traces/list.d.ts +1 -0
- package/dist/commands/traces/summary.d.ts +1 -0
- package/dist/commands/users/create.d.ts +1 -0
- package/dist/commands/users/get.d.ts +1 -0
- package/dist/commands/users/list.d.ts +1 -0
- package/dist/commands/users/update.d.ts +1 -0
- package/dist/commands/whoami.d.ts +1 -0
- package/dist/commands/whoami.js +3 -2
- package/dist/lib/auth.d.ts +1 -0
- package/dist/lib/auth.js +16 -7
- package/dist/lib/base-command.d.ts +1 -0
- package/dist/lib/base-command.js +4 -0
- package/oclif.manifest.json +1062 -621
- package/package.json +1 -1
|
@@ -4,6 +4,7 @@ export default class AuthLogout extends BaseCommand {
|
|
|
4
4
|
static flags: {
|
|
5
5
|
profile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
6
6
|
'api-key': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
7
|
+
'base-url': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
7
8
|
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
8
9
|
csv: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
9
10
|
verbose: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
@@ -3,6 +3,7 @@ export default class AuthStatus extends BaseCommand {
|
|
|
3
3
|
static description: string;
|
|
4
4
|
static flags: {
|
|
5
5
|
'api-key': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
6
|
+
'base-url': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
6
7
|
profile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
7
8
|
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
8
9
|
csv: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
@@ -10,13 +10,14 @@ class AuthStatus extends BaseCommand {
|
|
|
10
10
|
this.log('Not authenticated. Run `respan auth login`.');
|
|
11
11
|
return;
|
|
12
12
|
}
|
|
13
|
+
const auth = this.getAuth();
|
|
13
14
|
this.log(`Profile: ${profile}`);
|
|
14
15
|
this.log(`Type: ${cred.type}`);
|
|
15
16
|
if (cred.type === 'api_key')
|
|
16
17
|
this.log(`API Key: ${cred.apiKey.slice(0, 8)}...`);
|
|
17
18
|
if (cred.type === 'jwt')
|
|
18
19
|
this.log(`Email: ${cred.email}`);
|
|
19
|
-
this.log(`Base URL: ${
|
|
20
|
+
this.log(`Base URL: ${auth.baseUrl}`);
|
|
20
21
|
}
|
|
21
22
|
}
|
|
22
23
|
AuthStatus.description = 'Show current authentication status';
|
|
@@ -6,6 +6,7 @@ export default class ConfigGet extends BaseCommand {
|
|
|
6
6
|
};
|
|
7
7
|
static flags: {
|
|
8
8
|
'api-key': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
9
|
+
'base-url': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
9
10
|
profile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
11
|
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
11
12
|
csv: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
@@ -5,6 +5,11 @@ class ConfigGet extends BaseCommand {
|
|
|
5
5
|
async run() {
|
|
6
6
|
const { args, flags } = await this.parse(ConfigGet);
|
|
7
7
|
this.globalFlags = flags;
|
|
8
|
+
const normalizedKey = args.key.toLowerCase();
|
|
9
|
+
if (['base_url', 'baseurl', 'api_base_url'].includes(normalizedKey)) {
|
|
10
|
+
this.log('CLI API base URLs are managed by `respan auth login --base-url ...` and can be temporarily overridden with `--base-url` on any command.');
|
|
11
|
+
return;
|
|
12
|
+
}
|
|
8
13
|
const value = getConfigValue(args.key);
|
|
9
14
|
this.log(value !== undefined ? String(value) : `Key "${args.key}" not set.`);
|
|
10
15
|
}
|
|
@@ -3,6 +3,7 @@ export default class ConfigList extends BaseCommand {
|
|
|
3
3
|
static description: string;
|
|
4
4
|
static flags: {
|
|
5
5
|
'api-key': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
6
|
+
'base-url': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
6
7
|
profile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
7
8
|
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
8
9
|
csv: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
@@ -9,8 +9,15 @@ class ConfigList extends BaseCommand {
|
|
|
9
9
|
const active = getActiveProfile();
|
|
10
10
|
this.log(`Active profile: ${active}`);
|
|
11
11
|
this.log(`Profiles: ${Object.keys(creds).join(', ') || '(none)'}`);
|
|
12
|
-
if (config.defaults)
|
|
13
|
-
|
|
12
|
+
if (config.defaults) {
|
|
13
|
+
const { base_url, baseUrl, api_base_url, ...remainingDefaults } = config.defaults;
|
|
14
|
+
if (Object.keys(remainingDefaults).length > 0) {
|
|
15
|
+
this.log(`Defaults: ${JSON.stringify(remainingDefaults)}`);
|
|
16
|
+
}
|
|
17
|
+
if (base_url || baseUrl || api_base_url) {
|
|
18
|
+
this.log('Note: stored `base_url` config is ignored for CLI API commands. Use `respan auth login --base-url ...` to save an endpoint, or `--base-url` for a temporary override.');
|
|
19
|
+
}
|
|
20
|
+
}
|
|
14
21
|
}
|
|
15
22
|
}
|
|
16
23
|
ConfigList.description = 'List all configuration';
|
|
@@ -7,6 +7,7 @@ export default class ConfigSet extends BaseCommand {
|
|
|
7
7
|
};
|
|
8
8
|
static flags: {
|
|
9
9
|
'api-key': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
|
+
'base-url': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
11
|
profile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
11
12
|
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
12
13
|
csv: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
@@ -5,6 +5,10 @@ class ConfigSet extends BaseCommand {
|
|
|
5
5
|
async run() {
|
|
6
6
|
const { args, flags } = await this.parse(ConfigSet);
|
|
7
7
|
this.globalFlags = flags;
|
|
8
|
+
const normalizedKey = args.key.toLowerCase();
|
|
9
|
+
if (['base_url', 'baseurl', 'api_base_url'].includes(normalizedKey)) {
|
|
10
|
+
this.error('CLI API base URLs are no longer managed with `respan config set`. Use `respan auth login --base-url ...` to save an endpoint, or `--base-url` on a command for a temporary override.', { exit: 1 });
|
|
11
|
+
}
|
|
8
12
|
setConfigValue(args.key, args.value);
|
|
9
13
|
this.log(`Set ${args.key} = ${args.value}`);
|
|
10
14
|
}
|
|
@@ -7,6 +7,7 @@ export default class DatasetsAddSpans extends BaseCommand {
|
|
|
7
7
|
static flags: {
|
|
8
8
|
'span-ids': import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
9
9
|
'api-key': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
|
+
'base-url': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
11
|
profile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
11
12
|
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
12
13
|
csv: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
@@ -7,6 +7,7 @@ export default class DatasetsCreateSpan extends BaseCommand {
|
|
|
7
7
|
static flags: {
|
|
8
8
|
body: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
9
9
|
'api-key': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
|
+
'base-url': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
11
|
profile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
11
12
|
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
12
13
|
csv: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
@@ -5,6 +5,7 @@ export default class DatasetsCreate extends BaseCommand {
|
|
|
5
5
|
name: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
6
6
|
description: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
7
7
|
'api-key': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
8
|
+
'base-url': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
8
9
|
profile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
9
10
|
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
10
11
|
csv: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
@@ -7,6 +7,7 @@ export default class DatasetsGetSpan extends BaseCommand {
|
|
|
7
7
|
};
|
|
8
8
|
static flags: {
|
|
9
9
|
'api-key': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
|
+
'base-url': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
11
|
profile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
11
12
|
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
12
13
|
csv: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
@@ -6,6 +6,7 @@ export default class DatasetsGet extends BaseCommand {
|
|
|
6
6
|
};
|
|
7
7
|
static flags: {
|
|
8
8
|
'api-key': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
9
|
+
'base-url': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
9
10
|
profile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
11
|
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
11
12
|
csv: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
@@ -5,6 +5,7 @@ export default class DatasetsList extends BaseCommand {
|
|
|
5
5
|
limit: import("@oclif/core/interfaces").OptionFlag<number, import("@oclif/core/interfaces").CustomOptions>;
|
|
6
6
|
page: import("@oclif/core/interfaces").OptionFlag<number, import("@oclif/core/interfaces").CustomOptions>;
|
|
7
7
|
'api-key': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
8
|
+
'base-url': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
8
9
|
profile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
9
10
|
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
10
11
|
csv: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
@@ -6,6 +6,7 @@ export default class DatasetsSpans extends BaseCommand {
|
|
|
6
6
|
};
|
|
7
7
|
static flags: {
|
|
8
8
|
'api-key': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
9
|
+
'base-url': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
9
10
|
profile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
11
|
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
11
12
|
csv: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
@@ -8,6 +8,7 @@ export default class DatasetsUpdate extends BaseCommand {
|
|
|
8
8
|
name: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
9
9
|
description: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
10
|
'api-key': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
11
|
+
'base-url': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
11
12
|
profile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
12
13
|
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
13
14
|
csv: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
@@ -7,6 +7,7 @@ export default class EvaluatorsCreate extends BaseCommand {
|
|
|
7
7
|
description: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
8
8
|
config: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
9
9
|
'api-key': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
|
+
'base-url': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
11
|
profile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
11
12
|
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
12
13
|
csv: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
@@ -6,6 +6,7 @@ export default class EvaluatorsGet extends BaseCommand {
|
|
|
6
6
|
};
|
|
7
7
|
static flags: {
|
|
8
8
|
'api-key': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
9
|
+
'base-url': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
9
10
|
profile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
11
|
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
11
12
|
csv: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
@@ -5,6 +5,7 @@ export default class EvaluatorsList extends BaseCommand {
|
|
|
5
5
|
limit: import("@oclif/core/interfaces").OptionFlag<number, import("@oclif/core/interfaces").CustomOptions>;
|
|
6
6
|
page: import("@oclif/core/interfaces").OptionFlag<number, import("@oclif/core/interfaces").CustomOptions>;
|
|
7
7
|
'api-key': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
8
|
+
'base-url': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
8
9
|
profile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
9
10
|
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
10
11
|
csv: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
@@ -9,6 +9,7 @@ export default class EvaluatorsRun extends BaseCommand {
|
|
|
9
9
|
'log-ids': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
10
|
params: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
11
11
|
'api-key': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
12
|
+
'base-url': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
12
13
|
profile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
13
14
|
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
14
15
|
csv: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
@@ -9,6 +9,7 @@ export default class EvaluatorsUpdate extends BaseCommand {
|
|
|
9
9
|
description: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
10
|
config: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
11
11
|
'api-key': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
12
|
+
'base-url': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
12
13
|
profile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
13
14
|
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
14
15
|
csv: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
@@ -7,6 +7,7 @@ export default class ExperimentsCreate extends BaseCommand {
|
|
|
7
7
|
description: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
8
8
|
workflows: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
9
9
|
'api-key': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
|
+
'base-url': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
11
|
profile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
11
12
|
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
12
13
|
csv: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
@@ -6,6 +6,7 @@ export default class ExperimentsGet extends BaseCommand {
|
|
|
6
6
|
};
|
|
7
7
|
static flags: {
|
|
8
8
|
'api-key': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
9
|
+
'base-url': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
9
10
|
profile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
11
|
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
11
12
|
csv: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
@@ -5,6 +5,7 @@ export default class ExperimentsList extends BaseCommand {
|
|
|
5
5
|
limit: import("@oclif/core/interfaces").OptionFlag<number, import("@oclif/core/interfaces").CustomOptions>;
|
|
6
6
|
page: import("@oclif/core/interfaces").OptionFlag<number, import("@oclif/core/interfaces").CustomOptions>;
|
|
7
7
|
'api-key': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
8
|
+
'base-url': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
8
9
|
profile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
9
10
|
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
10
11
|
csv: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
@@ -7,6 +7,7 @@ export default class LogsCreate extends BaseCommand {
|
|
|
7
7
|
model: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
8
8
|
metadata: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
9
9
|
'api-key': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
|
+
'base-url': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
11
|
profile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
11
12
|
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
12
13
|
csv: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
@@ -6,6 +6,7 @@ export default class LogsGet extends BaseCommand {
|
|
|
6
6
|
};
|
|
7
7
|
static flags: {
|
|
8
8
|
'api-key': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
9
|
+
'base-url': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
9
10
|
profile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
11
|
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
11
12
|
csv: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
@@ -12,6 +12,7 @@ export default class LogsList extends BaseCommand {
|
|
|
12
12
|
'is-test': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
13
13
|
'include-fields': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
14
14
|
'api-key': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
15
|
+
'base-url': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
15
16
|
profile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
16
17
|
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
17
18
|
csv: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
@@ -8,6 +8,7 @@ export default class LogsSummary extends BaseCommand {
|
|
|
8
8
|
'all-envs': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
9
9
|
'is-test': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
10
|
'api-key': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
11
|
+
'base-url': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
11
12
|
profile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
12
13
|
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
13
14
|
csv: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
@@ -10,6 +10,7 @@ export default class PromptsCreateVersion extends BaseCommand {
|
|
|
10
10
|
temperature: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
11
11
|
'max-tokens': import("@oclif/core/interfaces").OptionFlag<number | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
12
12
|
'api-key': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
13
|
+
'base-url': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
13
14
|
profile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
14
15
|
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
15
16
|
csv: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
@@ -5,6 +5,7 @@ export default class PromptsCreate extends BaseCommand {
|
|
|
5
5
|
name: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
6
6
|
description: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
7
7
|
'api-key': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
8
|
+
'base-url': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
8
9
|
profile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
9
10
|
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
10
11
|
csv: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
@@ -6,6 +6,7 @@ export default class PromptsGet extends BaseCommand {
|
|
|
6
6
|
};
|
|
7
7
|
static flags: {
|
|
8
8
|
'api-key': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
9
|
+
'base-url': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
9
10
|
profile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
11
|
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
11
12
|
csv: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
@@ -4,6 +4,7 @@ export default class PromptsList extends BaseCommand {
|
|
|
4
4
|
static flags: {
|
|
5
5
|
limit: import("@oclif/core/interfaces").OptionFlag<number, import("@oclif/core/interfaces").CustomOptions>;
|
|
6
6
|
'api-key': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
7
|
+
'base-url': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
7
8
|
profile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
8
9
|
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
9
10
|
csv: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
@@ -8,6 +8,7 @@ export default class PromptsUpdate extends BaseCommand {
|
|
|
8
8
|
name: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
9
9
|
description: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
10
|
'api-key': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
11
|
+
'base-url': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
11
12
|
profile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
12
13
|
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
13
14
|
csv: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
@@ -6,6 +6,7 @@ export default class PromptsVersions extends BaseCommand {
|
|
|
6
6
|
};
|
|
7
7
|
static flags: {
|
|
8
8
|
'api-key': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
9
|
+
'base-url': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
9
10
|
profile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
11
|
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
11
12
|
csv: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { BaseCommand } from '../../lib/base-command.js';
|
|
2
|
+
export default class SetupDoctor extends BaseCommand {
|
|
3
|
+
static description: string;
|
|
4
|
+
static examples: string[];
|
|
5
|
+
static flags: {
|
|
6
|
+
local: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
7
|
+
global: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
8
|
+
'api-key': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
9
|
+
'base-url': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
|
+
profile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
11
|
+
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
12
|
+
csv: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
13
|
+
verbose: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
14
|
+
};
|
|
15
|
+
run(): Promise<void>;
|
|
16
|
+
private isBinaryInstalled;
|
|
17
|
+
}
|
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
import * as fs from 'node:fs';
|
|
2
|
+
import * as path from 'node:path';
|
|
3
|
+
import * as os from 'node:os';
|
|
4
|
+
import { execSync } from 'node:child_process';
|
|
5
|
+
import { Flags } from '@oclif/core';
|
|
6
|
+
import { BaseCommand } from '../../lib/base-command.js';
|
|
7
|
+
import { findProjectRoot, expandHome, readTextFile } from '../../lib/integrate.js';
|
|
8
|
+
const GREEN = '\x1b[32m';
|
|
9
|
+
const RED = '\x1b[31m';
|
|
10
|
+
const YELLOW = '\x1b[33m';
|
|
11
|
+
const DIM = '\x1b[2m';
|
|
12
|
+
const BOLD = '\x1b[1m';
|
|
13
|
+
const RESET = '\x1b[0m';
|
|
14
|
+
class SetupDoctor extends BaseCommand {
|
|
15
|
+
async run() {
|
|
16
|
+
const { flags } = await this.parse(SetupDoctor);
|
|
17
|
+
this.globalFlags = flags;
|
|
18
|
+
const projectRoot = findProjectRoot();
|
|
19
|
+
const home = os.homedir();
|
|
20
|
+
const checkGlobal = flags.global || !flags.local;
|
|
21
|
+
const checkLocal = flags.local || !flags.global;
|
|
22
|
+
this.log('');
|
|
23
|
+
this.log(` ${BOLD}Respan Setup Doctor${RESET}`);
|
|
24
|
+
this.log('');
|
|
25
|
+
// ── 1. API Key ─────────────────────────────────────────────────
|
|
26
|
+
this.log(` ${BOLD}API Key${RESET}`);
|
|
27
|
+
const envPath = path.join(projectRoot, '.env');
|
|
28
|
+
const envContent = readTextFile(envPath);
|
|
29
|
+
const hasApiKey = /^RESPAN_API_KEY=.+$/m.test(envContent);
|
|
30
|
+
const hasEnvVar = !!process.env.RESPAN_API_KEY;
|
|
31
|
+
if (hasApiKey) {
|
|
32
|
+
this.log(` ${GREEN}\u2713${RESET} Found in ${DIM}${envPath}${RESET}`);
|
|
33
|
+
}
|
|
34
|
+
else {
|
|
35
|
+
this.log(` ${RED}\u2717${RESET} Not found in ${DIM}${envPath}${RESET}`);
|
|
36
|
+
}
|
|
37
|
+
if (hasEnvVar) {
|
|
38
|
+
this.log(` ${GREEN}\u2713${RESET} RESPAN_API_KEY environment variable is set`);
|
|
39
|
+
}
|
|
40
|
+
if (!hasApiKey && !hasEnvVar) {
|
|
41
|
+
this.log(` ${YELLOW}!${RESET} Run ${DIM}respan setup${RESET} to configure your API key`);
|
|
42
|
+
}
|
|
43
|
+
this.log('');
|
|
44
|
+
// ── 2. Respan CLI ──────────────────────────────────────────────
|
|
45
|
+
this.log(` ${BOLD}Respan CLI${RESET}`);
|
|
46
|
+
const respanInstalled = this.isBinaryInstalled('respan');
|
|
47
|
+
if (respanInstalled) {
|
|
48
|
+
try {
|
|
49
|
+
const version = execSync('respan --version', { encoding: 'utf-8', stdio: ['pipe', 'pipe', 'pipe'] }).trim();
|
|
50
|
+
this.log(` ${GREEN}\u2713${RESET} Installed ${DIM}(${version})${RESET}`);
|
|
51
|
+
}
|
|
52
|
+
catch {
|
|
53
|
+
this.log(` ${GREEN}\u2713${RESET} Installed`);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
else {
|
|
57
|
+
this.log(` ${YELLOW}!${RESET} Not installed globally. Install with: ${DIM}npm install -g @respan/cli${RESET}`);
|
|
58
|
+
}
|
|
59
|
+
this.log('');
|
|
60
|
+
// ── 3. Agent checks ────────────────────────────────────────────
|
|
61
|
+
this.log(` ${BOLD}Coding Agents${RESET}`);
|
|
62
|
+
this.log('');
|
|
63
|
+
const tools = {
|
|
64
|
+
'claude-code': {
|
|
65
|
+
binary: 'claude',
|
|
66
|
+
name: 'Claude Code',
|
|
67
|
+
globalConfigs: ['~/.claude/settings.json'],
|
|
68
|
+
localConfigs: ['.claude/settings.local.json'],
|
|
69
|
+
globalSkills: ['~/.claude/skills/respan/SKILL.md', '~/.agents/skills/respan/SKILL.md'],
|
|
70
|
+
localSkills: ['.claude/skills/respan/SKILL.md', '.agents/skills/respan/SKILL.md'],
|
|
71
|
+
},
|
|
72
|
+
'cursor': {
|
|
73
|
+
binary: 'cursor',
|
|
74
|
+
name: 'Cursor',
|
|
75
|
+
globalConfigs: ['~/.cursor/rules'],
|
|
76
|
+
localConfigs: ['.cursor/rules'],
|
|
77
|
+
globalSkills: ['~/.cursor/skills/respan/SKILL.md', '~/.agents/skills/respan/SKILL.md'],
|
|
78
|
+
localSkills: ['.cursor/skills/respan/SKILL.md', '.agents/skills/respan/SKILL.md'],
|
|
79
|
+
},
|
|
80
|
+
'codex-cli': {
|
|
81
|
+
binary: 'codex',
|
|
82
|
+
name: 'Codex CLI',
|
|
83
|
+
globalConfigs: ['~/.codex/config.toml'],
|
|
84
|
+
localConfigs: ['.codex/respan.json'],
|
|
85
|
+
globalSkills: ['~/.codex/skills/respan/SKILL.md', '~/.agents/skills/respan/SKILL.md'],
|
|
86
|
+
localSkills: ['.codex/skills/respan/SKILL.md', '.agents/skills/respan/SKILL.md'],
|
|
87
|
+
},
|
|
88
|
+
'gemini-cli': {
|
|
89
|
+
binary: 'gemini',
|
|
90
|
+
name: 'Gemini CLI',
|
|
91
|
+
globalConfigs: ['~/.gemini/settings.json'],
|
|
92
|
+
localConfigs: ['.gemini/settings.json'],
|
|
93
|
+
globalSkills: ['~/.gemini/skills/respan/SKILL.md', '~/.agents/skills/respan/SKILL.md'],
|
|
94
|
+
localSkills: ['.gemini/skills/respan/SKILL.md', '.agents/skills/respan/SKILL.md'],
|
|
95
|
+
},
|
|
96
|
+
'opencode': {
|
|
97
|
+
binary: 'opencode',
|
|
98
|
+
name: 'OpenCode',
|
|
99
|
+
globalConfigs: ['~/.config/opencode'],
|
|
100
|
+
localConfigs: ['.opencode'],
|
|
101
|
+
globalSkills: ['~/.config/opencode/skills/respan/SKILL.md', '~/.agents/skills/respan/SKILL.md'],
|
|
102
|
+
localSkills: ['.opencode/skills/respan/SKILL.md', '.agents/skills/respan/SKILL.md'],
|
|
103
|
+
},
|
|
104
|
+
};
|
|
105
|
+
for (const [id, tool] of Object.entries(tools)) {
|
|
106
|
+
const binaryFound = this.isBinaryInstalled(tool.binary);
|
|
107
|
+
this.log(` ${BOLD}${tool.name}${RESET} ${DIM}(${tool.binary})${RESET}`);
|
|
108
|
+
// Binary
|
|
109
|
+
if (binaryFound) {
|
|
110
|
+
this.log(` ${GREEN}\u2713${RESET} Binary found on PATH`);
|
|
111
|
+
}
|
|
112
|
+
else {
|
|
113
|
+
this.log(` ${DIM}\u2013${RESET} Binary not found`);
|
|
114
|
+
}
|
|
115
|
+
// Config
|
|
116
|
+
if (checkGlobal) {
|
|
117
|
+
for (const cfg of tool.globalConfigs) {
|
|
118
|
+
const resolved = expandHome(cfg);
|
|
119
|
+
if (fs.existsSync(resolved)) {
|
|
120
|
+
this.log(` ${GREEN}\u2713${RESET} Global config: ${DIM}${cfg}${RESET}`);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
if (checkLocal) {
|
|
125
|
+
for (const cfg of tool.localConfigs) {
|
|
126
|
+
const resolved = path.join(projectRoot, cfg);
|
|
127
|
+
if (fs.existsSync(resolved)) {
|
|
128
|
+
this.log(` ${GREEN}\u2713${RESET} Local config: ${DIM}${cfg}${RESET}`);
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
// Skills
|
|
133
|
+
let hasSkill = false;
|
|
134
|
+
if (checkGlobal) {
|
|
135
|
+
for (const skill of tool.globalSkills) {
|
|
136
|
+
const resolved = expandHome(skill);
|
|
137
|
+
if (fs.existsSync(resolved)) {
|
|
138
|
+
this.log(` ${GREEN}\u2713${RESET} Global skill: ${DIM}${skill}${RESET}`);
|
|
139
|
+
hasSkill = true;
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
if (checkLocal) {
|
|
144
|
+
for (const skill of tool.localSkills) {
|
|
145
|
+
const resolved = path.join(projectRoot, skill);
|
|
146
|
+
if (fs.existsSync(resolved)) {
|
|
147
|
+
this.log(` ${GREEN}\u2713${RESET} Local skill: ${DIM}${skill}${RESET}`);
|
|
148
|
+
hasSkill = true;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
if (binaryFound && !hasSkill) {
|
|
153
|
+
this.log(` ${YELLOW}!${RESET} No Respan setup skill installed. Run ${DIM}respan setup --agent ${id}${RESET}`);
|
|
154
|
+
}
|
|
155
|
+
this.log('');
|
|
156
|
+
}
|
|
157
|
+
// ── 4. SDK install docs ────────────────────────────────────────
|
|
158
|
+
this.log(` ${BOLD}SDK Install Docs${RESET}`);
|
|
159
|
+
const localDocsPath = path.join(projectRoot, '.respan', 'skills', 'sdk-install');
|
|
160
|
+
const globalDocsPath = expandHome('~/.respan/skills/sdk-install');
|
|
161
|
+
if (checkLocal && fs.existsSync(localDocsPath)) {
|
|
162
|
+
const files = fs.readdirSync(localDocsPath);
|
|
163
|
+
this.log(` ${GREEN}\u2713${RESET} Local: ${DIM}${localDocsPath}${RESET} (${files.length} files)`);
|
|
164
|
+
}
|
|
165
|
+
else if (checkLocal) {
|
|
166
|
+
this.log(` ${DIM}\u2013${RESET} No local SDK docs`);
|
|
167
|
+
}
|
|
168
|
+
if (checkGlobal && fs.existsSync(globalDocsPath)) {
|
|
169
|
+
const files = fs.readdirSync(globalDocsPath);
|
|
170
|
+
this.log(` ${GREEN}\u2713${RESET} Global: ${DIM}${globalDocsPath}${RESET} (${files.length} files)`);
|
|
171
|
+
}
|
|
172
|
+
else if (checkGlobal) {
|
|
173
|
+
this.log(` ${DIM}\u2013${RESET} No global SDK docs`);
|
|
174
|
+
}
|
|
175
|
+
this.log('');
|
|
176
|
+
// ── 5. Fetched docs ────────────────────────────────────────────
|
|
177
|
+
this.log(` ${BOLD}Documentation${RESET}`);
|
|
178
|
+
const localFetchedDocs = path.join(projectRoot, '.respan', 'skills', 'docs');
|
|
179
|
+
const globalFetchedDocs = expandHome('~/.respan/skills/docs');
|
|
180
|
+
if (checkLocal && fs.existsSync(localFetchedDocs)) {
|
|
181
|
+
const files = fs.readdirSync(localFetchedDocs);
|
|
182
|
+
this.log(` ${GREEN}\u2713${RESET} Local: ${DIM}${localFetchedDocs}${RESET} (${files.length} pages)`);
|
|
183
|
+
}
|
|
184
|
+
if (checkGlobal && fs.existsSync(globalFetchedDocs)) {
|
|
185
|
+
const files = fs.readdirSync(globalFetchedDocs);
|
|
186
|
+
this.log(` ${GREEN}\u2713${RESET} Global: ${DIM}${globalFetchedDocs}${RESET} (${files.length} pages)`);
|
|
187
|
+
}
|
|
188
|
+
if (checkLocal && !fs.existsSync(localFetchedDocs)) {
|
|
189
|
+
this.log(` ${DIM}\u2013${RESET} No local docs`);
|
|
190
|
+
}
|
|
191
|
+
if (checkGlobal && !fs.existsSync(globalFetchedDocs)) {
|
|
192
|
+
this.log(` ${DIM}\u2013${RESET} No global docs`);
|
|
193
|
+
}
|
|
194
|
+
this.log('');
|
|
195
|
+
}
|
|
196
|
+
isBinaryInstalled(binary) {
|
|
197
|
+
try {
|
|
198
|
+
execSync(`command -v ${binary}`, { stdio: 'pipe' });
|
|
199
|
+
return true;
|
|
200
|
+
}
|
|
201
|
+
catch {
|
|
202
|
+
return false;
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
SetupDoctor.description = 'Diagnose coding-agent setup for Respan';
|
|
207
|
+
SetupDoctor.examples = [
|
|
208
|
+
'respan setup doctor',
|
|
209
|
+
'respan setup doctor --global',
|
|
210
|
+
];
|
|
211
|
+
SetupDoctor.flags = {
|
|
212
|
+
...BaseCommand.baseFlags,
|
|
213
|
+
local: Flags.boolean({
|
|
214
|
+
description: 'Check local project setup',
|
|
215
|
+
default: false,
|
|
216
|
+
exclusive: ['global'],
|
|
217
|
+
}),
|
|
218
|
+
global: Flags.boolean({
|
|
219
|
+
description: 'Check global setup',
|
|
220
|
+
default: false,
|
|
221
|
+
exclusive: ['local'],
|
|
222
|
+
}),
|
|
223
|
+
};
|
|
224
|
+
export default SetupDoctor;
|