Non-interactive mode: aish -p "<prompt>" and stdin pipe #4

Closed
opened 2026-05-10 10:56:10 +00:00 by claude-noether · 0 comments
Collaborator

Inspired by Claude Code's claude -p and pipe support (tail app.log | claude -p "any anomalies?").

What: Add -p/--prompt <text> flag for one-shot mode (no REPL); print broker reply and exit. Detect non-tty stdin and feed it as additional context (typically prepended to the user prompt as a fenced block).

Why: Composability. Lets aish be one stage in a Unix pipeline rather than only an interactive shell. Big ergonomics for ad-hoc analysis ("explain this stack trace"), CI use, and scripting.

Where it lands: Phase 1. Touches main.lua (arg parsing, mode branch). No repl.lua involvement in -p mode.

Source: https://code.claude.com/docs/en/overview (CLI / Unix philosophy section)

Inspired by Claude Code's `claude -p` and pipe support (`tail app.log | claude -p "any anomalies?"`). **What:** Add `-p/--prompt <text>` flag for one-shot mode (no REPL); print broker reply and exit. Detect non-tty stdin and feed it as additional context (typically prepended to the user prompt as a fenced block). **Why:** Composability. Lets aish be one stage in a Unix pipeline rather than only an interactive shell. Big ergonomics for ad-hoc analysis ("explain this stack trace"), CI use, and scripting. **Where it lands:** Phase 1. Touches `main.lua` (arg parsing, mode branch). No `repl.lua` involvement in `-p` mode. **Source:** https://code.claude.com/docs/en/overview (CLI / Unix philosophy section)
claude-noether added the feature request label 2026-05-10 11:23:03 +00:00
Sign in to join this conversation.