orquesta-cli 0.2.27 → 0.2.28
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/cli.js +60 -15
- package/dist/setup/first-run-setup.js +3 -2
- package/dist/ui/components/PlanExecuteApp.js +16 -0
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -31,6 +31,23 @@ import { PROVIDERS } from './core/config/providers.js';
|
|
|
31
31
|
const require = createRequire(import.meta.url);
|
|
32
32
|
const packageJson = require('../package.json');
|
|
33
33
|
const program = new Command();
|
|
34
|
+
async function resolveHookToken(explicitToken) {
|
|
35
|
+
await configManager.initialize();
|
|
36
|
+
const saved = configManager.getOrquestaConfig();
|
|
37
|
+
const token = explicitToken || saved?.token;
|
|
38
|
+
if (!token) {
|
|
39
|
+
console.error(chalk.red('Error: not connected to Orquesta.'));
|
|
40
|
+
console.error('Run ' + chalk.cyan('orquesta --login') + ' first, or pass ' + chalk.cyan('--token oat_…') + '.');
|
|
41
|
+
process.exit(1);
|
|
42
|
+
}
|
|
43
|
+
return { token: token, savedProjectId: saved?.projectId };
|
|
44
|
+
}
|
|
45
|
+
async function runHookEnable(opts) {
|
|
46
|
+
const { token, savedProjectId } = await resolveHookToken(opts.token);
|
|
47
|
+
const { initHooks } = await import('./orquesta/hook-init.js');
|
|
48
|
+
const preferredProjectId = opts.project || (opts.ignoreSaved || opts.token ? undefined : savedProjectId);
|
|
49
|
+
await initHooks(token, undefined, preferredProjectId);
|
|
50
|
+
}
|
|
34
51
|
program
|
|
35
52
|
.name('orquesta')
|
|
36
53
|
.description('Orquesta CLI - AI-powered coding assistant with local LLM support')
|
|
@@ -64,17 +81,7 @@ program
|
|
|
64
81
|
return;
|
|
65
82
|
}
|
|
66
83
|
if (options.init) {
|
|
67
|
-
await
|
|
68
|
-
const saved = configManager.getOrquestaConfig();
|
|
69
|
-
const token = options.token || saved?.token;
|
|
70
|
-
if (!token) {
|
|
71
|
-
console.error(chalk.red('Error: not connected to Orquesta.'));
|
|
72
|
-
console.error('Run ' + chalk.cyan('orquesta --login') + ' first, or pass ' + chalk.cyan('orquesta --init --token oat_…') + '.');
|
|
73
|
-
process.exit(1);
|
|
74
|
-
}
|
|
75
|
-
const { initHooks } = await import('./orquesta/hook-init.js');
|
|
76
|
-
const preferredProjectId = options.project || (options.token ? undefined : saved?.projectId);
|
|
77
|
-
await initHooks(token, undefined, preferredProjectId);
|
|
84
|
+
await runHookEnable({ token: options.token, project: options.project });
|
|
78
85
|
return;
|
|
79
86
|
}
|
|
80
87
|
if (options.disableHook) {
|
|
@@ -305,6 +312,42 @@ program
|
|
|
305
312
|
}
|
|
306
313
|
}
|
|
307
314
|
});
|
|
315
|
+
const hook = program
|
|
316
|
+
.command('hook')
|
|
317
|
+
.description('Manage the Claude Code hook for the current directory');
|
|
318
|
+
hook
|
|
319
|
+
.command('enable')
|
|
320
|
+
.description('Enable the hook here (asks which project if ambiguous)')
|
|
321
|
+
.option('--project <projectId>', 'Project this directory should stream into')
|
|
322
|
+
.option('--token <token>', 'Use a specific token instead of your saved login')
|
|
323
|
+
.action(async (opts) => {
|
|
324
|
+
await runHookEnable({ token: opts.token, project: opts.project });
|
|
325
|
+
process.exit(0);
|
|
326
|
+
});
|
|
327
|
+
hook
|
|
328
|
+
.command('switch')
|
|
329
|
+
.description('Change which project this directory streams into')
|
|
330
|
+
.option('--project <projectId>', 'Project to switch to (skips the prompt)')
|
|
331
|
+
.action(async (opts) => {
|
|
332
|
+
await runHookEnable({ project: opts.project, ignoreSaved: true });
|
|
333
|
+
process.exit(0);
|
|
334
|
+
});
|
|
335
|
+
hook
|
|
336
|
+
.command('disable')
|
|
337
|
+
.description('Disable the hook in this directory')
|
|
338
|
+
.action(async () => {
|
|
339
|
+
const { disableHooks } = await import('./orquesta/hook-init.js');
|
|
340
|
+
disableHooks();
|
|
341
|
+
process.exit(0);
|
|
342
|
+
});
|
|
343
|
+
hook
|
|
344
|
+
.command('status')
|
|
345
|
+
.description('Show the hook + target project for this directory')
|
|
346
|
+
.action(async () => {
|
|
347
|
+
await configManager.initialize();
|
|
348
|
+
showConnectionStatus();
|
|
349
|
+
process.exit(0);
|
|
350
|
+
});
|
|
308
351
|
program.showHelpAfterError(false);
|
|
309
352
|
program.configureOutput({
|
|
310
353
|
outputError: (str, write) => {
|
|
@@ -318,14 +361,16 @@ program.configureOutput({
|
|
|
318
361
|
});
|
|
319
362
|
program.on('command:*', () => {
|
|
320
363
|
console.error(chalk.red('⚠️ Unknown command.'));
|
|
321
|
-
console.log(chalk.white('Usage: orquesta [options]
|
|
364
|
+
console.log(chalk.white('Usage: orquesta [options] | orquesta hook <enable|switch|disable|status>\n'));
|
|
322
365
|
console.log(chalk.white(' -p, --print <prompt> Execute a prompt and exit\n'));
|
|
323
366
|
console.log(chalk.white(' --token <token> Connect to Orquesta dashboard\n'));
|
|
324
367
|
console.log(chalk.white(' --project <id> Select project when connecting\n'));
|
|
325
|
-
console.log(chalk.white(' --switch-project [id] Switch to a different project\n'));
|
|
368
|
+
console.log(chalk.white(' --switch-project [id] Switch the CLI to a different project\n'));
|
|
326
369
|
console.log(chalk.white(' --status Show connection + hook status\n'));
|
|
327
|
-
console.log(chalk.white('
|
|
328
|
-
console.log(chalk.white('
|
|
370
|
+
console.log(chalk.white(' hook enable Enable the Claude Code hook here\n'));
|
|
371
|
+
console.log(chalk.white(' hook switch Move this directory to another project\n'));
|
|
372
|
+
console.log(chalk.white(' hook disable Disable the Claude Code hook here\n'));
|
|
373
|
+
console.log(chalk.white(' hook status Show the hook + target project here\n'));
|
|
329
374
|
console.log(chalk.white(' --sync Sync configurations with Orquesta\n'));
|
|
330
375
|
console.log(chalk.white(' --disconnect Disconnect from Orquesta\n'));
|
|
331
376
|
console.log(chalk.white(' --scan Scan for available LLM providers\n'));
|
|
@@ -291,11 +291,12 @@ export function showConnectionStatus() {
|
|
|
291
291
|
console.log(chalk.green('Claude Code hook: enabled in this directory'));
|
|
292
292
|
console.log(chalk.dim(` Streaming into: ${name}`));
|
|
293
293
|
console.log(chalk.dim(` Project ID: ${hook.projectId}`));
|
|
294
|
-
console.log(chalk.dim(`
|
|
294
|
+
console.log(chalk.dim(` Change project: orquesta hook switch`));
|
|
295
|
+
console.log(chalk.dim(` Disable: orquesta hook disable`));
|
|
295
296
|
}
|
|
296
297
|
else {
|
|
297
298
|
console.log(chalk.yellow('Claude Code hook: not enabled in this directory'));
|
|
298
|
-
console.log(chalk.dim(` Enable with: orquesta
|
|
299
|
+
console.log(chalk.dim(` Enable with: orquesta hook enable`));
|
|
299
300
|
}
|
|
300
301
|
}
|
|
301
302
|
//# sourceMappingURL=first-run-setup.js.map
|
|
@@ -34,6 +34,7 @@ import { processFileReferences } from '../hooks/atFileProcessor.js';
|
|
|
34
34
|
import { executeSlashCommand, isSlashCommand, } from '../../core/slash-command-handler.js';
|
|
35
35
|
import { closeJsonStreamLogger } from '../../utils/json-stream-logger.js';
|
|
36
36
|
import { configManager } from '../../core/config/config-manager.js';
|
|
37
|
+
import { readHookConfig } from '../../orquesta/hook-init.js';
|
|
37
38
|
import { logger } from '../../utils/logger.js';
|
|
38
39
|
import { usageTracker } from '../../core/usage-tracker.js';
|
|
39
40
|
import { UpdateNotification } from '../UpdateNotification.js';
|
|
@@ -88,6 +89,16 @@ function getStatusText({ phase, todos, currentToolName }) {
|
|
|
88
89
|
}
|
|
89
90
|
export const PlanExecuteApp = ({ llmClient: initialLlmClient, modelInfo }) => {
|
|
90
91
|
const { exit } = useApp();
|
|
92
|
+
const hookBinding = useMemo(() => {
|
|
93
|
+
const cfg = readHookConfig(process.cwd());
|
|
94
|
+
if (!cfg)
|
|
95
|
+
return null;
|
|
96
|
+
const oc = configManager.getOrquestaConfig();
|
|
97
|
+
const name = oc?.projectId === cfg.projectId && oc?.projectName
|
|
98
|
+
? oc.projectName
|
|
99
|
+
: cfg.projectId.slice(0, 8);
|
|
100
|
+
return { projectName: name };
|
|
101
|
+
}, []);
|
|
91
102
|
const [messages, setMessages] = useState([]);
|
|
92
103
|
const { input, setInput, handleHistoryPrev, handleHistoryNext, addToHistory } = useInputHistory();
|
|
93
104
|
const [isProcessing, setIsProcessing] = useState(false);
|
|
@@ -1412,6 +1423,11 @@ export const PlanExecuteApp = ({ llmClient: initialLlmClient, modelInfo }) => {
|
|
|
1412
1423
|
React.createElement(Text, { color: "cyan" }, currentModelInfo.model),
|
|
1413
1424
|
React.createElement(Text, { color: "gray" }, " \u2502 "),
|
|
1414
1425
|
React.createElement(Text, { color: "gray" }, shortenPath(process.cwd())),
|
|
1426
|
+
hookBinding && (React.createElement(React.Fragment, null,
|
|
1427
|
+
React.createElement(Text, { color: "gray" }, " \u2502 "),
|
|
1428
|
+
React.createElement(Text, { color: "green" },
|
|
1429
|
+
"\u2B21 hook \u2192 ",
|
|
1430
|
+
hookBinding.projectName))),
|
|
1415
1431
|
(planExecutionState.todos.length > 0 || batutaUsage) && (React.createElement(React.Fragment, null,
|
|
1416
1432
|
React.createElement(Text, { color: "gray" }, " \u2502 "),
|
|
1417
1433
|
React.createElement(TodoStatusBar, { todos: planExecutionState.todos, projectName: configManager.getOrquestaConfig()?.projectName, batutaUsage: batutaUsage, isProcessing: isProcessing })))),
|