mirror of
https://github.com/dtzp555-max/ocp.git
synced 2026-07-21 21:15:09 +00:00
Pre-approve common tools (Bash, Read, Write, Edit, Glob, Grep)
claude -p in non-interactive mode cannot show approval prompts, so tools like gh/git were blocked. Add --allowedTools to enable tool execution without manual approval. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
+7
-1
@@ -47,7 +47,13 @@ function callClaude(model, messages) {
|
|||||||
.join("\n\n");
|
.join("\n\n");
|
||||||
|
|
||||||
const cliModel = MODEL_MAP[model] || model;
|
const cliModel = MODEL_MAP[model] || model;
|
||||||
const args = ["-p", "--model", cliModel, "--output-format", "text", "--no-session-persistence", "--", prompt];
|
const args = [
|
||||||
|
"-p", "--model", cliModel,
|
||||||
|
"--output-format", "text",
|
||||||
|
"--no-session-persistence",
|
||||||
|
"--allowedTools", "Bash", "Read", "Write", "Edit", "Glob", "Grep",
|
||||||
|
"--", prompt,
|
||||||
|
];
|
||||||
const env = { ...process.env };
|
const env = { ...process.env };
|
||||||
delete env.CLAUDECODE;
|
delete env.CLAUDECODE;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user