Skip to content

[Feature]: Non-interactive one-shot mode — gcode -p "question" #75

Description

@shauryagangrade

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions