forked from aws/agentcore-cli
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcommand.tsx
More file actions
55 lines (45 loc) · 1.66 KB
/
Copy pathcommand.tsx
File metadata and controls
55 lines (45 loc) · 1.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
import type { Command } from '@commander-js/extra-typings';
const MODES_HELP = `
INTERACTIVE MODE (TUI)
Run any command without flags to launch the interactive terminal UI.
Features:
• Guided prompts walk you through options
• Real-time streaming for invoke and dev
• Visual feedback and progress indicators
Examples:
agentcore # Launch main menu
agentcore create # Guided project creation
agentcore add # Add resources interactively
agentcore invoke # Chat with deployed agent
NON-INTERACTIVE MODE (CLI)
Pass any flag marked [non-interactive] to run in CLI mode.
Features:
• Scriptable for CI/CD pipelines
• JSON output with --json flag
• No prompts - fails fast on missing required options
Examples:
agentcore create --name MyProject --defaults --json
agentcore deploy --target prod --yes
agentcore invoke "Hello" --stream
agentcore remove agent --name OldAgent --yes
FLAGS THAT TRIGGER CLI MODE
Most flags trigger non-interactive mode, including:
--name, --json, --yes, --target, --stream, etc.
Some flags work in both modes:
--session-id (invoke), --port (dev), --runtime (dev)
`;
export const registerHelp = (program: Command) => {
const helpCmd = program
.command('help')
.description('Display help topics')
.action(() => {
console.log('Available help topics: modes');
console.log('Run `agentcore help <topic>` for details.');
});
helpCmd
.command('modes')
.description('Explain interactive vs non-interactive modes')
.action(() => {
console.log(MODES_HELP);
});
};