Configuration used to start the Autohand CLI subprocess.
Common fields:
cwd: working directory for the agent.cli_path: optional Autohand CLI binary path.debug: print CLI diagnostic output.timeout: JSON-RPC request timeout.model: model override passed to the CLI.skills: skills passed to the CLI.append_system_prompt: additional system instructions.unrestricted,auto_mode,auto_skill,auto_commit: execution mode flags.context_compact: enable or disable context compaction.yolo,yolo_timeout_seconds: unattended permission policy.
Helpers:
auto config = autohand::Config::from_environment()
.with_cwd(".")
.with_model("fantail2")
.with_skill("cpp")
.with_instructions("Prefer small, typed C++ APIs.");Low-level JSON-RPC wrapper.
Important methods:
start()/stop()request(method, params_json)prompt(message, options)stream_prompt(message, on_event, options)interrupt()set_plan_mode(enabled)set_permission_mode(mode)set_model(model)get_state()get_messages()permission_response(request_id, decision)
High-level API for application code.
autohand::Agent agent(autohand::Config::from_environment().with_cwd("."));
auto run = agent.send("Review the public API.");
auto result = run.wait();
agent.close();Methods:
send(prompt, options)run(prompt, options)run_json(prompt, schema_json)allow_permission(request_id)deny_permission(request_id)set_plan_mode(enabled)close()
Represents a single agent run.
stream(on_event): stream events and record final text.wait(): wait until the run finishes and collect text/events.json_text(): parse final output as JSON text.abort(): interrupt the current run.
Typed event envelope with raw JSON access.
Helpers:
text_delta()message_content()tool_name()request_id()description()
Event types include:
agent_startturn_startmessage_updatemessage_endtool_starttool_updatetool_endpermission_requesterror
auto json = agent.run_json(
"Assess release readiness.",
R"({"summary":"string","risks":[]})");