@studiofrontier/coding-agent
v0.2.0
Published
A local terminal coding agent (BYOK) — reads, searches, edits files and runs shell commands through an LLM over any OpenAI-compatible endpoint.
Readme
coding-agent
A local, terminal-based coding agent — an LLM that reads, searches, and edits files in your repo and runs shell commands through an interactive approval gate. It runs entirely on your machine and talks to any OpenAI-compatible endpoint using your own API key (BYOK — bring your own key). Your code and your key never touch anyone else's servers; requests go only to the provider you configure.
Install
npm install -g @studiofrontier/coding-agentOr run without installing:
npx @studiofrontier/coding-agent setupRequires Node.js >= 20.
Configure (BYOK)
Run the one-time setup to store your provider credentials locally:
coding-agent setupIt prompts for three things:
- Base URL — any OpenAI-compatible endpoint, e.g.
https://api.openai.com/v1, an OpenRouter URL, a Gemini OpenAI-compatible URL, or your own gateway. - API key — your provider key (input is hidden; stored locally only).
- Model id — e.g.
gpt-4o,gemini-2.0-flash, or whatever your endpoint exposes.
Credentials are written to ~/.config/coding-agent/config.json (or
$XDG_CONFIG_HOME/coding-agent/config.json) with owner-only permissions (0600).
The API key is sent only to the endpoint you configure.
Non-interactive / CI:
coding-agent setup --base-url https://api.openai.com/v1 --api-key sk-... --model gpt-4o
coding-agent setup --show # print current config (key redacted)
coding-agent setup --path # print the config file locationConfiguration precedence
Each field is resolved from the first source that provides it:
| Priority | Source | Notes |
|---|---|---|
| 1 | Environment variables | CODING_AGENT_BASE_URL, CODING_AGENT_API_KEY, CODING_AGENT_MODEL (the LITELLM_* names also work as aliases) |
| 2 | A .env in the current directory | Handy for per-project overrides |
| 3 | The stored config | Written by coding-agent setup |
This means a project .env or an exported env var can override your global key,
and CI can inject everything via environment variables.
Usage
Interactive REPL:
coding-agentSlash commands inside the REPL: /help, /clear, /reset, /sessions [all],
/resume <id>, /exit. While the agent is working you'll see a live spinner
(⠋ Thinking… (3s), ⠋ Running bash… (1s)).
Multi-line input: end a line with a backslash (\) to continue onto a new
line; a plain Enter submits. (Terminals don't send a distinct code for
Shift+Enter, so this shell-style continuation is the portable way to write
multi-line prompts.)
One-shot (pipeable — the answer goes to stdout, notices to stderr):
coding-agent -p "summarize what this project does"
coding-agent "add a CHANGELOG.md with an Unreleased section"Options
-p, --print one-shot mode; prompt is read from the arguments
-c, --continue resume the most recent session for the current directory
--resume <id> resume a specific session by id (prefix ok)
--model <id> override the model for this run
--cwd <dir> workspace root (default: current directory)
--max-steps <n> max tool round-trips per turn (default: 25)
--yolo auto-approve all tool calls (no prompts)
--verbose debug logging to stderr
-h, --help show helpSessions & history
- Input recall: press ↑/↓ in the REPL to recall prompts from previous
sessions (persisted to
~/.config/coding-agent/history). - Session resume: interactive REPL conversations are saved per project under
~/.config/coding-agent/sessions/. Resume the most recent one for the current directory withcoding-agent -c, or a specific one withcoding-agent --resume <id>(list them with/sessions). One-shot-pruns are ephemeral and are never saved. Resuming keeps a fresh system prompt for the current directory and replays the saved messages after it.
Safety
- File tools are confined to the workspace root — the agent cannot read or
write outside the directory it's launched in (or
--cwd). - Shell commands are not sandboxed. Their safety boundary is the approval
prompt:
write_file,edit_file, andbashask for confirmation (y / n / always-allow) before running.--yolodisables prompting — use it only in environments you trust.
License
ISC © Chetan Bhogade
