@pellux/goodvibes-tui 0.19.24 → 0.19.26
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/CHANGELOG.md +13 -0
- package/README.md +5 -5
- package/bin/goodvibes +10 -0
- package/bin/goodvibes-daemon +10 -0
- package/docs/foundation-artifacts/operator-contract.json +1 -1
- package/package.json +3 -2
- package/src/cli/bundle-command.ts +225 -0
- package/src/cli/completion.ts +90 -0
- package/src/cli/config-overrides.ts +159 -0
- package/src/cli/endpoints.ts +63 -0
- package/src/cli/entrypoint.ts +169 -0
- package/src/cli/help.ts +301 -0
- package/src/cli/index.ts +11 -0
- package/src/cli/management-commands.ts +426 -0
- package/src/cli/management.ts +719 -0
- package/src/cli/network-posture.ts +46 -0
- package/src/cli/package-verification.ts +119 -0
- package/src/cli/parser.ts +369 -0
- package/src/cli/provider-classification.ts +107 -0
- package/src/cli/redaction.ts +105 -0
- package/src/cli/service-command.ts +45 -0
- package/src/cli/service-posture.ts +247 -0
- package/src/cli/status.ts +382 -0
- package/src/cli/surface-command.ts +248 -0
- package/src/cli/tui-startup.ts +32 -0
- package/src/cli/types.ts +69 -0
- package/src/cli-flags.ts +18 -55
- package/src/config/index.ts +1 -1
- package/src/config/secrets.ts +44 -0
- package/src/daemon/cli.ts +62 -11
- package/src/input/command-registry.ts +3 -0
- package/src/input/commands/guidance-runtime.ts +9 -4
- package/src/input/commands/local-runtime.ts +21 -7
- package/src/input/commands/local-setup.ts +31 -38
- package/src/input/commands/onboarding-runtime.ts +14 -0
- package/src/input/commands/runtime-services.ts +9 -0
- package/src/input/commands.ts +2 -0
- package/src/input/feed-context-factory.ts +8 -1
- package/src/input/handler-feed.ts +13 -8
- package/src/input/handler-interactions.ts +266 -0
- package/src/input/handler-modal-stack.ts +23 -3
- package/src/input/handler-modal-token-routes.ts +23 -1
- package/src/input/handler-onboarding.ts +696 -0
- package/src/input/handler-picker-routes.ts +15 -7
- package/src/input/handler-ui-state.ts +58 -0
- package/src/input/handler.ts +120 -246
- package/src/input/onboarding/handler-onboarding-routes.ts +105 -0
- package/src/input/onboarding/onboarding-wizard-apply.ts +211 -0
- package/src/input/onboarding/onboarding-wizard-constants.ts +148 -0
- package/src/input/onboarding/onboarding-wizard-external-surfaces.ts +712 -0
- package/src/input/onboarding/onboarding-wizard-helpers.ts +218 -0
- package/src/input/onboarding/onboarding-wizard-rules.ts +224 -0
- package/src/input/onboarding/onboarding-wizard-state.ts +354 -0
- package/src/input/onboarding/onboarding-wizard-steps.ts +642 -0
- package/src/input/onboarding/onboarding-wizard-types.ts +170 -0
- package/src/input/onboarding/onboarding-wizard.ts +594 -0
- package/src/main.ts +32 -39
- package/src/panels/builtin/operations.ts +0 -10
- package/src/panels/index.ts +0 -1
- package/src/renderer/conversation-overlays.ts +6 -0
- package/src/renderer/help-overlay.ts +1 -1
- package/src/renderer/onboarding/onboarding-wizard.ts +533 -0
- package/src/runtime/bootstrap-core.ts +1 -0
- package/src/runtime/bootstrap.ts +123 -0
- package/src/runtime/onboarding/apply.ts +685 -0
- package/src/runtime/onboarding/derivation.ts +495 -0
- package/src/runtime/onboarding/index.ts +7 -0
- package/src/runtime/onboarding/markers.ts +161 -0
- package/src/runtime/onboarding/snapshot.ts +400 -0
- package/src/runtime/onboarding/state.ts +140 -0
- package/src/runtime/onboarding/types.ts +402 -0
- package/src/runtime/onboarding/verify.ts +233 -0
- package/src/runtime/ui-services.ts +16 -0
- package/src/shell/ui-openers.ts +12 -2
- package/src/version.ts +1 -1
- package/src/panels/welcome-panel.ts +0 -64
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
import { existsSync } from 'node:fs';
|
|
2
|
+
import { join } from 'node:path';
|
|
3
|
+
import { ConfigManager } from '../config/index.ts';
|
|
4
|
+
import { readOnboardingCompletionMarkers } from '../runtime/onboarding/index.ts';
|
|
5
|
+
import { GlobalNetworkTransportInstaller } from '@pellux/goodvibes-sdk/platform/runtime/network/index';
|
|
6
|
+
import { createShellPathService } from '@pellux/goodvibes-sdk/platform/runtime/shell-paths';
|
|
7
|
+
import { configureActivityLogger } from '@pellux/goodvibes-sdk/platform/utils/logger';
|
|
8
|
+
import {
|
|
9
|
+
applyRuntimeCommandEndpointFlagOverrides,
|
|
10
|
+
applyRuntimeConfigOverrides,
|
|
11
|
+
applyRuntimeConfigValue,
|
|
12
|
+
applyRuntimeFeatureFlagOverrides,
|
|
13
|
+
buildCliStatusSnapshot,
|
|
14
|
+
handleGoodVibesCliCommand,
|
|
15
|
+
parseGoodVibesCli,
|
|
16
|
+
renderCliStatus,
|
|
17
|
+
renderCompletion,
|
|
18
|
+
renderGoodVibesCommandHelp,
|
|
19
|
+
renderGoodVibesHelp,
|
|
20
|
+
renderGoodVibesVersion,
|
|
21
|
+
renderOnboardingCliStatus,
|
|
22
|
+
} from './index.ts';
|
|
23
|
+
import { buildCliServicePosture } from './service-posture.ts';
|
|
24
|
+
|
|
25
|
+
type ShellEntrypointOwnership = {
|
|
26
|
+
readonly workingDirectory: string;
|
|
27
|
+
readonly homeDirectory: string;
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
export type ShellEntrypointRoots = {
|
|
31
|
+
readonly defaultWorkingDirectory: string;
|
|
32
|
+
readonly homeDirectory: string;
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
export type PreparedShellCliRuntime = {
|
|
36
|
+
readonly cli: ReturnType<typeof parseGoodVibesCli>;
|
|
37
|
+
readonly configManager: ConfigManager;
|
|
38
|
+
readonly bootstrapWorkingDir: string;
|
|
39
|
+
readonly bootstrapHomeDirectory: string;
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
function resolveShellEntrypointOwnership(roots: ShellEntrypointRoots, workingDirOverride?: string): ShellEntrypointOwnership {
|
|
43
|
+
return {
|
|
44
|
+
workingDirectory: workingDirOverride ?? roots.defaultWorkingDirectory,
|
|
45
|
+
homeDirectory: roots.homeDirectory,
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export async function prepareShellCliRuntime(
|
|
50
|
+
argv: readonly string[],
|
|
51
|
+
roots: ShellEntrypointRoots,
|
|
52
|
+
binary = 'goodvibes',
|
|
53
|
+
): Promise<PreparedShellCliRuntime> {
|
|
54
|
+
const cli = parseGoodVibesCli(argv, binary);
|
|
55
|
+
|
|
56
|
+
if (cli.errors.length > 0) {
|
|
57
|
+
console.error(cli.errors.join('\n'));
|
|
58
|
+
console.error('');
|
|
59
|
+
console.error(renderGoodVibesHelp(binary));
|
|
60
|
+
process.exit(2);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
if (cli.flags.help || cli.command === 'help') {
|
|
64
|
+
const helpTopic = cli.command === 'help'
|
|
65
|
+
? cli.commandArgs[0]
|
|
66
|
+
: cli.rawCommand ?? undefined;
|
|
67
|
+
console.log(helpTopic ? renderGoodVibesCommandHelp(helpTopic, binary) : renderGoodVibesHelp(binary));
|
|
68
|
+
process.exit(0);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
if (cli.flags.version || cli.command === 'version') {
|
|
72
|
+
console.log(renderGoodVibesVersion(binary));
|
|
73
|
+
process.exit(0);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
if (cli.command === 'completion') {
|
|
77
|
+
console.log(renderCompletion(cli.commandArgs[0], binary));
|
|
78
|
+
process.exit(0);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
if (cli.command === 'serve') {
|
|
82
|
+
await import('../daemon/cli.ts');
|
|
83
|
+
return new Promise<PreparedShellCliRuntime>(() => {});
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
const {
|
|
87
|
+
workingDirectory: bootstrapWorkingDir,
|
|
88
|
+
homeDirectory: bootstrapHomeDirectory,
|
|
89
|
+
} = resolveShellEntrypointOwnership(roots, cli.flags.workingDir ?? (cli.command === 'tui' ? cli.commandArgs[0] : undefined));
|
|
90
|
+
configureActivityLogger(join(bootstrapWorkingDir, '.goodvibes', 'logs'));
|
|
91
|
+
const configManager = new ConfigManager({
|
|
92
|
+
workingDir: bootstrapWorkingDir,
|
|
93
|
+
homeDir: bootstrapHomeDirectory,
|
|
94
|
+
surfaceRoot: 'tui',
|
|
95
|
+
});
|
|
96
|
+
new GlobalNetworkTransportInstaller().install(configManager);
|
|
97
|
+
|
|
98
|
+
const overrideErrors = applyRuntimeConfigOverrides(configManager, cli.flags.configOverrides);
|
|
99
|
+
if (overrideErrors.length > 0) {
|
|
100
|
+
console.error(overrideErrors.join('\n'));
|
|
101
|
+
process.exit(2);
|
|
102
|
+
}
|
|
103
|
+
applyRuntimeFeatureFlagOverrides(configManager, {
|
|
104
|
+
enableFeatures: cli.flags.enableFeatures,
|
|
105
|
+
disableFeatures: cli.flags.disableFeatures,
|
|
106
|
+
});
|
|
107
|
+
|
|
108
|
+
if (cli.flags.provider !== undefined) {
|
|
109
|
+
applyRuntimeConfigValue(configManager, 'provider.provider', cli.flags.provider);
|
|
110
|
+
}
|
|
111
|
+
if (cli.flags.model !== undefined) {
|
|
112
|
+
applyRuntimeConfigValue(configManager, 'provider.model', cli.flags.model);
|
|
113
|
+
}
|
|
114
|
+
const endpointOverrideErrors = applyRuntimeCommandEndpointFlagOverrides(configManager, cli.command, cli.flags);
|
|
115
|
+
if (endpointOverrideErrors.length > 0) {
|
|
116
|
+
console.error(endpointOverrideErrors.join('\n'));
|
|
117
|
+
process.exit(2);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
if (cli.command === 'status' || cli.command === 'doctor' || (cli.command === 'onboarding' && cli.commandArgs[0] === 'status')) {
|
|
121
|
+
const shellPaths = createShellPathService({
|
|
122
|
+
workingDirectory: bootstrapWorkingDir,
|
|
123
|
+
homeDirectory: bootstrapHomeDirectory,
|
|
124
|
+
});
|
|
125
|
+
const userStorePath = shellPaths.resolveUserPath('tui', 'auth-users.json');
|
|
126
|
+
const bootstrapCredentialPath = shellPaths.resolveUserPath('tui', 'auth-bootstrap.txt');
|
|
127
|
+
const operatorTokenPath = join(bootstrapHomeDirectory, '.goodvibes', 'daemon', 'operator-tokens.json');
|
|
128
|
+
const onboardingMarkers = readOnboardingCompletionMarkers(shellPaths);
|
|
129
|
+
const service = await buildCliServicePosture({
|
|
130
|
+
configManager,
|
|
131
|
+
workingDirectory: bootstrapWorkingDir,
|
|
132
|
+
homeDirectory: bootstrapHomeDirectory,
|
|
133
|
+
});
|
|
134
|
+
const statusOptions = {
|
|
135
|
+
configManager,
|
|
136
|
+
workingDirectory: bootstrapWorkingDir,
|
|
137
|
+
homeDirectory: bootstrapHomeDirectory,
|
|
138
|
+
onboardingMarkers,
|
|
139
|
+
auth: {
|
|
140
|
+
userStorePath,
|
|
141
|
+
userStorePresent: existsSync(userStorePath),
|
|
142
|
+
bootstrapCredentialPath,
|
|
143
|
+
bootstrapCredentialPresent: existsSync(bootstrapCredentialPath),
|
|
144
|
+
operatorTokenPath,
|
|
145
|
+
operatorTokenPresent: existsSync(operatorTokenPath),
|
|
146
|
+
},
|
|
147
|
+
service,
|
|
148
|
+
doctor: cli.command === 'doctor',
|
|
149
|
+
outputFormat: cli.flags.outputFormat,
|
|
150
|
+
};
|
|
151
|
+
const snapshot = buildCliStatusSnapshot(statusOptions);
|
|
152
|
+
console.log(cli.command === 'onboarding'
|
|
153
|
+
? renderOnboardingCliStatus(statusOptions)
|
|
154
|
+
: renderCliStatus(statusOptions));
|
|
155
|
+
process.exit(cli.command === 'doctor' && snapshot.findings.length > 0 ? 1 : 0);
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
const cliCommandResult = await handleGoodVibesCliCommand({
|
|
159
|
+
cli,
|
|
160
|
+
configManager,
|
|
161
|
+
workingDirectory: bootstrapWorkingDir,
|
|
162
|
+
homeDirectory: bootstrapHomeDirectory,
|
|
163
|
+
});
|
|
164
|
+
if (cliCommandResult.handled) {
|
|
165
|
+
process.exit(cliCommandResult.exitCode);
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
return { cli, configManager, bootstrapWorkingDir, bootstrapHomeDirectory };
|
|
169
|
+
}
|
package/src/cli/help.ts
ADDED
|
@@ -0,0 +1,301 @@
|
|
|
1
|
+
import { existsSync, readFileSync } from 'node:fs';
|
|
2
|
+
import { dirname, join } from 'node:path';
|
|
3
|
+
import { fileURLToPath } from 'node:url';
|
|
4
|
+
|
|
5
|
+
const FALLBACK_VERSION = '0.19.24';
|
|
6
|
+
|
|
7
|
+
function readJsonVersion(path: string): string | null {
|
|
8
|
+
try {
|
|
9
|
+
if (!existsSync(path)) return null;
|
|
10
|
+
const parsed = JSON.parse(readFileSync(path, 'utf-8')) as { version?: unknown };
|
|
11
|
+
return typeof parsed.version === 'string' ? parsed.version : null;
|
|
12
|
+
} catch {
|
|
13
|
+
return null;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export function getPackageVersion(): string {
|
|
18
|
+
const here = dirname(fileURLToPath(import.meta.url));
|
|
19
|
+
return readJsonVersion(join(here, '..', '..', 'package.json'))
|
|
20
|
+
?? process.env.npm_package_version
|
|
21
|
+
?? FALLBACK_VERSION;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export function renderGoodVibesVersion(binary = 'goodvibes'): string {
|
|
25
|
+
return `${binary} ${getPackageVersion()}`;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export function renderGoodVibesHelp(binary = 'goodvibes'): string {
|
|
29
|
+
return [
|
|
30
|
+
`Usage: ${binary} [OPTIONS] [PROMPT]`,
|
|
31
|
+
` ${binary} [OPTIONS] <COMMAND> [ARGS]`,
|
|
32
|
+
'',
|
|
33
|
+
'Commands:',
|
|
34
|
+
' tui [path] Start the interactive TUI (default)',
|
|
35
|
+
' run|exec [prompt] Run non-interactively with text/json/stream-json output',
|
|
36
|
+
' serve|daemon Start the daemon/API host',
|
|
37
|
+
' web Show browser surface bind URL and enablement',
|
|
38
|
+
' service Inspect/manage daemon service lifecycle',
|
|
39
|
+
' status Print config, provider, service, and onboarding posture',
|
|
40
|
+
' doctor Print status plus setup warnings',
|
|
41
|
+
' onboarding [status] Open onboarding in the TUI, or print onboarding status',
|
|
42
|
+
' models [provider] List/use/pin selectable models and recent model history',
|
|
43
|
+
' providers List/inspect/use provider config/auth posture',
|
|
44
|
+
' auth Inspect and manage local users, sessions, and bootstrap auth',
|
|
45
|
+
' subscription Start/finish/logout provider subscription sessions',
|
|
46
|
+
' secrets List, set, link, delete, and test GoodVibes secret refs',
|
|
47
|
+
' sessions List, show, export, or resume saved sessions',
|
|
48
|
+
' tasks List/show in-process tasks or submit a non-interactive task',
|
|
49
|
+
' pair|qrcode Print companion pairing payload and QR code',
|
|
50
|
+
' surfaces Inspect/check/enable/disable browser/listener/external surfaces',
|
|
51
|
+
' listener test Test HTTP listener/webhook readiness',
|
|
52
|
+
' control-plane status Inspect daemon auth, local admin, tokens, and ports',
|
|
53
|
+
' bundle export|inspect|import',
|
|
54
|
+
' Move setup/profile/trust/support bundles',
|
|
55
|
+
' remote|bridge Inspect remote runner/node posture',
|
|
56
|
+
' completion <shell> Generate shell completion script',
|
|
57
|
+
' help [command] Print this help or command-specific help',
|
|
58
|
+
' version Print version',
|
|
59
|
+
'',
|
|
60
|
+
'Options:',
|
|
61
|
+
' -m, --model <registryKey> Override model. provider:model infers --provider',
|
|
62
|
+
' --provider <id> Override provider',
|
|
63
|
+
' -C, --cd <dir> Set working directory for this launch',
|
|
64
|
+
' --working-dir <dir> Alias for --cd',
|
|
65
|
+
' --daemon-home <dir> Override daemon home for daemon-backed commands',
|
|
66
|
+
' -c, --config <key=value> Override a config value for this launch',
|
|
67
|
+
' --enable <feature> Enable a feature flag for this launch',
|
|
68
|
+
' --disable <feature> Disable a feature flag for this launch',
|
|
69
|
+
' -p, --prompt <text> Run a non-interactive prompt',
|
|
70
|
+
' --print Alias for non-interactive run mode',
|
|
71
|
+
' -o, --output <format> text, json, or stream-json',
|
|
72
|
+
' --output-format <format> Alias for --output',
|
|
73
|
+
' --json Alias for --output-format json',
|
|
74
|
+
' --no-alt-screen Keep output in normal terminal scrollback',
|
|
75
|
+
' --port <port> Port for server/web commands',
|
|
76
|
+
' --hostname <host> Hostname for server/web commands',
|
|
77
|
+
' --open Open browser when supported',
|
|
78
|
+
' -r, --resume [id|latest] Resume saved session when supported',
|
|
79
|
+
' -s, --session <id> Use a specific session when supported',
|
|
80
|
+
' --continue Continue the latest session when supported',
|
|
81
|
+
' --fork Fork session when supported',
|
|
82
|
+
' -h, --help Print help',
|
|
83
|
+
' -v, --version Print version',
|
|
84
|
+
'',
|
|
85
|
+
'Examples:',
|
|
86
|
+
` ${binary}`,
|
|
87
|
+
` ${binary} --no-alt-screen`,
|
|
88
|
+
` ${binary} --cd ~/work/project --model openai:gpt-5.2`,
|
|
89
|
+
` ${binary} onboarding`,
|
|
90
|
+
` ${binary} onboarding status`,
|
|
91
|
+
` ${binary} status`,
|
|
92
|
+
` ${binary} models current`,
|
|
93
|
+
` ${binary} models use openai:gpt-5.2`,
|
|
94
|
+
` ${binary} providers inspect openai`,
|
|
95
|
+
` ${binary} surfaces`,
|
|
96
|
+
` ${binary} surfaces check`,
|
|
97
|
+
` ${binary} surfaces enable web`,
|
|
98
|
+
` ${binary} service check`,
|
|
99
|
+
` ${binary} listener test`,
|
|
100
|
+
` ${binary} control-plane status`,
|
|
101
|
+
` ${binary} subscription providers`,
|
|
102
|
+
` ${binary} subscription login openai start --open`,
|
|
103
|
+
` ${binary} serve --hostname 0.0.0.0 --port 3421`,
|
|
104
|
+
].join('\n');
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
type CommandHelp = {
|
|
108
|
+
readonly usage: readonly string[];
|
|
109
|
+
readonly summary: string;
|
|
110
|
+
readonly subcommands?: readonly string[];
|
|
111
|
+
readonly examples?: readonly string[];
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
const COMMAND_HELP: Record<string, CommandHelp> = {
|
|
115
|
+
tui: {
|
|
116
|
+
usage: ['tui [path]', '[prompt]'],
|
|
117
|
+
summary: 'Start the interactive terminal UI. A prompt starts the TUI with that prompt seeded.',
|
|
118
|
+
examples: ['', 'tui ~/work/project', '"review this repo"'],
|
|
119
|
+
},
|
|
120
|
+
run: {
|
|
121
|
+
usage: ['run [prompt] [--output text|json|stream-json]', 'exec [prompt]'],
|
|
122
|
+
summary: 'Run a single non-interactive agent turn and write the result to stdout.',
|
|
123
|
+
examples: ['run "summarize the current project"', 'run --output json "list risks"', 'exec --output stream-json "fix lint"'],
|
|
124
|
+
},
|
|
125
|
+
onboarding: {
|
|
126
|
+
usage: ['onboarding', 'setup', 'onboarding status'],
|
|
127
|
+
summary: 'Open the setup wizard on the next TUI startup, or inspect onboarding marker status from the CLI.',
|
|
128
|
+
examples: ['onboarding', 'onboarding status'],
|
|
129
|
+
},
|
|
130
|
+
status: {
|
|
131
|
+
usage: ['status', 'status --json'],
|
|
132
|
+
summary: 'Print config, provider, auth, service, surface, and onboarding posture.',
|
|
133
|
+
examples: ['status', 'status --json'],
|
|
134
|
+
},
|
|
135
|
+
doctor: {
|
|
136
|
+
usage: ['doctor', 'doctor --json'],
|
|
137
|
+
summary: 'Print status plus actionable setup warnings with cause, impact, and next action.',
|
|
138
|
+
examples: ['doctor', 'doctor --json'],
|
|
139
|
+
},
|
|
140
|
+
providers: {
|
|
141
|
+
usage: ['providers [list]', 'providers current', 'providers inspect <provider>', 'providers use <provider> [modelRegistryKey]'],
|
|
142
|
+
summary: 'Inspect and change provider setup, auth posture, model counts, and setup class.',
|
|
143
|
+
examples: ['providers', 'providers inspect openai-subscriber', 'providers use openai openai:gpt-5.4'],
|
|
144
|
+
},
|
|
145
|
+
models: {
|
|
146
|
+
usage: ['models [provider]', 'models current', 'models use <registryKey>', 'models pin <registryKey>', 'models recent'],
|
|
147
|
+
summary: 'List, inspect, select, pin, and review model choices.',
|
|
148
|
+
examples: ['models current', 'models openai', 'models use openai:gpt-5.4'],
|
|
149
|
+
},
|
|
150
|
+
auth: {
|
|
151
|
+
usage: ['auth status', 'auth users', 'auth sessions', 'auth add-user <username>', 'auth clear-bootstrap'],
|
|
152
|
+
summary: 'Inspect and manage local admin users, bootstrap auth, and local sessions.',
|
|
153
|
+
examples: ['auth', 'auth add-user admin --password-stdin', 'auth clear-bootstrap'],
|
|
154
|
+
},
|
|
155
|
+
subscription: {
|
|
156
|
+
usage: ['subscription list', 'subscription providers', 'subscription inspect <provider>', 'subscription login <provider> start|finish', 'subscription logout <provider>'],
|
|
157
|
+
summary: 'Manage OAuth/subscription-backed provider sessions such as OpenAI subscription access.',
|
|
158
|
+
examples: ['subscription providers', 'subscription login openai start --open', 'subscription inspect openai'],
|
|
159
|
+
},
|
|
160
|
+
secrets: {
|
|
161
|
+
usage: ['secrets list', 'secrets providers', 'secrets test goodvibes://secrets/<source>/...', 'secrets set <KEY> <value>', 'secrets link <KEY> <ref>'],
|
|
162
|
+
summary: 'Manage GoodVibes secret records and secret references. Secret refs never embed secret values.',
|
|
163
|
+
examples: ['secrets providers', 'secrets test goodvibes://secrets/env/OPENAI_API_KEY', 'secrets link OPENAI_API_KEY goodvibes://secrets/env/OPENAI_API_KEY'],
|
|
164
|
+
},
|
|
165
|
+
sessions: {
|
|
166
|
+
usage: ['sessions list', 'sessions show <id|name>', 'sessions export <id|name> [path]', 'sessions resume <id|name>'],
|
|
167
|
+
summary: 'List, inspect, export, or resume saved TUI sessions.',
|
|
168
|
+
examples: ['sessions list', 'sessions show latest-session', 'sessions export abc123 session.json'],
|
|
169
|
+
},
|
|
170
|
+
tasks: {
|
|
171
|
+
usage: ['tasks list', 'tasks show <taskId>', 'tasks submit <prompt>'],
|
|
172
|
+
summary: 'Inspect runtime tasks or submit a non-interactive task.',
|
|
173
|
+
examples: ['tasks list', 'tasks submit "check provider readiness"'],
|
|
174
|
+
},
|
|
175
|
+
surfaces: {
|
|
176
|
+
usage: ['surfaces [list]', 'surfaces check', 'surfaces show <surfaceId>', 'surfaces enable <web|listener|control-plane|surfaceId>', 'surfaces disable <surfaceId>'],
|
|
177
|
+
summary: 'Inspect and configure browser, control-plane, HTTP listener, and external integration surfaces.',
|
|
178
|
+
examples: ['surfaces check', 'surfaces enable web', 'surfaces enable slack'],
|
|
179
|
+
},
|
|
180
|
+
listener: {
|
|
181
|
+
usage: ['listener test'],
|
|
182
|
+
summary: 'Check HTTP listener/webhook readiness, network posture, service posture, auth, and enabled surface requirements.',
|
|
183
|
+
examples: ['listener test', 'listener test --json'],
|
|
184
|
+
},
|
|
185
|
+
'control-plane': {
|
|
186
|
+
usage: ['control-plane status'],
|
|
187
|
+
summary: 'Inspect daemon control-plane bind posture, reachability, local auth, bootstrap credentials, and operator tokens.',
|
|
188
|
+
examples: ['control-plane status', 'control-plane status --json'],
|
|
189
|
+
},
|
|
190
|
+
bundle: {
|
|
191
|
+
usage: ['bundle export [path]', 'bundle inspect <path>', 'bundle import <path>'],
|
|
192
|
+
summary: 'Export, inspect, or import setup/profile/trust/support bundle data.',
|
|
193
|
+
examples: ['bundle export goodvibes-bundle.json', 'bundle inspect goodvibes-bundle.json'],
|
|
194
|
+
},
|
|
195
|
+
pair: {
|
|
196
|
+
usage: ['pair', 'qrcode'],
|
|
197
|
+
summary: 'Print companion pairing connection details and a QR code.',
|
|
198
|
+
examples: ['pair', 'qrcode'],
|
|
199
|
+
},
|
|
200
|
+
web: {
|
|
201
|
+
usage: ['web [--open]'],
|
|
202
|
+
summary: 'Show the configured browser surface URL, bind address, and enablement state.',
|
|
203
|
+
examples: ['web', 'web --open', 'web --hostname 0.0.0.0 --port 3423'],
|
|
204
|
+
},
|
|
205
|
+
service: {
|
|
206
|
+
usage: ['service status', 'service check', 'service install|start|stop|restart|uninstall'],
|
|
207
|
+
summary: 'Inspect and manage the daemon service lifecycle, autostart, restart policy, PID, logs, and endpoint readiness.',
|
|
208
|
+
examples: ['service status', 'service check --json', 'service install'],
|
|
209
|
+
},
|
|
210
|
+
completion: {
|
|
211
|
+
usage: ['completion <bash|zsh|fish>'],
|
|
212
|
+
summary: 'Generate shell completion scripts.',
|
|
213
|
+
examples: ['completion bash', 'completion zsh'],
|
|
214
|
+
},
|
|
215
|
+
serve: {
|
|
216
|
+
usage: ['serve [--hostname <host>] [--port <port>]', 'daemon [--hostname <host>] [--port <port>]'],
|
|
217
|
+
summary: 'Start the headless GoodVibes daemon/API host.',
|
|
218
|
+
examples: ['serve', 'serve --hostname 0.0.0.0 --port 3421'],
|
|
219
|
+
},
|
|
220
|
+
remote: {
|
|
221
|
+
usage: ['remote', 'bridge'],
|
|
222
|
+
summary: 'Inspect remote runner/node posture and bridge readiness.',
|
|
223
|
+
examples: ['remote', 'bridge'],
|
|
224
|
+
},
|
|
225
|
+
};
|
|
226
|
+
|
|
227
|
+
const HELP_ALIASES: Record<string, string> = {
|
|
228
|
+
app: 'tui',
|
|
229
|
+
exec: 'run',
|
|
230
|
+
setup: 'onboarding',
|
|
231
|
+
provider: 'providers',
|
|
232
|
+
model: 'models',
|
|
233
|
+
subscriptions: 'subscription',
|
|
234
|
+
secret: 'secrets',
|
|
235
|
+
session: 'sessions',
|
|
236
|
+
task: 'tasks',
|
|
237
|
+
surface: 'surfaces',
|
|
238
|
+
webhook: 'listener',
|
|
239
|
+
controlplane: 'control-plane',
|
|
240
|
+
cp: 'control-plane',
|
|
241
|
+
qrcode: 'pair',
|
|
242
|
+
qr: 'pair',
|
|
243
|
+
daemon: 'serve',
|
|
244
|
+
server: 'serve',
|
|
245
|
+
services: 'service',
|
|
246
|
+
bridge: 'remote',
|
|
247
|
+
};
|
|
248
|
+
|
|
249
|
+
function normalizeHelpTopic(topic: string): string {
|
|
250
|
+
const normalized = topic.trim().toLowerCase();
|
|
251
|
+
return HELP_ALIASES[normalized] ?? normalized;
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
export function renderGoodVibesCommandHelp(topic: string, binary = 'goodvibes'): string {
|
|
255
|
+
const normalized = normalizeHelpTopic(topic);
|
|
256
|
+
const help = COMMAND_HELP[normalized];
|
|
257
|
+
if (!help) {
|
|
258
|
+
return [
|
|
259
|
+
`No detailed help is available for "${topic}".`,
|
|
260
|
+
'',
|
|
261
|
+
renderGoodVibesHelp(binary),
|
|
262
|
+
].join('\n');
|
|
263
|
+
}
|
|
264
|
+
return [
|
|
265
|
+
`GoodVibes ${normalized}`,
|
|
266
|
+
'',
|
|
267
|
+
help.summary,
|
|
268
|
+
'',
|
|
269
|
+
'Usage:',
|
|
270
|
+
...help.usage.map((usage) => ` ${binary} ${usage}`),
|
|
271
|
+
...(help.subcommands && help.subcommands.length > 0 ? [
|
|
272
|
+
'',
|
|
273
|
+
'Subcommands:',
|
|
274
|
+
...help.subcommands.map((subcommand) => ` ${subcommand}`),
|
|
275
|
+
] : []),
|
|
276
|
+
...(help.examples && help.examples.length > 0 ? [
|
|
277
|
+
'',
|
|
278
|
+
'Examples:',
|
|
279
|
+
...help.examples.map((example) => ` ${binary}${example ? ` ${example}` : ''}`),
|
|
280
|
+
] : []),
|
|
281
|
+
].join('\n');
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
export function renderGoodVibesDaemonHelp(binary = 'goodvibes-daemon'): string {
|
|
285
|
+
return [
|
|
286
|
+
`Usage: ${binary} [OPTIONS]`,
|
|
287
|
+
'',
|
|
288
|
+
'Starts the headless GoodVibes daemon/API host.',
|
|
289
|
+
'',
|
|
290
|
+
'Options:',
|
|
291
|
+
' --daemon-home <dir> Override daemon home',
|
|
292
|
+
' --working-dir <dir> Override working directory',
|
|
293
|
+
' -C, --cd <dir> Alias for --working-dir',
|
|
294
|
+
' --provider <id> Override provider',
|
|
295
|
+
' -m, --model <registryKey> Override model. provider:model infers --provider',
|
|
296
|
+
' --hostname <host> Hostname hint for printed connection info',
|
|
297
|
+
' --port <port> Control-plane port override when supported',
|
|
298
|
+
' -h, --help Print help',
|
|
299
|
+
' -v, --version Print version',
|
|
300
|
+
].join('\n');
|
|
301
|
+
}
|
package/src/cli/index.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export * from './types.ts';
|
|
2
|
+
export * from './parser.ts';
|
|
3
|
+
export * from './help.ts';
|
|
4
|
+
export * from './status.ts';
|
|
5
|
+
export * from './completion.ts';
|
|
6
|
+
export * from './config-overrides.ts';
|
|
7
|
+
export * from './endpoints.ts';
|
|
8
|
+
export * from './surface-command.ts';
|
|
9
|
+
export * from './service-command.ts';
|
|
10
|
+
export * from './bundle-command.ts';
|
|
11
|
+
export * from './management.ts';
|