Loading...
Loading...
Compare original and translation side by side
~/.codex/config.tomlcodex --version~/.codex/config.tomlcodex --version/home/woody//home/hpc/--yoloAskUserQuestiongpt-5gpt-5-codexminimallowmediumhighread-onlyworkspace-writedanger-full-access--yolocodex exec [OPTIONS] "PROMPT"-m <MODEL>-c model_reasoning_effort="<LEVEL>"-s <SANDBOX_MODE>--skip-git-repo-check-C <DIRECTORY>--full-auto--yolocodex exec --yolo -m gpt-5 -c model_reasoning_effort="high" --skip-git-repo-check \
"Analyze this code: $(cat /path/to/file.py)" 2>/dev/null--yolo--dangerously-bypass-approvals-and-sandbox2>/dev/null--yolocodex resume/home/woody//home/hpc/--yoloAskUserQuestiongpt-5gpt-5-codexminimallowmediumhighread-onlyworkspace-writedanger-full-access--yolocodex exec [OPTIONS] "PROMPT"-m <MODEL>-c model_reasoning_effort="<LEVEL>"-s <SANDBOX_MODE>--skip-git-repo-check-C <DIRECTORY>--full-auto--yolocodex exec --yolo -m gpt-5 -c model_reasoning_effort="high" --skip-git-repo-check \
"Analyze this code: $(cat /path/to/file.py)" 2>/dev/null--yolo--dangerously-bypass-approvals-and-sandbox2>/dev/null--yolocodex resume🔥 HPC QUICK TIP: On HPC clusters (e.g.,,/home/woody/), ALWAYS add/home/hpc/flag to avoid Landlock sandbox errors. Example:--yolocodex exec --yolo -m gpt-5 ...
🔥 HPC快速提示:在HPC集群(如、/home/woody/)上,务必添加/home/hpc/标志以避免Landlock沙箱错误。示例:--yolocodex exec --yolo -m gpt-5 ...
codex exec -m gpt-5 -c model_reasoning_effort="medium" -s read-only \
--skip-git-repo-check --full-auto "review @file.py for security issues" 2>/dev/nullcodex exec -m gpt-5 -c model_reasoning_effort="medium" -s read-only \
--skip-git-repo-check --full-auto "review @file.py for security issues" 2>/dev/nullcat file.py | codex exec -m gpt-5 -c model_reasoning_effort="low" \
--skip-git-repo-check --full-auto - 2>/dev/null-cat file.py | codex exec -m gpt-5 -c model_reasoning_effort="low" \
--skip-git-repo-check --full-auto - 2>/dev/null---yoloundefined--yoloundefined
**Alternative: Manual Code Injection** (if --yolo is unavailable):
```bash
**替代方案:手动代码注入**(若--yolo不可用):
```bashOr for large files, use heredoc:
```bash
codex exec --yolo -m gpt-5 -c model_reasoning_effort="high" --skip-git-repo-check "$(cat <<'ENDCODE'
Analyze the following code comprehensively:
$(cat file.py)
Focus on: architecture, algorithms, multi-GPU optimization, potential bugs, code quality.
ENDCODE
)" 2>/dev/null--yolo--dangerously-bypass-approvals-and-sandbox对于大文件,可使用here文档:
```bash
codex exec --yolo -m gpt-5 -c model_reasoning_effort="high" --skip-git-repo-check "$(cat <<'ENDCODE'
Analyze the following code comprehensively:
$(cat file.py)
Focus on: architecture, algorithms, multi-GPU optimization, potential bugs, code quality.
ENDCODE
)" 2>/dev/null--yolo--dangerously-bypass-approvals-and-sandboxcodex exec -m gpt-5 -c model_reasoning_effort="high" -s workspace-write \
--skip-git-repo-check --full-auto "refactor @module.py to async/await" 2>/dev/nullcodex exec -m gpt-5 -c model_reasoning_effort="high" -s workspace-write \
--skip-git-repo-check --full-auto "refactor @module.py to async/await" 2>/dev/nullecho "fix the remaining issues" | codex exec --skip-git-repo-check resume --last 2>/dev/nullecho "fix the remaining issues" | codex exec --skip-git-repo-check resume --last 2>/dev/nullcodex exec -C /path/to/project -m gpt-5 -c model_reasoning_effort="medium" \
-s read-only --skip-git-repo-check --full-auto "analyze architecture" 2>/dev/nullcodex exec -C /path/to/project -m gpt-5 -c model_reasoning_effort="medium" \
-s read-only --skip-git-repo-check --full-auto "analyze architecture" 2>/dev/nullcodex exec --profile production -c model_reasoning_effort="high" \
--full-auto "optimize performance in @app.py" 2>/dev/nullcodex exec --profile production -c model_reasoning_effort="high" \
--full-auto "optimize performance in @app.py" 2>/dev/null| Flag | Values | When to Use |
|---|---|---|
| | Override default model |
| | Runtime config override (repeatable) |
| | Set execution permissions |
| flag | REQUIRED on HPC - Bypasses all sandbox restrictions (alias for |
| | Change workspace directory |
| flag | Allow execution outside git repos |
| flag | Non-interactive mode (workspace-write + approvals on failure). Cannot be used with --yolo |
| | Load configuration profile from config.toml |
| flag | JSON event output (CI/CD pipelines) |
| | Write final message to file |
| | Attach images (repeatable or comma-separated) |
| flag | Use local open-source model (requires Ollama) |
| 标志 | 取值 | 使用场景 |
|---|---|---|
| | 覆盖默认模型 |
| | 运行时配置覆盖(可重复使用) |
| | 设置执行权限 |
| 标志 | HPC环境必需 - 绕过所有沙箱限制( |
| | 切换工作区目录 |
| 标志 | 允许在git仓库外执行 |
| 标志 | 非交互模式(工作区写入 + 失败时自动确认)。不可与--yolo同时使用 |
| | 从config.toml加载配置文件 |
| 标志 | 输出JSON格式事件(用于CI/CD流水线) |
| | 将最终消息写入文件 |
| | 附加图片(可重复使用或逗号分隔) |
| 标志 | 使用本地开源模型(需Ollama) |
-c model_reasoning_effort="<LEVEL>"minimallowmediumhigh-c model_verbosity="<LEVEL>"lowmediumhigh-c approvals="<WHEN>"on-requeston-failure--full-autountrustednever-c model_reasoning_effort="<LEVEL>"minimallowmediumhigh-c model_verbosity="<LEVEL>"lowmediumhigh-c approvals="<WHEN>"on-requeston-failureuntrustednever~/.codex/config.toml~/.codex/config.tomlundefinedundefinedundefinedundefinedconfig.toml[profiles.research]
model = "gpt-5"
model_reasoning_effort = "high"
sandbox = "read-only"
[profiles.development]
model = "gpt-5-codex"
sandbox = "workspace-write"codex exec --profile research "analyze codebase"config.toml[profiles.research]
model = "gpt-5"
model_reasoning_effort = "high"
sandbox = "read-only"
[profiles.development]
model = "gpt-5-codex"
sandbox = "workspace-write"codex exec --profile research "analyze codebase"undefinedundefined
**Flag injection** (between `exec` and `resume`):
```bash
**标志注入**(在`exec`和`resume`之间):
```bashundefinedundefinedAskUserQuestionAskUserQuestionAskUserQuestion--full-auto-s danger-full-access--yolo--dangerously-bypass-approvals-and-sandboxAskUserQuestion--full-auto-s danger-full-access--yolo--dangerously-bypass-approvals-and-sandboxAskUserQuestionAskUserQuestionread-onlycat target.py | codex exec -m gpt-5 -c model_reasoning_effort="medium" \
--skip-git-repo-check --full-auto - 2>/dev/nullcodex exec -m gpt-5 -s read-only \
-c 'sandbox_permissions=["disk-full-read-access"]' \
--skip-git-repo-check --full-auto "@file.py" 2>/dev/nullcodex exec -m gpt-5 -s workspace-write \
--skip-git-repo-check --full-auto "review @file.py" 2>/dev/nullread-onlycat target.py | codex exec -m gpt-5 -c model_reasoning_effort="medium" \
--skip-git-repo-check --full-auto - 2>/dev/nullcodex exec -m gpt-5 -s read-only \
-c 'sandbox_permissions=["disk-full-read-access"]' \
--skip-git-repo-check --full-auto "@file.py" 2>/dev/nullcodex exec -m gpt-5 -s workspace-write \
--skip-git-repo-check --full-auto "review @file.py" 2>/dev/null-C <DIR>codex exec -C /target/dir -m gpt-5 --skip-git-repo-check \
--full-auto "task" 2>/dev/null-C <DIR>codex exec -C /target/dir -m gpt-5 --skip-git-repo-check \
--full-auto "task" 2>/dev/null2>/dev/nullcodex --versioncat ~/.codex/config.tomlcodex exec -m gpt-5 "hello world"codex exec --model gpt-5 "test"2>/dev/nullcodex --versioncat ~/.codex/config.tomlcodex exec -m gpt-5 "hello world"codex exec --model gpt-5 "test"grep model ~/.codex/config.toml-m gpt-5-codex--ossgrep model ~/.codex/config.toml-m gpt-5-codex--osscodex history--lastcodex history--last--yolo# Bypasses Landlock restrictions completely
codex exec --yolo -m gpt-5 -c model_reasoning_effort="high" --skip-git-repo-check \
"Analyze this code: $(cat /full/path/to/file.py)" 2>/dev/null--yolo--dangerously-bypass-approvals-and-sandbox# Pass code directly in prompt via command substitution
codex exec -m gpt-5 -c model_reasoning_effort="high" --skip-git-repo-check --full-auto \
"Analyze this code comprehensively: $(cat /full/path/to/file.py)" 2>/dev/nullcodex exec --yolo -m gpt-5 -c model_reasoning_effort="high" --skip-git-repo-check "$(cat <<'EOF'
Analyze the following Python code for architecture, bugs, and optimization opportunities:
$(cat /home/user/script.py)
Provide technical depth with actionable insights.
EOF
)" 2>/dev/null# SSH to login node first, then run codex there (not in Slurm job)
ssh login.cluster.edu
codex exec --yolo -m gpt-5 --skip-git-repo-check "analyze @file.py" 2>/dev/null# Build image with Codex installed, then run via Slurm
singularity exec codex.sif codex exec --yolo -m gpt-5 "task"--yolo--yolo$(cat file.py)--yolo# 完全绕过Landlock限制
codex exec --yolo -m gpt-5 -c model_reasoning_effort="high" --skip-git-repo-check \
"Analyze this code: $(cat /full/path/to/file.py)" 2>/dev/null--yolo--dangerously-bypass-approvals-and-sandbox# 通过命令替换直接在提示中传入代码
codex exec -m gpt-5 -c model_reasoning_effort="high" --skip-git-repo-check --full-auto \
"Analyze this code comprehensively: $(cat /full/path/to/file.py)" 2>/dev/nullcodex exec --yolo -m gpt-5 -c model_reasoning_effort="high" --skip-git-repo-check "$(cat <<'EOF'
Analyze the following Python code for architecture, bugs, and optimization opportunities:
$(cat /home/user/script.py)
Provide technical depth with actionable insights.
EOF
)" 2>/dev/null# 先SSH到登录节点,再在那里运行codex(不要在Slurm作业中运行)
ssh login.cluster.edu
codex exec --yolo -m gpt-5 --skip-git-repo-check "analyze @file.py" 2>/dev/null# 构建安装了Codex的镜像,然后通过Slurm运行
singularity exec codex.sif codex exec --yolo -m gpt-5 "task"--yolo--yolo$(cat file.py)2>/dev/null2>/dev/nullreviewrefactorquicksecurityreviewrefactorquicksecurity--yolo--yolo--yolo--yolo--full-auto-s workspace-writedanger-full-access--yoloworkspace-write--yolo--yolo--yolo--yolo--full-auto-s workspace-writedanger-full-access--yoloworkspace-writecodex exec --json -o result.txt -m gpt-5 \
-c model_reasoning_effort="medium" \
--skip-git-repo-check --full-auto \
"run security audit on changed files" 2>/dev/nullcodex exec --json -o result.txt -m gpt-5 \
-c model_reasoning_effort="medium" \
--skip-git-repo-check --full-auto \
"run security audit on changed files" 2>/dev/nullfor file in *.py; do
cat "$file" | codex exec -m gpt-5 -c model_reasoning_effort="low" \
--skip-git-repo-check --full-auto "lint and format" - 2>/dev/null
donefor file in *.py; do
cat "$file" | codex exec -m gpt-5 -c model_reasoning_effort="low" \
--skip-git-repo-check --full-auto "lint and format" - 2>/dev/null
doneundefinedundefinedundefinedundefinedWebFetch https://developers.openai.com/codex/cli/referenceWebFetch https://developers.openai.com/codex/local-config#cliWebFetch https://developers.openai.com/codex/cli/referenceWebFetch https://developers.openai.com/codex/local-config#cli| Task Type | Recommended Model | Reasoning Effort |
|---|---|---|
| Quick syntax fixes | | minimal |
| Code review | | medium |
| Refactoring | | medium |
| Architecture analysis | | high |
| Security audit | | high |
| Algorithm optimization | | high |
| Documentation generation | | low |
| 任务类型 | 推荐模型 | 推理力度 |
|---|---|---|
| 快速语法修复 | | minimal |
| 代码审查 | | medium |
| 代码重构 | | medium |
| 架构分析 | | high |
| 安全审计 | | high |
| 算法优化 | | high |
| 文档生成 | | low |