Skip to content

Commit 9535d69

Browse files
committed
Update CLI invocation arguments for coding agents to specify plan and sandbox modes
- assess if ask args of all providers force read only (check google for the right flag), it should └── apps └── editor └── src └── utils └── agentic-cli-invocation └── agents ├── antigravity.ts ├── claude.ts ├── codex.ts ├── cursor.ts ├── grok.ts ├── index.ts ├── muse.ts └── opencode.ts
1 parent 958e2d1 commit 9535d69

7 files changed

Lines changed: 49 additions & 9 deletions

File tree

‎apps/editor/src/utils/agentic-cli-invocation/agents/antigravity.ts‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,12 @@ export const antigravity_agent: CodingAgent = {
2121
'stream-json',
2222
'--dangerously-skip-permissions'
2323
],
24-
get_ask_args: (prompt: string) => ['-i', prompt],
24+
get_ask_args: (prompt: string) => [
25+
'-i',
26+
prompt,
27+
'--mode',
28+
'plan'
29+
],
2530
parse_stream_line: (parsed, report_progress) => {
2631
if (parsed.event == 'step_update' && parsed.step_update) {
2732
const step = parsed.step_update

‎apps/editor/src/utils/agentic-cli-invocation/agents/claude.ts‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,11 @@ export const claude_agent: CodingAgent = {
4040
'--permission-mode',
4141
'auto'
4242
],
43-
get_ask_args: (prompt: string) => [prompt],
43+
get_ask_args: (prompt: string) => [
44+
prompt,
45+
'--permission-mode',
46+
'plan'
47+
],
4448
parse_stream_line: (parsed, report_progress) => {
4549
if (parsed.type == 'stream_event' && parsed.event) {
4650
if (

‎apps/editor/src/utils/agentic-cli-invocation/agents/codex.ts‎

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,20 @@ export const codex_agent: CodingAgent = {
1414
cmd: 'codex',
1515
is_installed: () => check_command_exists('codex'),
1616
get_documentation_url: () => AGENTS[agent_name].docs_url!,
17-
get_edit_args: (prompt: string) => ['exec', prompt, '--json'],
18-
get_ask_args: (prompt: string) => [prompt],
17+
get_edit_args: (prompt: string) => [
18+
'exec',
19+
prompt,
20+
'--json',
21+
'--ephemeral',
22+
'--sandbox',
23+
'workspace-write'
24+
],
25+
get_ask_args: (prompt: string) => [
26+
prompt,
27+
'--ephemeral',
28+
'--sandbox',
29+
'read-only'
30+
],
1931
parse_stream_line: (parsed, report_progress) => {
2032
if (parsed.type == 'item.started' && parsed.item) {
2133
const item = parsed.item

‎apps/editor/src/utils/agentic-cli-invocation/agents/cursor.ts‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,11 @@ export const cursor_agent: CodingAgent = {
1717
'stream-json',
1818
'--force'
1919
],
20-
get_ask_args: (prompt: string) => [prompt],
20+
get_ask_args: (prompt: string) => [
21+
prompt,
22+
'--mode',
23+
'ask'
24+
],
2125
parse_stream_line: (parsed, report_progress) => {
2226
if (parsed.type == 'tool_call') {
2327
if (parsed.subtype == 'started' || !parsed.subtype) {

‎apps/editor/src/utils/agentic-cli-invocation/agents/grok.ts‎

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,17 @@ export const grok_agent: CodingAgent = {
2020
'--output-format',
2121
'streaming-json',
2222
'--always-approve',
23-
'--no-auto-update'
2423
]
2524
},
26-
get_ask_args: (prompt: string) => ['-p', prompt],
25+
get_ask_args: (prompt: string) => {
26+
accumulated_output = ''
27+
return [
28+
'-p',
29+
prompt,
30+
'--sandbox',
31+
'read-only',
32+
]
33+
},
2734
parse_stream_line: (parsed, report_progress) => {
2835
if (parsed.type === 'tool_call' && parsed.tool) {
2936
report_progress(parsed.tool)

‎apps/editor/src/utils/agentic-cli-invocation/agents/muse.ts‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,10 @@ export const muse_agent: CodingAgent = {
1919
accumulated_output = ''
2020
return ['exec', '--json', '--yolo', prompt]
2121
},
22-
get_ask_args: (prompt: string) => [prompt],
22+
get_ask_args: (prompt: string) => {
23+
accumulated_output = ''
24+
return ['--disable-write', prompt]
25+
},
2326
parse_stream_line: (parsed, report_progress) => {
2427
const payload = parsed.payload || parsed
2528
let action_name = ''

‎apps/editor/src/utils/agentic-cli-invocation/agents/opencode.ts‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,12 @@ export const opencode_agent: CodingAgent = {
2121
'json',
2222
'--auto'
2323
],
24-
get_ask_args: (prompt: string) => ['run', prompt],
24+
get_ask_args: (prompt: string) => [
25+
'run',
26+
prompt,
27+
'--mode',
28+
'plan'
29+
],
2530
parse_stream_line: (parsed, report_progress) => {
2631
let action_name = ''
2732
if (parsed.type == 'tool_use' && parsed.part?.tool) {

0 commit comments

Comments
 (0)