@cnwenf/occ 2.1.317 → 2.1.318
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/cli.js +9 -7
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
|
-
globalThis.MACRO={"VERSION":"2.1.
|
|
2
|
+
globalThis.MACRO={"VERSION":"2.1.318","BINARY_NAME":"occ","BUILD_TIME":"2026-08-31T18:40:21.059Z","FEEDBACK_CHANNEL":"","ISSUES_EXPLAINER":"","NATIVE_PACKAGE_URL":"","PACKAGE_URL":"@cnwenf/occ","VERSION_CHANGELOG":""};
|
|
3
3
|
// @bun
|
|
4
4
|
var __create = Object.create;
|
|
5
5
|
var __getProtoOf = Object.getPrototypeOf;
|
|
@@ -58105,11 +58105,12 @@ var init_figures2 = __esm(() => {
|
|
|
58105
58105
|
// src/types/permissions.ts
|
|
58106
58106
|
var exports_permissions = {};
|
|
58107
58107
|
__export(exports_permissions, {
|
|
58108
|
+
PERMISSION_MODES_CLI_CHOICES: () => PERMISSION_MODES_CLI_CHOICES,
|
|
58108
58109
|
PERMISSION_MODES: () => PERMISSION_MODES,
|
|
58109
58110
|
INTERNAL_PERMISSION_MODES: () => INTERNAL_PERMISSION_MODES,
|
|
58110
58111
|
EXTERNAL_PERMISSION_MODES: () => EXTERNAL_PERMISSION_MODES
|
|
58111
58112
|
});
|
|
58112
|
-
var EXTERNAL_PERMISSION_MODES, INTERNAL_PERMISSION_MODES, PERMISSION_MODES;
|
|
58113
|
+
var EXTERNAL_PERMISSION_MODES, INTERNAL_PERMISSION_MODES, PERMISSION_MODES, PERMISSION_MODES_CLI_CHOICES;
|
|
58113
58114
|
var init_permissions = __esm(() => {
|
|
58114
58115
|
EXTERNAL_PERMISSION_MODES = [
|
|
58115
58116
|
"acceptEdits",
|
|
@@ -58123,6 +58124,7 @@ var init_permissions = __esm(() => {
|
|
|
58123
58124
|
...EXTERNAL_PERMISSION_MODES
|
|
58124
58125
|
];
|
|
58125
58126
|
PERMISSION_MODES = INTERNAL_PERMISSION_MODES;
|
|
58127
|
+
PERMISSION_MODES_CLI_CHOICES = PERMISSION_MODES.map((mode) => mode === "default" ? "manual" : mode);
|
|
58126
58128
|
});
|
|
58127
58129
|
|
|
58128
58130
|
// src/utils/permissions/PermissionMode.ts
|
|
@@ -826859,7 +826861,7 @@ async function run() {
|
|
|
826859
826861
|
});
|
|
826860
826862
|
program3.name(CLI_BINARY_NAME).description(`Claude Code - starts an interactive session by default, use -p/--print for non-interactive output`).argument("[prompt]", "Your prompt", String).helpOption("-h, --help", "Display help for command").option("-d, --debug [filter]", 'Enable debug mode with optional category filtering (e.g., "api,hooks" or "!1p,!file")', (_value) => {
|
|
826861
826863
|
return true;
|
|
826862
|
-
}).addOption(new Option("--debug-to-stderr", "Enable debug mode (to stderr)").argParser(Boolean).hideHelp()).option("--debug-file <path>", "Write debug logs to a specific file path (implicitly enables debug mode)", () => true).option("--verbose", "Override verbose mode setting from config", () => true).option("-p, --print", "Print response and exit (useful for pipes). Note: The workspace trust dialog is skipped when Claude is run
|
|
826864
|
+
}).addOption(new Option("--debug-to-stderr", "Enable debug mode (to stderr)").argParser(Boolean).hideHelp()).option("--debug-file <path>", "Write debug logs to a specific file path (implicitly enables debug mode)", () => true).option("--verbose", "Override verbose mode setting from config", () => true).option("-p, --print", "Print response and exit (useful for pipes). Note: The workspace trust dialog is skipped when Claude is run in non-interactive mode (via -p, or when stdout is not a TTY, e.g. piped or redirected output). Only use this in directories you trust. Settings files that fail validation are silently ignored in this mode (no error dialog is shown).", () => true).option("--bare", "Minimal mode: skip hooks, LSP, plugin sync, attribution, auto-memory, background prefetches, keychain reads, and CLAUDE.md auto-discovery. Sets CLAUDE_CODE_SIMPLE=1. Anthropic auth is strictly ANTHROPIC_API_KEY or apiKeyHelper via --settings (OAuth and keychain are never read). 3P providers (Bedrock/Vertex/Foundry) use their own credentials. Skills still resolve via /skill-name. Explicitly provide context via: --system-prompt[-file], --append-system-prompt[-file], --add-dir (CLAUDE.md dirs), --mcp-config, --settings, --agents, --plugin-dir.", () => true).option("--safe-mode", 'Start in safe mode: disable all plugins, bundled skills, and hooks. Used for troubleshooting ("is a plugin/hook causing my problem?").', () => true).option("--ax-screen-reader", "Render screen-reader friendly output (flat text, no decorative borders or animations).", () => true).addOption(new Option("--init", "Run Setup hooks with init trigger, then continue").hideHelp()).addOption(new Option("--init-only", "Run Setup and SessionStart:startup hooks, then exit").hideHelp()).addOption(new Option("--maintenance", "Run Setup hooks with maintenance trigger, then continue").hideHelp()).addOption(new Option("--output-format <format>", 'Output format (only works with --print): "text" (default), "json" (single result), or "stream-json" (realtime streaming)').choices(["text", "json", "stream-json"])).addOption(new Option("--json-schema <schema>", 'JSON Schema for structured output validation. Example: {"type":"object","properties":{"name":{"type":"string"}},"required":["name"]}').argParser(String)).option("--include-hook-events", "Include all hook lifecycle events in the output stream (only works with --output-format=stream-json)", () => true).option("--include-partial-messages", "Include partial message chunks as they arrive (only works with --print and --output-format=stream-json)", () => true).option("--forward-subagent-text", "Forward subagent text and thinking blocks as assistant/user messages with parent_tool_use_id set (only works with --print and --output-format=stream-json)", () => true).addOption(new Option("--input-format <format>", 'Input format (only works with --print): "text" (default), or "stream-json" (realtime streaming input)').choices(["text", "stream-json"])).option("--dangerously-skip-permissions", "Bypass all permission checks. Recommended only for sandboxes with no internet access.", () => true).option("--allow-dangerously-skip-permissions", "Enable bypassing all permission checks as an option, without it being enabled by default. Recommended only for sandboxes with no internet access.", () => true).option("--dangerously-skip-protected-paths", "Skip permission prompts for writes to protected paths (.claude/, .git/, .vscode/, shell configs). These paths are protected because editing them can execute code or alter tool behavior. Use with caution.", () => true).addOption(new Option("--thinking <mode>", "Thinking mode: enabled (equivalent to adaptive), disabled").choices(["enabled", "adaptive", "disabled"]).hideHelp()).addOption(new Option("--max-thinking-tokens <tokens>", "[DEPRECATED. Use --thinking instead for newer models] Maximum number of thinking tokens (only works with --print)").argParser(Number).hideHelp()).addOption(new Option("--max-turns <turns>", "Maximum number of agentic turns in non-interactive mode. This will early exit the conversation after the specified number of turns. (only works with --print)").argParser(Number).hideHelp()).addOption(new Option("--max-budget-usd <amount>", "Maximum dollar amount to spend on API calls (only works with --print)").argParser((value) => {
|
|
826863
826865
|
const amount = Number(value);
|
|
826864
826866
|
if (isNaN(amount) || amount <= 0) {
|
|
826865
826867
|
throw new Error("--max-budget-usd must be a positive number greater than 0");
|
|
@@ -826871,10 +826873,10 @@ async function run() {
|
|
|
826871
826873
|
throw new Error("--task-budget must be a positive integer");
|
|
826872
826874
|
}
|
|
826873
826875
|
return tokens;
|
|
826874
|
-
}).hideHelp()).option("--replay-user-messages", "Re-emit user messages from stdin back on stdout for acknowledgment (only works with --input-format=stream-json and --output-format=stream-json)", () => true).addOption(new Option("--enable-auth-status", "Enable auth status messages in SDK mode").default(false).hideHelp()).option("--allowedTools, --allowed-tools <tools...>", 'Comma or space-separated list of tool names to allow (e.g. "Bash(git
|
|
826876
|
+
}).hideHelp()).option("--replay-user-messages", "Re-emit user messages from stdin back on stdout for acknowledgment (only works with --input-format=stream-json and --output-format=stream-json)", () => true).addOption(new Option("--enable-auth-status", "Enable auth status messages in SDK mode").default(false).hideHelp()).option("--allowedTools, --allowed-tools <tools...>", 'Comma or space-separated list of tool names to allow (e.g. "Bash(git *) Edit")').option("--tools <tools...>", 'Specify the list of available tools from the built-in set. Use "" to disable all tools, "default" to use all tools, or specify tool names (e.g. "Bash,Edit,Read").').option("--disallowedTools, --disallowed-tools <tools...>", 'Comma or space-separated list of tool names to deny (e.g. "Bash(git *) Edit")').option("--mcp-config <configs...>", "Load MCP servers from JSON files or strings (space-separated)").addOption(new Option("--permission-prompt-tool <tool>", "MCP tool to use for permission prompts (only works with --print)").argParser(String).hideHelp()).addOption(new Option("--system-prompt <prompt>", "System prompt to use for the session").argParser(String)).addOption(new Option("--system-prompt-file <file>", "Read system prompt from a file").argParser(String).hideHelp()).addOption(new Option("--append-system-prompt <prompt>", "Append a system prompt to the default system prompt").argParser(String)).addOption(new Option("--append-system-prompt-file <file>", "Read system prompt from a file and append to the default system prompt").argParser(String).hideHelp()).addOption(new Option("--permission-mode <mode>", "Permission mode to use for the session").choices(PERMISSION_MODES_CLI_CHOICES).argParser((raw) => {
|
|
826875
826877
|
const normalized = normalizePermissionModeInput(raw);
|
|
826876
826878
|
if (!PERMISSION_MODES.includes(normalized)) {
|
|
826877
|
-
throw new InvalidArgumentError(`Allowed choices are ${
|
|
826879
|
+
throw new InvalidArgumentError(`Allowed choices are ${PERMISSION_MODES_CLI_CHOICES.join(", ")}.`);
|
|
826878
826880
|
}
|
|
826879
826881
|
return normalized;
|
|
826880
826882
|
})).option("-c, --continue", "Continue the most recent conversation in the current directory", () => true).option("-r, --resume [value]", "Resume a conversation by session ID, or open interactive picker with optional search term", (value) => value || true).option("--fork-session", "When resuming, create a new session ID instead of reusing the original (use with --resume or --continue)", () => true).addOption(new Option("--prefill <text>", "Pre-fill the prompt input with text without submitting it").hideHelp()).addOption(new Option("--deep-link-origin", "Signal that this session was launched from a deep link").hideHelp()).addOption(new Option("--deep-link-repo <slug>", "Repo slug the deep link ?repo= parameter resolved to the current cwd").hideHelp()).addOption(new Option("--deep-link-last-fetch <ms>", "FETCH_HEAD mtime in epoch ms, precomputed by the deep link trampoline").argParser((v6) => {
|
|
@@ -826886,7 +826888,7 @@ async function run() {
|
|
|
826886
826888
|
throw new InvalidArgumentError(`It must be one of: ${EFFORT_LEVELS.join(", ")}`);
|
|
826887
826889
|
}
|
|
826888
826890
|
return value;
|
|
826889
|
-
})).option("--agent <agent>", `Agent for the current session. Overrides the 'agent' setting.`).option("--betas <betas...>", "Beta headers to include in API requests (API key users only)").option("--fallback-model <model>", "Enable automatic fallback to specified model(s) when the default model is overloaded or not available. Accepts a comma-separated list to try each in order. Re-tries the primary at the start of each user turn. (only works with --print)").addOption(new Option("--workload <tag>", "Workload tag for billing-header attribution (cc_workload). Process-scoped; set by SDK daemon callers that spawn subprocesses for cron work. (only works with --print)").hideHelp()).option("--settings <file-or-json>", "Path to a settings JSON file or a JSON string to load additional settings from").option("--add-dir <directories...>", "Additional directories to allow tool access to").option("--ide", "Automatically connect to IDE on startup if exactly one valid IDE is available", () => true).option("--strict-mcp-config", "Only use MCP servers from --mcp-config, ignoring all other MCP configurations", () => true).option("--session-id <uuid>", "Use a specific session ID for the conversation (must be a valid UUID)").option("-n, --name <name>", "Set a display name for this session (shown in /resume and terminal title)").option("--agents <json>", `JSON object defining custom agents (e.g. '{"reviewer": {"description": "Reviews code", "prompt": "You are a code reviewer"}}')`).option("--setting-sources <sources>", "Comma-separated list of setting sources to load (user, project, local).").addOption(new Option("--prompt-suggestions [value]", "Enable prompt suggestions. In print/SDK mode, emits a prompt_suggestion message after each turn with a predicted next user prompt").choices(["true", "false", "1", "0", "yes", "no", "on", "off"]).preset("true").argParser((raw) => {
|
|
826891
|
+
})).option("--agent <agent>", `Agent for the current session. Overrides the 'agent' setting.`).option("--betas <betas...>", "Beta headers to include in API requests (API key users only)").option("--fallback-model <model>", "Enable automatic fallback to specified model(s) when the default model is overloaded or not available. Accepts a comma-separated list to try each in order. Re-tries the primary at the start of each user turn. (only works with --print)").addOption(new Option("--workload <tag>", "Workload tag for billing-header attribution (cc_workload). Process-scoped; set by SDK daemon callers that spawn subprocesses for cron work. (only works with --print)").hideHelp()).option("--settings <file-or-json>", "Path to a settings JSON file or a JSON string to load additional settings from").option("--add-dir <directories...>", "Additional directories to allow tool access to").option("--ide", "Automatically connect to IDE on startup if exactly one valid IDE is available", () => true).option("--strict-mcp-config", "Only use MCP servers from --mcp-config, ignoring all other MCP configurations", () => true).option("--session-id <uuid>", "Use a specific session ID for the conversation (must be a valid UUID)").option("-n, --name <name>", "Set a display name for this session (shown in the prompt box, /resume picker, and terminal title)").option("--agents <json>", `JSON object defining custom agents (e.g. '{"reviewer": {"description": "Reviews code", "prompt": "You are a code reviewer"}}')`).option("--setting-sources <sources>", "Comma-separated list of setting sources to load (user, project, local).").addOption(new Option("--prompt-suggestions [value]", "Enable prompt suggestions. In print/SDK mode, emits a prompt_suggestion message after each turn with a predicted next user prompt").choices(["true", "false", "1", "0", "yes", "no", "on", "off"]).preset("true").argParser((raw) => {
|
|
826890
826892
|
const allowed = ["true", "false", "1", "0", "yes", "no", "on", "off"];
|
|
826891
826893
|
if (!allowed.includes(raw)) {
|
|
826892
826894
|
throw new InvalidArgumentError("Allowed choices are true, false, 1, 0, yes, no, on, off.");
|
|
@@ -829293,7 +829295,7 @@ Runs OCC on a remote Linux host. You don't need to install
|
|
|
829293
829295
|
const { daemonSubcommand: daemonSubcommand2 } = await Promise.resolve().then(() => (init_daemon3(), exports_daemon2));
|
|
829294
829296
|
await daemonSubcommand2("hub", []);
|
|
829295
829297
|
});
|
|
829296
|
-
program3.command("stop <id>").description("Stop a background session").action(async (id) => {
|
|
829298
|
+
program3.command("stop <id>").alias("kill").description("Stop a background session").action(async (id) => {
|
|
829297
829299
|
const { stopHandler: stopHandler2 } = await Promise.resolve().then(() => (init_daemon3(), exports_daemon2));
|
|
829298
829300
|
await stopHandler2(id);
|
|
829299
829301
|
});
|