Problem
GCode is interactive-only. Scripts, CI, and editors can't ask it a single
question and get an answer without driving a pty.
Proposed approach
- Add
gcode --prompt "..." (short -p) that runs one turn in the current
session, prints the reply (optionally --json), and exits.
- No banner, no slash menu, no interactive prompt; still load
.gcoderc,
env, and tools. Non-tty safe: auto-reject bash unless --yes.
- Keep
--session semantics (reads/updates the session history).
Where to look
gcode/cli.py:239-... (main) — argument parsing and startup flow.
gcode/agent.py:101-137 (run_turn) for the single-turn loop.
Acceptance criteria
gcode -p "summarize this repo" prints a reply and exits 0.
- Works non-interactively (CI), and without an API key for ollama models.
Difficulty
Medium — good stepping-stone issue.
Problem
GCode is interactive-only. Scripts, CI, and editors can't ask it a single
question and get an answer without driving a pty.
Proposed approach
gcode --prompt "..."(short-p) that runs one turn in the currentsession, prints the reply (optionally
--json), and exits..gcoderc,env, and tools. Non-tty safe: auto-reject bash unless
--yes.--sessionsemantics (reads/updates the session history).Where to look
gcode/cli.py:239-...(main) — argument parsing and startup flow.gcode/agent.py:101-137(run_turn) for the single-turn loop.Acceptance criteria
gcode -p "summarize this repo"prints a reply and exits 0.Difficulty
Medium — good stepping-stone issue.