You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# .gitkeep file auto-generated at 2026-06-17T15:20:23.237Z for PR creation at branch issue-39-15508d68b466 for issue https://github.com/link-assistant/agent-commander/issues/39
-`agent`: `--permission-mode readonly` for `--read-only`, `--permission-mode plan` for `--plan-only`
138
140
139
-
If a tool cannot enforce the requested restrictions, `start-agent` fails before starting the agent. For example, `--tool agent --read-only` is rejected because @link-assistant/agent has no native permission system.
141
+
Most tools treat `--plan-only` as an alias for `--read-only`. The `agent` tool honors its own distinction: `--read-only` selects the hard `readonly` mode (deny every edit and any non read-only shell command, never asks) while `--plan-only` selects `plan` (deny edits, allow read-only shell, ask before anything else). For fine-grained OpenCode-style policies, pass `agent`'s native `--permission '<json>'` through `--tool-arg`.
142
+
143
+
If a tool cannot enforce the requested restrictions, `start-agent` fails before starting the agent.
140
144
141
145
## CLI Usage
142
146
@@ -160,7 +164,7 @@ start-agent --tool claude --working-directory "/tmp/dir" --prompt "Solve the iss
160
164
-`--fallback-model <name>` - Fallback model when default is overloaded (Claude only)
161
165
-`--verbose` - Enable verbose mode (Claude only)
162
166
-`--read-only` - Enforce native read-only/planning mode for supported tools
163
-
-`--plan-only` - Alias for `--read-only`
167
+
-`--plan-only` - Alias for `--read-only` for most tools; the `agent` tool maps it to its softer `--permission-mode plan`
164
168
-`--resume <sessionId>` - Resume a previous session by ID
165
169
-`--session-id <uuid>` - Use a specific session ID (Claude only, must be valid UUID)
166
170
-`--fork-session` - Create new session ID when resuming (Claude only)
-`options.planOnly` (boolean, optional) - Enforce native planning mode; the `agent` tool maps it to `--permission-mode plan` while other tools treat it like `readOnly`
555
560
-`options.isolation` (string, optional) - 'none', 'screen', or 'docker' (default: 'none')
556
561
-`options.screenName` (string, optional) - Screen session name (required for screen isolation)
557
562
-`options.containerName` (string, optional) - Container name (required for docker isolation)
@@ -560,7 +565,8 @@ Creates an agent controller.
560
565
-`extraEnv` (object or `KEY=VALUE` / `[key, value]` array, optional) - Environment variables applied to the native tool process
561
566
-`extraArgs` (string array, optional) - Raw native tool arguments appended after typed agent-commander arguments
562
567
-`skipDefaultSafetyFlags` (boolean, optional) - Do not add default autonomous safety bypass flags such as Claude/Codex bypass flags or Qwen/Gemini `--yolo`
563
-
-`permissionMode` (string, optional) - Explicit Claude permission mode
568
+
-`permissionMode` (string, optional) - Explicit permission mode for Claude or `agent` (agent: `auto` | `plan` | `readonly` | `ask`)
569
+
-`permission` (string, optional) - OpenCode-compatible `--permission` JSON policy for the `agent` tool
Unsupported tools can still be executed through the generic command builder, but read-only planning mode is rejected unless the tool has an enforceable native restriction.
19
19
@@ -46,7 +46,7 @@ Both packages expose raw passthrough controls for the native `claude`, `codex`,
46
46
47
47
Passthrough environment variables are attached to the native tool side of prompt pipelines, so `cat prompt.txt | env KEY=value codex exec ...` applies `KEY` to `codex` without altering prompt-file reads. Raw arguments are appended after typed arguments, allowing callers to override or extend native CLI behavior such as MCP config, reasoning config, permission modes, sandbox modes, approval modes, and custom config paths.
48
48
49
-
Claude and Codex builders also expose typed `permissionMode` / `permission_mode`, `sandboxMode` / `sandbox_mode`, and `approvalMode` / `approval_mode` fields for callers that build commands directly.
49
+
Claude and Codex builders also expose typed `permissionMode` / `permission_mode`, `sandboxMode` / `sandbox_mode`, and `approvalMode` / `approval_mode` fields for callers that build commands directly. The `agent` builder exposes typed `permissionMode` / `permission_mode` (`auto` | `plan` | `readonly` | `ask`) and an OpenCode-compatible `permission` / `permission` JSON policy. `--read-only` maps to `readonly` and `--plan-only` maps to `plan` for `agent`.
Map `--read-only` and `--plan-only` for the `agent` tool to its native `--permission-mode` (agent v0.24.0): `--read-only` → `readonly` and `--plan-only` → `plan`. The `agent` tool now supports enforceable read-only/planning mode instead of being rejected, and exposes typed `permissionMode` and `permission` (OpenCode-compatible JSON policy) passthrough options.
@@ -58,7 +64,8 @@ export function buildAgentCommand(options) {
58
64
model,
59
65
json,
60
66
resume,
61
-
readOnly,
67
+
readOnly: readOnlyRequested,
68
+
planOnly,
62
69
...toolOptions,
63
70
});
64
71
}else{
@@ -71,7 +78,7 @@ export function buildAgentCommand(options) {
71
78
});
72
79
}
73
80
}else{
74
-
if(readOnly){
81
+
if(readOnlyRequested){
75
82
thrownewError(readOnlyUnsupportedError(tool));
76
83
}
77
84
// Unknown tool, use generic command builder
@@ -111,7 +118,7 @@ export function buildAgentCommand(options) {
111
118
* @returns {string} Error message
112
119
*/
113
120
functionreadOnlyUnsupportedError(tool){
114
-
return`Tool "${tool}" does not support enforceable read-only mode. Choose one of: claude, codex, opencode, gemini, qwen; or run without --read-only.`;
121
+
return`Tool "${tool}" does not support enforceable read-only mode. Choose one of: claude, codex, opencode, gemini, qwen, agent; or run without --read-only.`;
0 commit comments