{ "name": "agent", "section": 1, "title": "OpenAI-compatible autonomous coding agent", "synopsis": [ "agent [--setup | --reset]", "agent reset", "agent [--setup] REQUEST" ], "description": "Runs a persistent ReAct-style loop against any OpenAI-compatible HTTPS API (Groq, OpenAI, xAI, etc.). **No environment variables** are used for credentials: everything lives in **`~/.agent/config.json`** on your **personal Hyperdrive**, created on first run with Groq-oriented defaults. Config also supports **`allow_delete`** (default false) and optional **`require_confirm_token`** for the **`delete_path`** tool when delete is enabled.\n\nOn a **TTY**, the interactive shell line editor is suspended during the session (**`suspendReplForSubprocess`**). Assistant output streams with ANSI highlighting; tool invocations are labeled.\n\n**Interrupt:** **Ctrl+C** aborts in-flight HTTPS requests (**`SIGINT`** / **`AbortSignal`**) and restores the REPL.\n\n**HTTPS policy:** Delegated **`fetch`** follows the booter (**`ctx.httpFetch`**). Where **`BARE_OS_HTTP_ALLOWLIST`** is set, operators must include your provider hostname (for example **`api.groq.com`**, **`api.openai.com`**, **`api.x.ai`**).\n\n**Tools (VFS & shell):** **`read_file`**, **`write_file`**, **`edit_file`**, **`create_directory`**, **`list_directory`**, **`file_stat`**, **`move_path`**, **`delete_path`**, **`search_files`** (**`grep`**), **`run_command`** (optional **`capture_exit`** for a final **`EXIT:`** line in the capture file), **`run_js_script`**, **`run_js_script_at_path`**, **`get_system_info`**, **`get_resource_limits`**, **`read_proc_file`**, **`get_swarm_peers`**, **`read_man_page`**, **`apropos_man`**, **`edit_agent_config`**, **`list_bin`**, **`task_complete`**. **Node is not installed** — use **`run_js_script`** (or a saved **`.mjs`** with **`run_js_script_at_path`**) for JavaScript; not via **`node` / `npx`**. The merged manual is at **`/share/man/man.json`**; prefer **`read_man_page`** / **`apropos_man`** over shelling **`man`** when you only need text.", "options": [ { "flag": "--setup", "meaning": "interactive prompts for REST base URL, API key, model, provider; writes **`~/.agent/config.json`**" }, { "flag": "--help", "meaning": "usage summary (also **`-h`**)" }, { "flag": "--reset", "meaning": "clear **`~/.agent/history.json`** and truncate **`~/.agent/progress.txt`** (fresh chat session; **`config.json`** unchanged)" } ], "files": [ "~/.agent/config.json — REST endpoint, bearer token, model, sampling, **max_iterations**, **allow_delete**, **require_confirm_token**", "~/.agent/history.json — truncated chat messages", "~/.agent/progress.txt — human-readable tool log", "~/.agent/instructions.md — optional user goals (**read** once per session)", "~/.agent/context.md — optional long-running context (**read** once per session)", "~/.agent/last_command_out.txt — stdout/stderr capture for **`run_command`** when possible" ], "keywords": ["agent", "openai", "groq", "rest", "llm", "react", "tools"], "examples": [ { "caption": "configure credentials", "code": "agent --setup" }, { "caption": "clear chat session history", "code": "agent --reset" }, { "caption": "natural-language task", "code": "agent \"list ten random names from /bin\"" } ], "seeAlso": [ { "name": "man", "section": 1 }, { "name": "bare-os-shell", "section": 7 }, { "name": "curl", "section": 1 } ], "bareOsNotes": "Session blocks shell input via REPL suspend; **`ctx.readLine`** masking for API keys depends on booter capabilities. Prefer **`chmod 600`** on **`config.json`** (best-effort)." }