Register and share your invite link to earn from video plays and referrals.

cv usk
@cv_usk
AI / Software Research Notes AI Agent, LLMOps, MLOps, Software Architecture ๆŠ•็จฟใฏๅ€‹ไบบใฎๆ„่ฆ‹ใงใ™ใ€‚
Joined May 2026
280 Following    413 Followers
# Codex Features and Practical Usage ๐Ÿค– Stop babysitting the terminal โ€” non-interactive mode lets you treat Codex as just another stage in your pipe, ready to drop into CI and scripts. ๐Ÿท๏ธ Title: `codex exec` ๐Ÿ”— URL: ๐Ÿ“˜ Overview `codex exec` runs Codex once, without launching the interactive UI. You pass the prompt as a single argument, the agent does the work, and only the final message is written to stdout. It is built for CI pipelines, pre-commit hooks, and ordinary shell pipelines. โš™๏ธ How It Works Progress logs stream to stderr while only the final agent answer goes to stdout, so it composes cleanly with pipes and redirects. Key flags: ใƒป`--sandbox`: `read-only` (default) / `workspace-write` (allow edits) / `danger-full-access` (full access). ใƒป`--ask-for-approval never`: suppresses approval prompts for fully unattended runs. ใƒป`--json`: streams every event as JSON Lines (`thread.started`, `turn.started`, `item.completed`, `turn.completed`, etc.). ใƒป`-o/--output-last-message `: writes the final message to a file. ใƒป`--output-schema `: enforces structured output matching a JSON Schema. ใƒป`-C/--cd `: changes the working directory before running. ใƒป`--skip-git-repo-check`: bypasses the Git-repo requirement (normally required to prevent destructive changes). ใƒป`--ephemeral`: keeps session files off disk. ๐Ÿ› ๏ธ Practical Usage It pairs well with stdin. For example, pipe `npm test 2>&1` into `codex exec "summarize failing tests and propose minimal fix"` and tee the result to a summary file. Structured output gives you stable, machine-readable fields: pass `--output-schema ./schema.json` with `-o ./project-metadata.json`. You can chain sessions into multi-stage pipelines: run an initial `codex exec`, then continue with `codex exec resume --last` to fix what it found. ๐Ÿ’ก Use Cases A common split is to trigger on CI failure, generate a patch read-only, then apply it and open a PR in a separate job that holds write permissions. It also works well for log triage โ€” pipe the tail of a log and save root-cause analysis to `analysis.md`. โš ๏ธ Caveats Never expose API keys as job-level env vars in workflows that check out untrusted code; on GitHub, prefer the official Codex GitHub Action. The `--full-auto` flag is deprecated โ€” use `--sandbox workspace-write` instead. If an MCP server marked `required = true` fails to start, `codex exec` exits with an error. Always pick the least-privilege sandbox for automation. #Codex# #CI#
Show more