Skip to content

Commit 85cd733

Browse files
committed
AI coding tool question
1 parent 901b09e commit 85cd733

File tree

2 files changed

+35
-0
lines changed

2 files changed

+35
-0
lines changed

journals/2026_02_09.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
## CLI
2+
- ### AI Coding
3+
- [[AI/Coding/Tool/Q/How can I do fire and forget tasks in each CLI AI coding tool like Claude Code cursor-agent and codex?]]
4+
- [[CLI/Craftsmanship]]
5+
- [[tmux]]
6+
- Starting to get to know `:set-window-option synchronize-panes` which lets me then do `. ~/.zshrc` which I likely need to do once per day in each of my panes.
7+
- [[AI]] told me that when you do `:source-file ~/.tmux.conf`, it reloads the config across the entire tmux server. So, in theory, if I had two iterm windows with two tmux sessions and I ran the command in one, it would refresh it in the other. Not yet convinced this is the case, as it's a rather unique model for CLI interactions.
8+
-
9+
-
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
- # How can I do fire and forget tasks in each CLI AI coding tool like [[Claude Code]], [[CursorAI]], and [[OpenAI/Codex]]?
2+
- ## My Notes
3+
- In [[Claude Code]], `claude -p "<request>"` runs non-interactively.
4+
- Need equivalent "run to completion and exit" flows for `cursor-agent`, `codex` CLI, and similar tools.
5+
- ## Answer
6+
- [[AI/Response]]
7+
- Yes, each has a non-interactive/headless mode:
8+
- [[Claude Code]]: `claude -p "<request>"`
9+
- [[CursorAI]] (`cursor-agent`): use `--print` (not prompt `-p`), e.g. `cursor-agent --print "<request>"`
10+
- [[OpenAI/Codex]]: use `codex exec "<request>"`
11+
- Useful automation flags:
12+
- `cursor-agent --print --output-format json "<request>"`
13+
- `cursor-agent --print --force "<request>"` (auto-approve commands unless denied)
14+
- `codex exec --json "<request>"` (JSONL events)
15+
- `codex exec --full-auto "<request>"` (low-friction autonomous execution in workspace sandbox)
16+
- Notes:
17+
- In current `cursor-agent`, `-p` means `--print`; prompt text is positional.
18+
- In current `codex`, `exec` is the explicit non-interactive command.
19+
- Sources:
20+
- [Claude Code CLI reference](https://docs.anthropic.com/en/docs/claude-code/cli-reference)
21+
- [Cursor CLI overview](https://docs.cursor.com/en/cli/overview)
22+
- [Cursor headless/print mode](https://docs.cursor.com/en/cli/headless)
23+
- [OpenAI Codex CLI getting started](https://help.openai.com/en/articles/11096431-openai-codex-ci-getting-started)
24+
- [OpenAI Codex docs collection](https://help.openai.com/en/collections/13193998-codex-cli)
25+
- ## Related
26+
- [[AI/Coding/Tool]]

0 commit comments

Comments
 (0)