Skip to content

Commit ac5f74b

Browse files
committed
docs: clarify agent-driven CLI vs in-process embedding
The previous paragraph implied agents call WithAnswers directly, which conflates two distinct surfaces: - Subprocess: agent shells out, huhx reads --answer / env / answer-file - In-process: a Go program embeds the form, huhx reads WithAnswers map Split them in the README so each path is described accurately.
1 parent 474c302 commit ac5f74b

1 file changed

Lines changed: 8 additions & 5 deletions

File tree

README.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,14 @@ a terminal and accepts CLI flags, environment variables, or YAML/JSON
1515
answer files everywhere else — CI pipelines, shell scripts, automated
1616
tooling.
1717

18-
**Driving CLIs from agents.** AI agents and orchestrators can call
19-
`WithAnswers(map[string]any{...})` to drive any huhx form in-process
20-
without a terminal, reusing every validator the form already enforces.
21-
No separate "headless mode" to keep in sync with the interactive one —
22-
huhx is the same form.
18+
**Driving CLIs from agents.** When an AI agent or orchestrator invokes
19+
your CLI as a subprocess, huhx accepts answers via `--answer key=val`
20+
flags, env vars, or an answer file — no TTY required and no separate
21+
code path to maintain. When the agent is itself a Go program embedding
22+
your form in-process, the same form can be driven via
23+
`WithAnswers(map[string]any{...})`. Both surfaces reuse every validator
24+
and every option the form already enforces. There is no separate
25+
"headless mode" — huhx is the same form.
2326

2427
The wrapper mirrors huh's full chainable API; existing huh code ports by
2528
changing import paths.

0 commit comments

Comments
 (0)