@positronic/cli 0.0.77 → 0.0.78
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/src/cli.js +298 -196
- package/dist/src/commands/server.js +2 -2
- package/dist/src/components/event-detail.js +139 -139
- package/dist/src/components/events-view.js +60 -63
- package/dist/src/components/watch-keyboard.js +1 -1
- package/dist/src/components/watch-machine.js +344 -286
- package/dist/src/components/watch.js +17 -84
- package/dist/types/cli.d.ts.map +1 -1
- package/dist/types/components/event-detail.d.ts.map +1 -1
- package/dist/types/components/events-view.d.ts.map +1 -1
- package/dist/types/components/watch-machine.d.ts +90 -146
- package/dist/types/components/watch-machine.d.ts.map +1 -1
- package/dist/types/components/watch.d.ts.map +1 -1
- package/dist/types/hooks/useBrainMachine.d.ts +0 -3
- package/dist/types/hooks/useBrainMachine.d.ts.map +1 -1
- package/package.json +4 -4
- package/dist/src/commands/auth.js +0 -91
- package/dist/src/commands/brain.js +0 -139
- package/dist/src/commands/pages.js +0 -47
- package/dist/src/commands/project.js +0 -130
- package/dist/src/commands/resources.js +0 -272
- package/dist/src/commands/schedule.js +0 -91
- package/dist/src/commands/secrets.js +0 -67
- package/dist/src/commands/store.js +0 -36
- package/dist/src/commands/users.js +0 -92
- package/dist/src/components/agent-chat-view.js +0 -125
- package/dist/src/utils/agent-utils.js +0 -107
- package/dist/types/commands/auth.d.ts +0 -32
- package/dist/types/commands/auth.d.ts.map +0 -1
- package/dist/types/commands/brain.d.ts +0 -46
- package/dist/types/commands/brain.d.ts.map +0 -1
- package/dist/types/commands/pages.d.ts +0 -15
- package/dist/types/commands/pages.d.ts.map +0 -1
- package/dist/types/commands/project.d.ts +0 -55
- package/dist/types/commands/project.d.ts.map +0 -1
- package/dist/types/commands/resources.d.ts +0 -13
- package/dist/types/commands/resources.d.ts.map +0 -1
- package/dist/types/commands/schedule.d.ts +0 -33
- package/dist/types/commands/schedule.d.ts.map +0 -1
- package/dist/types/commands/secrets.d.ts +0 -20
- package/dist/types/commands/secrets.d.ts.map +0 -1
- package/dist/types/commands/store.d.ts +0 -5
- package/dist/types/commands/store.d.ts.map +0 -1
- package/dist/types/commands/users.d.ts +0 -34
- package/dist/types/commands/users.d.ts.map +0 -1
- package/dist/types/components/agent-chat-view.d.ts +0 -12
- package/dist/types/components/agent-chat-view.d.ts.map +0 -1
- package/dist/types/utils/agent-utils.d.ts +0 -20
- package/dist/types/utils/agent-utils.d.ts.map +0 -1
package/dist/src/cli.js
CHANGED
|
@@ -35,19 +35,6 @@ function _async_to_generator(fn) {
|
|
|
35
35
|
});
|
|
36
36
|
};
|
|
37
37
|
}
|
|
38
|
-
function _define_property(obj, key, value) {
|
|
39
|
-
if (key in obj) {
|
|
40
|
-
Object.defineProperty(obj, key, {
|
|
41
|
-
value: value,
|
|
42
|
-
enumerable: true,
|
|
43
|
-
configurable: true,
|
|
44
|
-
writable: true
|
|
45
|
-
});
|
|
46
|
-
} else {
|
|
47
|
-
obj[key] = value;
|
|
48
|
-
}
|
|
49
|
-
return obj;
|
|
50
|
-
}
|
|
51
38
|
function _instanceof(left, right) {
|
|
52
39
|
if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
|
|
53
40
|
return !!right[Symbol.hasInstance](left);
|
|
@@ -61,45 +48,6 @@ function _iterable_to_array(iter) {
|
|
|
61
48
|
function _non_iterable_rest() {
|
|
62
49
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
63
50
|
}
|
|
64
|
-
function _object_spread(target) {
|
|
65
|
-
for(var i = 1; i < arguments.length; i++){
|
|
66
|
-
var source = arguments[i] != null ? arguments[i] : {};
|
|
67
|
-
var ownKeys = Object.keys(source);
|
|
68
|
-
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
69
|
-
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
70
|
-
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
71
|
-
}));
|
|
72
|
-
}
|
|
73
|
-
ownKeys.forEach(function(key) {
|
|
74
|
-
_define_property(target, key, source[key]);
|
|
75
|
-
});
|
|
76
|
-
}
|
|
77
|
-
return target;
|
|
78
|
-
}
|
|
79
|
-
function ownKeys(object, enumerableOnly) {
|
|
80
|
-
var keys = Object.keys(object);
|
|
81
|
-
if (Object.getOwnPropertySymbols) {
|
|
82
|
-
var symbols = Object.getOwnPropertySymbols(object);
|
|
83
|
-
if (enumerableOnly) {
|
|
84
|
-
symbols = symbols.filter(function(sym) {
|
|
85
|
-
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
86
|
-
});
|
|
87
|
-
}
|
|
88
|
-
keys.push.apply(keys, symbols);
|
|
89
|
-
}
|
|
90
|
-
return keys;
|
|
91
|
-
}
|
|
92
|
-
function _object_spread_props(target, source) {
|
|
93
|
-
source = source != null ? source : {};
|
|
94
|
-
if (Object.getOwnPropertyDescriptors) {
|
|
95
|
-
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
96
|
-
} else {
|
|
97
|
-
ownKeys(Object(source)).forEach(function(key) {
|
|
98
|
-
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
99
|
-
});
|
|
100
|
-
}
|
|
101
|
-
return target;
|
|
102
|
-
}
|
|
103
51
|
function _to_array(arr) {
|
|
104
52
|
return _array_with_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array(arr) || _non_iterable_rest();
|
|
105
53
|
}
|
|
@@ -205,19 +153,66 @@ function _ts_generator(thisArg, body) {
|
|
|
205
153
|
import yargs from 'yargs';
|
|
206
154
|
import { hideBin } from 'yargs/helpers';
|
|
207
155
|
import React from 'react';
|
|
208
|
-
import { ProjectCommand } from './commands/project.js';
|
|
209
156
|
import { ServerCommand } from './commands/server.js';
|
|
210
|
-
import {
|
|
211
|
-
import { ResourcesCommand } from './commands/resources.js';
|
|
212
|
-
import { ScheduleCommand } from './commands/schedule.js';
|
|
213
|
-
import { SecretsCommand } from './commands/secrets.js';
|
|
214
|
-
import { PagesCommand } from './commands/pages.js';
|
|
215
|
-
import { UsersCommand } from './commands/users.js';
|
|
216
|
-
import { AuthCommand } from './commands/auth.js';
|
|
217
|
-
import { StoreCommand } from './commands/store.js';
|
|
218
|
-
import { readFileSync } from 'fs';
|
|
157
|
+
import { readFileSync, existsSync, mkdirSync } from 'fs';
|
|
219
158
|
import { fileURLToPath } from 'url';
|
|
220
159
|
import { dirname, join } from 'path';
|
|
160
|
+
// Brain components
|
|
161
|
+
import { BrainList } from './components/brain-list.js';
|
|
162
|
+
import { BrainHistory } from './components/brain-history.js';
|
|
163
|
+
import { BrainShow } from './components/brain-show.js';
|
|
164
|
+
import { RunShow } from './components/run-show.js';
|
|
165
|
+
import { BrainRerun } from './components/brain-rerun.js';
|
|
166
|
+
import { BrainRun } from './components/brain-run.js';
|
|
167
|
+
import { BrainKill } from './components/brain-kill.js';
|
|
168
|
+
import { BrainResolver } from './components/brain-resolver.js';
|
|
169
|
+
import { WatchResolver } from './components/watch-resolver.js';
|
|
170
|
+
import { TopNavigator } from './components/top-navigator.js';
|
|
171
|
+
// Schedule components
|
|
172
|
+
import { ScheduleCreate } from './components/schedule-create.js';
|
|
173
|
+
import { ScheduleList } from './components/schedule-list.js';
|
|
174
|
+
import { ScheduleDelete } from './components/schedule-delete.js';
|
|
175
|
+
import { ScheduleRuns } from './components/schedule-runs.js';
|
|
176
|
+
import { ScheduleTimezone } from './components/schedule-timezone.js';
|
|
177
|
+
// Secrets components
|
|
178
|
+
import { SecretsList } from './components/secrets-list.js';
|
|
179
|
+
import { SecretsCreate } from './components/secrets-create.js';
|
|
180
|
+
import { SecretsDelete } from './components/secrets-delete.js';
|
|
181
|
+
import { SecretsBulk } from './components/secrets-bulk.js';
|
|
182
|
+
// Pages components
|
|
183
|
+
import { PagesList } from './components/pages-list.js';
|
|
184
|
+
import { PageDelete } from './components/page-delete.js';
|
|
185
|
+
// Users components
|
|
186
|
+
import { UsersList } from './components/users-list.js';
|
|
187
|
+
import { UsersCreate } from './components/users-create.js';
|
|
188
|
+
import { UsersDelete } from './components/users-delete.js';
|
|
189
|
+
import { UsersKeysList } from './components/users-keys-list.js';
|
|
190
|
+
import { UsersKeysAdd } from './components/users-keys-add.js';
|
|
191
|
+
import { UsersKeysRemove } from './components/users-keys-remove.js';
|
|
192
|
+
// Auth components
|
|
193
|
+
import { AuthLogin } from './components/auth-login.js';
|
|
194
|
+
import { AuthLogout } from './components/auth-logout.js';
|
|
195
|
+
import { Whoami } from './components/whoami.js';
|
|
196
|
+
// Project components
|
|
197
|
+
import { ProjectAdd } from './components/project-add.js';
|
|
198
|
+
import { ProjectList } from './components/project-list.js';
|
|
199
|
+
import { ProjectSelect } from './components/project-select.js';
|
|
200
|
+
import { ProjectShow } from './components/project-show.js';
|
|
201
|
+
import { ProjectCreate } from './components/project-create.js';
|
|
202
|
+
import { ProjectRemove } from './components/project-remove.js';
|
|
203
|
+
// Store components
|
|
204
|
+
import { StoreExplorer } from './components/store-explorer.js';
|
|
205
|
+
// Resource components
|
|
206
|
+
import { ResourceList } from './components/resource-list.js';
|
|
207
|
+
import { ResourceSync } from './components/resource-sync.js';
|
|
208
|
+
import { ResourceClear } from './components/resource-clear.js';
|
|
209
|
+
import { ResourceDelete } from './components/resource-delete.js';
|
|
210
|
+
import { ResourceUpload } from './components/resource-upload.js';
|
|
211
|
+
import { ResourceTypes } from './components/resource-types.js';
|
|
212
|
+
// Shared
|
|
213
|
+
import { ErrorComponent } from './components/error.js';
|
|
214
|
+
import { ProjectConfigManager } from './commands/project-config-manager.js';
|
|
215
|
+
import { scanLocalResources } from './commands/helpers.js';
|
|
221
216
|
// Helper function to parse key=value options
|
|
222
217
|
function parseKeyValueOptions(opts) {
|
|
223
218
|
if (!opts || opts.length === 0) return undefined;
|
|
@@ -292,6 +287,15 @@ function parseStateValues(opts) {
|
|
|
292
287
|
export function buildCli(options) {
|
|
293
288
|
var _options_argv = options.argv, argv = _options_argv === void 0 ? hideBin(process.argv) : _options_argv, server = options.server, _options_exitProcess = options.exitProcess, exitProcess = _options_exitProcess === void 0 ? false : _options_exitProcess, render = options.render, projectRootPath = options.projectRootPath;
|
|
294
289
|
var isLocalDevMode = server !== undefined;
|
|
290
|
+
function renderLocalDevOnly() {
|
|
291
|
+
render(React.createElement(ErrorComponent, {
|
|
292
|
+
error: {
|
|
293
|
+
title: 'Command Not Available',
|
|
294
|
+
message: 'This command is only available in local dev mode',
|
|
295
|
+
details: 'Please run this command from within a Positronic project directory.'
|
|
296
|
+
}
|
|
297
|
+
}));
|
|
298
|
+
}
|
|
295
299
|
// Get version from package.json
|
|
296
300
|
var version = 'TEST'; // Default version for test environment where package.json path differs
|
|
297
301
|
try {
|
|
@@ -304,13 +308,7 @@ export function buildCli(options) {
|
|
|
304
308
|
// In test environment, the relative path to package.json is different
|
|
305
309
|
// so we use 'TEST' as the version to avoid breaking tests
|
|
306
310
|
}
|
|
307
|
-
|
|
308
|
-
var projectCommand = new ProjectCommand();
|
|
309
|
-
var brainCommand = new BrainCommand();
|
|
310
|
-
var scheduleCommand = new ScheduleCommand();
|
|
311
|
-
var secretsCommand = new SecretsCommand();
|
|
312
|
-
var pagesCommand = new PagesCommand();
|
|
313
|
-
var usersCommand = new UsersCommand();
|
|
311
|
+
var configManager = new ProjectConfigManager();
|
|
314
312
|
// Main CLI definition
|
|
315
313
|
var cli = yargs(argv).scriptName('positronic').usage('Usage: $0 <command> [options]').version(version).alias('v', 'version').help('h').alias('h', 'help').wrap(null).strictCommands().exitProcess(exitProcess);
|
|
316
314
|
// --- Project Management Commands (Global Mode Only) ---
|
|
@@ -323,8 +321,9 @@ export function buildCli(options) {
|
|
|
323
321
|
demandOption: true
|
|
324
322
|
});
|
|
325
323
|
}, function(argv) {
|
|
326
|
-
|
|
327
|
-
|
|
324
|
+
render(React.createElement(ProjectCreate, {
|
|
325
|
+
projectPathArg: argv.name
|
|
326
|
+
}));
|
|
328
327
|
});
|
|
329
328
|
}
|
|
330
329
|
yargsProject.command('add <name>', 'Add a project to your list of projects', function(yargsAdd) {
|
|
@@ -338,22 +337,29 @@ export function buildCli(options) {
|
|
|
338
337
|
demandOption: true
|
|
339
338
|
}).example('$0 project add my-project --url https://api.my-project.positronic.sh', 'Add a project configuration');
|
|
340
339
|
}, function(argv) {
|
|
341
|
-
|
|
342
|
-
|
|
340
|
+
render(React.createElement(ProjectAdd, {
|
|
341
|
+
name: argv.name,
|
|
342
|
+
url: argv.url,
|
|
343
|
+
projectConfig: configManager
|
|
344
|
+
}));
|
|
343
345
|
}).command('select [name]', 'Switch the active project', function(yargsSelect) {
|
|
344
346
|
return yargsSelect.positional('name', {
|
|
345
347
|
describe: 'Project name to select',
|
|
346
348
|
type: 'string'
|
|
347
349
|
}).example('$0 project select my-project', 'Switch the active project').example('$0 project select', 'Interactive project selection');
|
|
348
350
|
}, function(argv) {
|
|
349
|
-
|
|
350
|
-
|
|
351
|
+
render(React.createElement(ProjectSelect, {
|
|
352
|
+
name: argv.name,
|
|
353
|
+
projectConfig: configManager
|
|
354
|
+
}));
|
|
351
355
|
}).command('list', 'List all of your Positronic projects', function() {}, function() {
|
|
352
|
-
|
|
353
|
-
|
|
356
|
+
render(React.createElement(ProjectList, {
|
|
357
|
+
projectConfig: configManager
|
|
358
|
+
}));
|
|
354
359
|
}).command('show', 'Display your currently selected project', function() {}, function() {
|
|
355
|
-
|
|
356
|
-
|
|
360
|
+
render(React.createElement(ProjectShow, {
|
|
361
|
+
projectConfig: configManager
|
|
362
|
+
}));
|
|
357
363
|
}).command('rm <name>', 'Remove a project from your list of projects', function(yargsRm) {
|
|
358
364
|
return yargsRm.positional('name', {
|
|
359
365
|
describe: 'Name of the project to remove',
|
|
@@ -361,8 +367,10 @@ export function buildCli(options) {
|
|
|
361
367
|
demandOption: true
|
|
362
368
|
}).example('$0 project rm my-project', 'Remove a project configuration');
|
|
363
369
|
}, function(argv) {
|
|
364
|
-
|
|
365
|
-
|
|
370
|
+
render(React.createElement(ProjectRemove, {
|
|
371
|
+
name: argv.name,
|
|
372
|
+
projectConfig: configManager
|
|
373
|
+
}));
|
|
366
374
|
}).demandCommand(1, 'You need to specify a project command (add, select, list, show, rm) in Local Dev Mode.');
|
|
367
375
|
return yargsProject;
|
|
368
376
|
});
|
|
@@ -375,8 +383,9 @@ export function buildCli(options) {
|
|
|
375
383
|
demandOption: true
|
|
376
384
|
});
|
|
377
385
|
}, function(argv) {
|
|
378
|
-
|
|
379
|
-
|
|
386
|
+
render(React.createElement(ProjectCreate, {
|
|
387
|
+
projectPathArg: argv.name
|
|
388
|
+
}));
|
|
380
389
|
});
|
|
381
390
|
}
|
|
382
391
|
// --- Add the Server Command ---
|
|
@@ -454,9 +463,8 @@ export function buildCli(options) {
|
|
|
454
463
|
});
|
|
455
464
|
}
|
|
456
465
|
// --- List Brains Command ---
|
|
457
|
-
cli = cli.command('list', 'List all brains in the active project\n', function() {}, function(
|
|
458
|
-
|
|
459
|
-
render(element);
|
|
466
|
+
cli = cli.command('list', 'List all brains in the active project\n', function() {}, function() {
|
|
467
|
+
render(React.createElement(BrainList));
|
|
460
468
|
});
|
|
461
469
|
// --- Brain History Command ---
|
|
462
470
|
cli = cli.command('history <brain>', 'List recent runs of a specific brain\n', function(yargsHistory) {
|
|
@@ -470,8 +478,15 @@ export function buildCli(options) {
|
|
|
470
478
|
default: 10
|
|
471
479
|
}).example('$0 history my-brain', 'List recent runs for my-brain').example('$0 history "My Brain Title"', 'Search by title').example('$0 history my-brain --limit=20', 'List more recent runs');
|
|
472
480
|
}, function(argv) {
|
|
473
|
-
|
|
474
|
-
|
|
481
|
+
render(React.createElement(BrainResolver, {
|
|
482
|
+
identifier: argv.brain,
|
|
483
|
+
children: function(resolvedBrainTitle) {
|
|
484
|
+
return React.createElement(BrainHistory, {
|
|
485
|
+
brainName: resolvedBrainTitle,
|
|
486
|
+
limit: argv.limit
|
|
487
|
+
});
|
|
488
|
+
}
|
|
489
|
+
}));
|
|
475
490
|
});
|
|
476
491
|
// --- Show Brain/Run Command ---
|
|
477
492
|
cli = cli.command('show [brain]', 'Show information about a brain or a specific run\n', function(yargsShow) {
|
|
@@ -493,8 +508,24 @@ export function buildCli(options) {
|
|
|
493
508
|
return true;
|
|
494
509
|
}).example('$0 show my-brain', 'Show info about my-brain').example('$0 show my-brain --steps', 'Show my-brain with step structure').example('$0 show --run-id abc123', 'Show details for a specific run');
|
|
495
510
|
}, function(argv) {
|
|
496
|
-
|
|
497
|
-
|
|
511
|
+
if (argv.runId) {
|
|
512
|
+
render(React.createElement(RunShow, {
|
|
513
|
+
runId: argv.runId
|
|
514
|
+
}));
|
|
515
|
+
} else if (argv.brain) {
|
|
516
|
+
render(React.createElement(BrainShow, {
|
|
517
|
+
identifier: argv.brain,
|
|
518
|
+
showSteps: argv.steps || false
|
|
519
|
+
}));
|
|
520
|
+
} else {
|
|
521
|
+
render(React.createElement(ErrorComponent, {
|
|
522
|
+
error: {
|
|
523
|
+
title: 'Missing Argument',
|
|
524
|
+
message: 'You must provide either a brain identifier or a run ID.',
|
|
525
|
+
details: 'Use: show <brain> to show brain info, or show --run-id <id> to show run info.'
|
|
526
|
+
}
|
|
527
|
+
}));
|
|
528
|
+
}
|
|
498
529
|
});
|
|
499
530
|
// --- Rerun Brain Command ---
|
|
500
531
|
cli = cli.command([
|
|
@@ -511,8 +542,10 @@ export function buildCli(options) {
|
|
|
511
542
|
demandOption: true
|
|
512
543
|
}).alias('starts-at', 's').example('$0 rerun abc123 --starts-at=3', 'Rerun from step 3');
|
|
513
544
|
}, function(argv) {
|
|
514
|
-
|
|
515
|
-
|
|
545
|
+
render(React.createElement(BrainRerun, {
|
|
546
|
+
runId: argv.runId,
|
|
547
|
+
startsAt: argv.startsAt
|
|
548
|
+
}));
|
|
516
549
|
});
|
|
517
550
|
// --- Run Brain Command ---
|
|
518
551
|
cli = cli.command([
|
|
@@ -561,10 +594,12 @@ export function buildCli(options) {
|
|
|
561
594
|
} else if (argv.state) {
|
|
562
595
|
initialState = argv.state;
|
|
563
596
|
}
|
|
564
|
-
|
|
597
|
+
render(React.createElement(BrainRun, {
|
|
598
|
+
identifier: argv.brain,
|
|
599
|
+
watch: argv.watch,
|
|
600
|
+
options: argv.options,
|
|
565
601
|
initialState: initialState
|
|
566
602
|
}));
|
|
567
|
-
render(element);
|
|
568
603
|
});
|
|
569
604
|
// --- Watch Brain Run Command ---
|
|
570
605
|
cli = cli.command('watch <identifier>', 'Watch a brain run by brain name or run ID\n', function(yargsWatch) {
|
|
@@ -579,8 +614,10 @@ export function buildCli(options) {
|
|
|
579
614
|
default: false
|
|
580
615
|
}).example('$0 watch my-brain', "Watch the latest run of the brain named 'my-brain'").example('$0 watch abc123def', 'Watch a specific brain run by its ID').example('$0 watch my-brain --events', 'Watch with events log view');
|
|
581
616
|
}, function(argv) {
|
|
582
|
-
|
|
583
|
-
|
|
617
|
+
render(React.createElement(WatchResolver, {
|
|
618
|
+
identifier: argv.identifier,
|
|
619
|
+
startWithEvents: argv.events
|
|
620
|
+
}));
|
|
584
621
|
});
|
|
585
622
|
// --- Top Command (view running brains) ---
|
|
586
623
|
cli = cli.command('top [brain]', 'View live status of all running brains\n', function(yargsTop) {
|
|
@@ -589,14 +626,14 @@ export function buildCli(options) {
|
|
|
589
626
|
type: 'string'
|
|
590
627
|
}).example('$0 top', 'View all running brains').example('$0 top my-brain', 'View running brains matching "my-brain"');
|
|
591
628
|
}, function(argv) {
|
|
592
|
-
|
|
593
|
-
|
|
629
|
+
render(React.createElement(TopNavigator, {
|
|
630
|
+
brainFilter: argv.brain
|
|
631
|
+
}));
|
|
594
632
|
});
|
|
595
633
|
// --- Brain Commands ---
|
|
596
634
|
cli = cli.command('brain', 'Manage your brains\n', function(yargsBrain) {
|
|
597
|
-
yargsBrain.command('list', 'List all brains in the active project\n', function() {}, function(
|
|
598
|
-
|
|
599
|
-
render(element);
|
|
635
|
+
yargsBrain.command('list', 'List all brains in the active project\n', function() {}, function() {
|
|
636
|
+
render(React.createElement(BrainList));
|
|
600
637
|
}).command('history <brain>', 'List recent runs of a specific brain\n', function(yargsHistory) {
|
|
601
638
|
return yargsHistory.positional('brain', {
|
|
602
639
|
describe: 'Brain identifier (title, filename, or search term)',
|
|
@@ -608,8 +645,15 @@ export function buildCli(options) {
|
|
|
608
645
|
default: 10
|
|
609
646
|
}).example('$0 brain history my-brain', 'List recent runs for my-brain').example('$0 brain history my-brain --limit=20', 'List more recent runs');
|
|
610
647
|
}, function(argv) {
|
|
611
|
-
|
|
612
|
-
|
|
648
|
+
render(React.createElement(BrainResolver, {
|
|
649
|
+
identifier: argv.brain,
|
|
650
|
+
children: function(resolvedBrainTitle) {
|
|
651
|
+
return React.createElement(BrainHistory, {
|
|
652
|
+
brainName: resolvedBrainTitle,
|
|
653
|
+
limit: argv.limit
|
|
654
|
+
});
|
|
655
|
+
}
|
|
656
|
+
}));
|
|
613
657
|
}).command('show [brain]', 'Show information about a brain or a specific run\n', function(yargsShow) {
|
|
614
658
|
return yargsShow.positional('brain', {
|
|
615
659
|
describe: 'Brain identifier to show info for',
|
|
@@ -629,8 +673,24 @@ export function buildCli(options) {
|
|
|
629
673
|
return true;
|
|
630
674
|
}).example('$0 brain show my-brain', 'Show info about my-brain').example('$0 brain show my-brain --steps', 'Show my-brain with step structure').example('$0 brain show --run-id abc123', 'Show details for a specific run');
|
|
631
675
|
}, function(argv) {
|
|
632
|
-
|
|
633
|
-
|
|
676
|
+
if (argv.runId) {
|
|
677
|
+
render(React.createElement(RunShow, {
|
|
678
|
+
runId: argv.runId
|
|
679
|
+
}));
|
|
680
|
+
} else if (argv.brain) {
|
|
681
|
+
render(React.createElement(BrainShow, {
|
|
682
|
+
identifier: argv.brain,
|
|
683
|
+
showSteps: argv.steps || false
|
|
684
|
+
}));
|
|
685
|
+
} else {
|
|
686
|
+
render(React.createElement(ErrorComponent, {
|
|
687
|
+
error: {
|
|
688
|
+
title: 'Missing Argument',
|
|
689
|
+
message: 'You must provide either a brain identifier or a run ID.',
|
|
690
|
+
details: 'Use: show <brain> to show brain info, or show --run-id <id> to show run info.'
|
|
691
|
+
}
|
|
692
|
+
}));
|
|
693
|
+
}
|
|
634
694
|
}).command([
|
|
635
695
|
'rerun <run-id>',
|
|
636
696
|
'rr <run-id>'
|
|
@@ -645,8 +705,10 @@ export function buildCli(options) {
|
|
|
645
705
|
demandOption: true
|
|
646
706
|
}).alias('starts-at', 's').example('$0 brain rerun abc123 --starts-at=3', 'Rerun from step 3');
|
|
647
707
|
}, function(argv) {
|
|
648
|
-
|
|
649
|
-
|
|
708
|
+
render(React.createElement(BrainRerun, {
|
|
709
|
+
runId: argv.runId,
|
|
710
|
+
startsAt: argv.startsAt
|
|
711
|
+
}));
|
|
650
712
|
}).command('run <brain>', 'Run a brain and optionally watch its execution\n', function(yargsRun) {
|
|
651
713
|
return yargsRun.positional('brain', {
|
|
652
714
|
describe: 'Brain identifier (title, filename, or search term)',
|
|
@@ -690,10 +752,12 @@ export function buildCli(options) {
|
|
|
690
752
|
} else if (argv.state) {
|
|
691
753
|
initialState = argv.state;
|
|
692
754
|
}
|
|
693
|
-
|
|
755
|
+
render(React.createElement(BrainRun, {
|
|
756
|
+
identifier: argv.brain,
|
|
757
|
+
watch: argv.watch,
|
|
758
|
+
options: argv.options,
|
|
694
759
|
initialState: initialState
|
|
695
760
|
}));
|
|
696
|
-
render(element);
|
|
697
761
|
}).command('watch <identifier>', 'Watch a brain run by brain name or run ID\n', function(yargsWatch) {
|
|
698
762
|
return yargsWatch.positional('identifier', {
|
|
699
763
|
describe: 'Brain name or run ID to watch',
|
|
@@ -706,8 +770,10 @@ export function buildCli(options) {
|
|
|
706
770
|
default: false
|
|
707
771
|
}).example('$0 brain watch my-brain', "Watch the latest run of the brain named 'my-brain'").example('$0 brain watch abc123def', 'Watch a specific brain run by its ID').example('$0 brain watch my-brain --events', 'Watch with events log view');
|
|
708
772
|
}, function(argv) {
|
|
709
|
-
|
|
710
|
-
|
|
773
|
+
render(React.createElement(WatchResolver, {
|
|
774
|
+
identifier: argv.identifier,
|
|
775
|
+
startWithEvents: argv.events
|
|
776
|
+
}));
|
|
711
777
|
}).command('kill <run-id>', 'Kill a running brain\n', function(yargsKill) {
|
|
712
778
|
return yargsKill.positional('run-id', {
|
|
713
779
|
describe: 'ID of the brain run to kill',
|
|
@@ -720,64 +786,64 @@ export function buildCli(options) {
|
|
|
720
786
|
default: false
|
|
721
787
|
}).example('$0 brain kill abc123def', 'Kill a running brain by its run ID').example('$0 brain kill abc123def --force', 'Kill a brain without confirmation');
|
|
722
788
|
}, function(argv) {
|
|
723
|
-
|
|
724
|
-
|
|
789
|
+
render(React.createElement(BrainKill, {
|
|
790
|
+
runId: argv.runId,
|
|
791
|
+
force: argv.force
|
|
792
|
+
}));
|
|
725
793
|
}).command('top [brain]', 'View live status of all running brains\n', function(yargsTop) {
|
|
726
794
|
return yargsTop.positional('brain', {
|
|
727
795
|
describe: 'Filter to brains matching this name',
|
|
728
796
|
type: 'string'
|
|
729
797
|
}).example('$0 brain top', 'View all running brains').example('$0 brain top my-brain', 'View running brains matching "my-brain"');
|
|
730
798
|
}, function(argv) {
|
|
731
|
-
|
|
732
|
-
|
|
799
|
+
render(React.createElement(TopNavigator, {
|
|
800
|
+
brainFilter: argv.brain
|
|
801
|
+
}));
|
|
733
802
|
}).demandCommand(1, 'You need to specify a brain command (list, history, show, rerun, run, watch, kill, top).');
|
|
734
803
|
return yargsBrain;
|
|
735
804
|
});
|
|
736
805
|
// --- Resource Management Commands ---
|
|
737
806
|
cli = cli.command('resources', 'Resources are any data that can be used in your brains, agents, and prompts. They can be text or binaries.\n', function(yargsResource) {
|
|
738
|
-
var resourcesCommand = new ResourcesCommand(server);
|
|
739
807
|
yargsResource.command('list', 'List all resources in the active project\n', function(yargsListCmd) {
|
|
740
808
|
return yargsListCmd.example('$0 resources list', 'List all resources in the active project');
|
|
741
809
|
}, function() {
|
|
742
|
-
|
|
743
|
-
render(element);
|
|
810
|
+
render(React.createElement(ResourceList));
|
|
744
811
|
});
|
|
745
812
|
// Command available ONLY in Local Dev Mode
|
|
746
813
|
yargsResource.command('sync', 'Sync local resources folder with the server so they are available to brains when they run\n', function(yargsSyncCmd) {
|
|
747
814
|
return yargsSyncCmd.example('$0 resources sync', 'Upload new or modified resources to the server');
|
|
748
815
|
}, function() {
|
|
749
|
-
|
|
750
|
-
|
|
816
|
+
if (!server) {
|
|
817
|
+
renderLocalDevOnly();
|
|
818
|
+
return;
|
|
819
|
+
}
|
|
820
|
+
var resourcesDir = join(server.projectRootDir, 'resources');
|
|
821
|
+
if (!existsSync(resourcesDir)) {
|
|
822
|
+
mkdirSync(resourcesDir, {
|
|
823
|
+
recursive: true
|
|
824
|
+
});
|
|
825
|
+
}
|
|
826
|
+
var localResources = scanLocalResources(resourcesDir);
|
|
827
|
+
render(React.createElement(ResourceSync, {
|
|
828
|
+
localResources: localResources,
|
|
829
|
+
resourcesDir: resourcesDir
|
|
830
|
+
}));
|
|
751
831
|
});
|
|
752
832
|
yargsResource.command('types', 'Generate TypeScript type definitions for resources\n', function(yargsTypesCmd) {
|
|
753
833
|
return yargsTypesCmd.example('$0 resources types', 'Generate a resources.d.ts file with type definitions for all resources');
|
|
754
834
|
}, function() {
|
|
755
|
-
|
|
756
|
-
|
|
835
|
+
if (!server) {
|
|
836
|
+
renderLocalDevOnly();
|
|
837
|
+
return;
|
|
838
|
+
}
|
|
839
|
+
render(React.createElement(ResourceTypes, {
|
|
840
|
+
projectRootDir: server.projectRootDir
|
|
841
|
+
}));
|
|
757
842
|
});
|
|
758
843
|
yargsResource.command('clear', 'Delete ALL resources from the server (development only)\n', function(yargsClearCmd) {
|
|
759
844
|
return yargsClearCmd.example('$0 resources clear', 'Delete all resources from the server');
|
|
760
845
|
}, function() {
|
|
761
|
-
|
|
762
|
-
var element;
|
|
763
|
-
return _ts_generator(this, function(_state) {
|
|
764
|
-
switch(_state.label){
|
|
765
|
-
case 0:
|
|
766
|
-
return [
|
|
767
|
-
4,
|
|
768
|
-
resourcesCommand.clear()
|
|
769
|
-
];
|
|
770
|
-
case 1:
|
|
771
|
-
element = _state.sent();
|
|
772
|
-
if (element) {
|
|
773
|
-
render(element);
|
|
774
|
-
}
|
|
775
|
-
return [
|
|
776
|
-
2
|
|
777
|
-
];
|
|
778
|
-
}
|
|
779
|
-
});
|
|
780
|
-
})();
|
|
846
|
+
render(React.createElement(ResourceClear));
|
|
781
847
|
});
|
|
782
848
|
// Upload/delete command available in both dev and production modes
|
|
783
849
|
yargsResource.command('upload <file>', 'Upload a file as a resource, or delete with -d flag\n', function(yargsUploadCmd) {
|
|
@@ -802,11 +868,18 @@ export function buildCli(options) {
|
|
|
802
868
|
}).example('$0 resources upload video.mp4', 'Upload a video file').example('$0 resources upload /path/to/large-file.zip --key archive/backup.zip', 'Upload with custom resource key').example('$0 resources upload -d video.mp4', 'Delete the resource with key "video.mp4"').example('$0 resources upload -d archive/backup.zip', 'Delete a resource with a nested key').example('$0 resources upload -d -f video.mp4', 'Delete a resource without confirmation');
|
|
803
869
|
}, function(argv) {
|
|
804
870
|
if (argv.delete) {
|
|
805
|
-
|
|
806
|
-
|
|
871
|
+
render(React.createElement(ResourceDelete, {
|
|
872
|
+
resourceKey: argv.file,
|
|
873
|
+
resourcePath: argv.file,
|
|
874
|
+
projectRootPath: server === null || server === void 0 ? void 0 : server.projectRootDir,
|
|
875
|
+
force: argv.force
|
|
876
|
+
}));
|
|
807
877
|
} else {
|
|
808
|
-
|
|
809
|
-
|
|
878
|
+
render(React.createElement(ResourceUpload, {
|
|
879
|
+
filePath: argv.file,
|
|
880
|
+
customKey: argv.key,
|
|
881
|
+
projectRootPath: server === null || server === void 0 ? void 0 : server.projectRootDir
|
|
882
|
+
}));
|
|
810
883
|
}
|
|
811
884
|
});
|
|
812
885
|
return yargsResource.demandCommand(1, 'You need to specify a resources command');
|
|
@@ -851,7 +924,7 @@ export function buildCli(options) {
|
|
|
851
924
|
// Handle top-level list/delete options
|
|
852
925
|
yargsSchedule.middleware(function(argv) {
|
|
853
926
|
return _async_to_generator(function() {
|
|
854
|
-
var
|
|
927
|
+
var result, result1;
|
|
855
928
|
return _ts_generator(this, function(_state) {
|
|
856
929
|
switch(_state.label){
|
|
857
930
|
case 0:
|
|
@@ -859,10 +932,9 @@ export function buildCli(options) {
|
|
|
859
932
|
3,
|
|
860
933
|
3
|
|
861
934
|
];
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
});
|
|
865
|
-
result = render(element);
|
|
935
|
+
result = render(React.createElement(ScheduleList, {
|
|
936
|
+
brainFilter: argv.brain
|
|
937
|
+
}));
|
|
866
938
|
if (!(result && typeof result.waitUntilExit === 'function')) return [
|
|
867
939
|
3,
|
|
868
940
|
2
|
|
@@ -883,11 +955,10 @@ export function buildCli(options) {
|
|
|
883
955
|
3,
|
|
884
956
|
6
|
|
885
957
|
];
|
|
886
|
-
|
|
958
|
+
result1 = render(React.createElement(ScheduleDelete, {
|
|
887
959
|
scheduleId: argv.delete,
|
|
888
960
|
force: argv.force
|
|
889
|
-
});
|
|
890
|
-
result1 = render(element1);
|
|
961
|
+
}));
|
|
891
962
|
if (!(result1 && typeof result1.waitUntilExit === 'function')) return [
|
|
892
963
|
3,
|
|
893
964
|
5
|
|
@@ -956,18 +1027,26 @@ export function buildCli(options) {
|
|
|
956
1027
|
} else if (argv.state) {
|
|
957
1028
|
initialState = argv.state;
|
|
958
1029
|
}
|
|
959
|
-
|
|
960
|
-
|
|
1030
|
+
render(React.createElement(BrainResolver, {
|
|
1031
|
+
identifier: argv.brain,
|
|
1032
|
+
children: function(resolvedBrainTitle) {
|
|
1033
|
+
return React.createElement(ScheduleCreate, {
|
|
1034
|
+
identifier: resolvedBrainTitle,
|
|
1035
|
+
cronExpression: argv.cronExpression,
|
|
1036
|
+
options: argv.options,
|
|
1037
|
+
initialState: initialState
|
|
1038
|
+
});
|
|
1039
|
+
}
|
|
961
1040
|
}));
|
|
962
|
-
render(element);
|
|
963
1041
|
}).command('timezone [timezone]', 'Get or set the project timezone for schedules\n', function(yargsTimezone) {
|
|
964
1042
|
return yargsTimezone.positional('timezone', {
|
|
965
1043
|
describe: 'IANA timezone (e.g., "America/Chicago", "Europe/London")',
|
|
966
1044
|
type: 'string'
|
|
967
1045
|
}).example('$0 schedule timezone', 'Show current project timezone').example('$0 schedule timezone America/Chicago', 'Set timezone to Central');
|
|
968
1046
|
}, function(argv) {
|
|
969
|
-
|
|
970
|
-
|
|
1047
|
+
render(React.createElement(ScheduleTimezone, {
|
|
1048
|
+
timezone: argv.timezone
|
|
1049
|
+
}));
|
|
971
1050
|
}).command('runs', 'List scheduled run history\n', function(yargsRuns) {
|
|
972
1051
|
return yargsRuns.option('schedule-id', {
|
|
973
1052
|
describe: 'Filter runs by schedule ID',
|
|
@@ -988,16 +1067,18 @@ export function buildCli(options) {
|
|
|
988
1067
|
]
|
|
989
1068
|
}).example('$0 schedule runs', 'List recent scheduled runs').example('$0 schedule runs --schedule-id abc123', 'List runs for a specific schedule').example('$0 schedule runs --status failed --limit 50', 'List last 50 failed scheduled runs');
|
|
990
1069
|
}, function(argv) {
|
|
991
|
-
|
|
992
|
-
|
|
1070
|
+
render(React.createElement(ScheduleRuns, {
|
|
1071
|
+
scheduleId: argv.scheduleId,
|
|
1072
|
+
limit: argv.limit,
|
|
1073
|
+
status: argv.status
|
|
1074
|
+
}));
|
|
993
1075
|
});
|
|
994
1076
|
return yargsSchedule;
|
|
995
1077
|
});
|
|
996
1078
|
// --- Pages Management Commands ---
|
|
997
1079
|
cli = cli.command('pages', 'Manage pages created by brains\n', function(yargsPages) {
|
|
998
|
-
yargsPages.command('list', 'List all pages\n', {}, function(
|
|
999
|
-
|
|
1000
|
-
render(element);
|
|
1080
|
+
yargsPages.command('list', 'List all pages\n', {}, function() {
|
|
1081
|
+
render(React.createElement(PagesList));
|
|
1001
1082
|
}).command('delete <slug>', 'Delete a page by slug\n', function(yargsDelete) {
|
|
1002
1083
|
return yargsDelete.positional('slug', {
|
|
1003
1084
|
describe: 'Slug of the page to delete',
|
|
@@ -1010,16 +1091,17 @@ export function buildCli(options) {
|
|
|
1010
1091
|
default: false
|
|
1011
1092
|
}).example('$0 pages delete my-page', 'Delete a page by slug').example('$0 pages delete my-page --force', 'Delete without confirmation');
|
|
1012
1093
|
}, function(argv) {
|
|
1013
|
-
|
|
1014
|
-
|
|
1094
|
+
render(React.createElement(PageDelete, {
|
|
1095
|
+
slug: argv.slug,
|
|
1096
|
+
force: argv.force
|
|
1097
|
+
}));
|
|
1015
1098
|
}).demandCommand(1, 'You need to specify a subcommand');
|
|
1016
1099
|
return yargsPages;
|
|
1017
1100
|
});
|
|
1018
1101
|
// --- Secrets Management Commands ---
|
|
1019
1102
|
cli = cli.command('secrets', 'Manage secrets for your brains\n', function(yargsSecret) {
|
|
1020
1103
|
yargsSecret.command('list', 'List all secrets\n', {}, function() {
|
|
1021
|
-
|
|
1022
|
-
render(element);
|
|
1104
|
+
render(React.createElement(SecretsList));
|
|
1023
1105
|
}).command('create <name>', 'Create a new secret\n', function(yargsCreate) {
|
|
1024
1106
|
return yargsCreate.positional('name', {
|
|
1025
1107
|
describe: 'Name of the secret (e.g., ANTHROPIC_API_KEY)',
|
|
@@ -1030,8 +1112,10 @@ export function buildCli(options) {
|
|
|
1030
1112
|
type: 'string'
|
|
1031
1113
|
}).example('$0 secrets create ANTHROPIC_API_KEY', 'Create a secret with secure input').example('$0 secrets create DATABASE_URL --value "postgres://..."', 'Create a secret with direct value (not recommended)');
|
|
1032
1114
|
}, function(argv) {
|
|
1033
|
-
|
|
1034
|
-
|
|
1115
|
+
render(React.createElement(SecretsCreate, {
|
|
1116
|
+
name: argv.name,
|
|
1117
|
+
value: argv.value
|
|
1118
|
+
}));
|
|
1035
1119
|
}).command('delete <name>', 'Delete a secret\n', function(yargsDelete) {
|
|
1036
1120
|
return yargsDelete.positional('name', {
|
|
1037
1121
|
describe: 'Name of the secret to delete',
|
|
@@ -1039,24 +1123,25 @@ export function buildCli(options) {
|
|
|
1039
1123
|
demandOption: true
|
|
1040
1124
|
}).example('$0 secrets delete ANTHROPIC_API_KEY', 'Delete a secret');
|
|
1041
1125
|
}, function(argv) {
|
|
1042
|
-
|
|
1043
|
-
|
|
1126
|
+
render(React.createElement(SecretsDelete, {
|
|
1127
|
+
name: argv.name
|
|
1128
|
+
}));
|
|
1044
1129
|
}).command('bulk [file]', 'Bulk upload secrets from a .env file\n', function(yargsBulk) {
|
|
1045
1130
|
return yargsBulk.positional('file', {
|
|
1046
1131
|
describe: 'Path to the .env file (defaults to .env in project root)',
|
|
1047
1132
|
type: 'string'
|
|
1048
1133
|
}).example('$0 secrets bulk', 'Upload secrets from .env file in project root').example('$0 secrets bulk .env.production', 'Upload secrets from a specific .env file');
|
|
1049
1134
|
}, function(argv) {
|
|
1050
|
-
|
|
1051
|
-
|
|
1135
|
+
render(React.createElement(SecretsBulk, {
|
|
1136
|
+
file: argv.file
|
|
1137
|
+
}));
|
|
1052
1138
|
}).demandCommand(1, 'You need to specify a subcommand');
|
|
1053
1139
|
return yargsSecret;
|
|
1054
1140
|
});
|
|
1055
1141
|
// --- User Management Commands ---
|
|
1056
1142
|
cli = cli.command('users', 'Manage users and SSH keys for authentication\n', function(yargsUsers) {
|
|
1057
1143
|
yargsUsers.command('list', 'List all users\n', {}, function() {
|
|
1058
|
-
|
|
1059
|
-
render(element);
|
|
1144
|
+
render(React.createElement(UsersList));
|
|
1060
1145
|
}).command('create <name>', 'Create a new user\n', function(yargsCreate) {
|
|
1061
1146
|
return yargsCreate.positional('name', {
|
|
1062
1147
|
describe: 'Name of the user',
|
|
@@ -1064,8 +1149,9 @@ export function buildCli(options) {
|
|
|
1064
1149
|
demandOption: true
|
|
1065
1150
|
}).example('$0 users create admin', 'Create a user named admin');
|
|
1066
1151
|
}, function(argv) {
|
|
1067
|
-
|
|
1068
|
-
|
|
1152
|
+
render(React.createElement(UsersCreate, {
|
|
1153
|
+
name: argv.name
|
|
1154
|
+
}));
|
|
1069
1155
|
}).command('delete <name>', 'Delete a user\n', function(yargsDelete) {
|
|
1070
1156
|
return yargsDelete.positional('name', {
|
|
1071
1157
|
describe: 'Name of the user to delete',
|
|
@@ -1078,8 +1164,10 @@ export function buildCli(options) {
|
|
|
1078
1164
|
default: false
|
|
1079
1165
|
}).example('$0 users delete admin', 'Delete a user').example('$0 users delete admin --force', 'Delete without confirmation');
|
|
1080
1166
|
}, function(argv) {
|
|
1081
|
-
|
|
1082
|
-
|
|
1167
|
+
render(React.createElement(UsersDelete, {
|
|
1168
|
+
userName: argv.name,
|
|
1169
|
+
force: argv.force
|
|
1170
|
+
}));
|
|
1083
1171
|
}).command('list-keys <name>', 'List keys for a user\n', function(yargsKeysList) {
|
|
1084
1172
|
return yargsKeysList.positional('name', {
|
|
1085
1173
|
describe: 'Name of the user',
|
|
@@ -1087,8 +1175,9 @@ export function buildCli(options) {
|
|
|
1087
1175
|
demandOption: true
|
|
1088
1176
|
}).example('$0 users list-keys admin', 'List keys for a user');
|
|
1089
1177
|
}, function(argv) {
|
|
1090
|
-
|
|
1091
|
-
|
|
1178
|
+
render(React.createElement(UsersKeysList, {
|
|
1179
|
+
userName: argv.name
|
|
1180
|
+
}));
|
|
1092
1181
|
}).command('add-key <name> [pubkey-path]', 'Add an SSH public key to a user\n', function(yargsAdd) {
|
|
1093
1182
|
return yargsAdd.positional('name', {
|
|
1094
1183
|
describe: 'Name of the user',
|
|
@@ -1112,8 +1201,12 @@ export function buildCli(options) {
|
|
|
1112
1201
|
return true;
|
|
1113
1202
|
}).example('$0 users add-key admin ~/.ssh/id_ed25519.pub', 'Add an SSH public key').example('$0 users add-key admin --paste', 'Paste a public key interactively').example('$0 users add-key admin ~/.ssh/id_ed25519.pub --label laptop', 'Add key with label');
|
|
1114
1203
|
}, function(argv) {
|
|
1115
|
-
|
|
1116
|
-
|
|
1204
|
+
render(React.createElement(UsersKeysAdd, {
|
|
1205
|
+
userName: argv.name,
|
|
1206
|
+
pubkeyPath: argv.pubkeyPath,
|
|
1207
|
+
paste: argv.paste,
|
|
1208
|
+
label: argv.label
|
|
1209
|
+
}));
|
|
1117
1210
|
}).command('remove-key <name> <fingerprint>', 'Remove a key from a user\n', function(yargsRemove) {
|
|
1118
1211
|
return yargsRemove.positional('name', {
|
|
1119
1212
|
describe: 'Name of the user',
|
|
@@ -1130,19 +1223,19 @@ export function buildCli(options) {
|
|
|
1130
1223
|
default: false
|
|
1131
1224
|
}).example('$0 users remove-key admin SHA256:...', 'Remove a key');
|
|
1132
1225
|
}, function(argv) {
|
|
1133
|
-
|
|
1134
|
-
|
|
1226
|
+
render(React.createElement(UsersKeysRemove, {
|
|
1227
|
+
userName: argv.name,
|
|
1228
|
+
fingerprint: argv.fingerprint,
|
|
1229
|
+
force: argv.force
|
|
1230
|
+
}));
|
|
1135
1231
|
}).demandCommand(1, 'You need to specify a users command (list, create, delete, list-keys, add-key, remove-key)');
|
|
1136
1232
|
return yargsUsers;
|
|
1137
1233
|
});
|
|
1138
1234
|
// --- Store Explorer Command ---
|
|
1139
|
-
var storeCommand = new StoreCommand();
|
|
1140
1235
|
cli = cli.command('store', 'Browse and manage brain store data\n', function() {}, function() {
|
|
1141
|
-
|
|
1142
|
-
render(element);
|
|
1236
|
+
render(React.createElement(StoreExplorer));
|
|
1143
1237
|
});
|
|
1144
1238
|
// --- Auth Commands (Top-level) ---
|
|
1145
|
-
var authCommand = new AuthCommand(undefined, projectRootPath);
|
|
1146
1239
|
cli = cli.command('login', 'Configure SSH key for authentication\n', function(yargsLogin) {
|
|
1147
1240
|
return yargsLogin.option('path', {
|
|
1148
1241
|
describe: 'Path to SSH private key',
|
|
@@ -1154,8 +1247,12 @@ export function buildCli(options) {
|
|
|
1154
1247
|
default: false
|
|
1155
1248
|
}).example('$0 login', 'Interactive key selection').example('$0 login --path ~/.ssh/id_ed25519', 'Set key directly').example('$0 login --project', 'Set key for current project');
|
|
1156
1249
|
}, function(argv) {
|
|
1157
|
-
|
|
1158
|
-
|
|
1250
|
+
render(React.createElement(AuthLogin, {
|
|
1251
|
+
configManager: configManager,
|
|
1252
|
+
keyPath: argv.path,
|
|
1253
|
+
forProject: argv.project || false,
|
|
1254
|
+
projectRootPath: projectRootPath
|
|
1255
|
+
}));
|
|
1159
1256
|
});
|
|
1160
1257
|
cli = cli.command('logout', 'Clear SSH key configuration\n', function(yargsLogout) {
|
|
1161
1258
|
return yargsLogout.option('project', {
|
|
@@ -1164,12 +1261,17 @@ export function buildCli(options) {
|
|
|
1164
1261
|
default: false
|
|
1165
1262
|
}).example('$0 logout', 'Clear global key configuration').example('$0 logout --project', 'Clear project-specific key');
|
|
1166
1263
|
}, function(argv) {
|
|
1167
|
-
|
|
1168
|
-
|
|
1264
|
+
render(React.createElement(AuthLogout, {
|
|
1265
|
+
configManager: configManager,
|
|
1266
|
+
forProject: argv.project || false,
|
|
1267
|
+
projectRootPath: projectRootPath
|
|
1268
|
+
}));
|
|
1169
1269
|
});
|
|
1170
1270
|
cli = cli.command('whoami', 'Show your current authenticated identity\n', function() {}, function() {
|
|
1171
|
-
|
|
1172
|
-
|
|
1271
|
+
render(React.createElement(Whoami, {
|
|
1272
|
+
configManager: configManager,
|
|
1273
|
+
projectRootPath: projectRootPath
|
|
1274
|
+
}));
|
|
1173
1275
|
});
|
|
1174
1276
|
cli = cli.epilogue('For more information, visit https://positronic.sh');
|
|
1175
1277
|
return cli;
|