Documentation
OnlyCLI is a BYOK AI agent for the terminal. It edits files behind a diff-approval gate, searches the web, and drives Roblox Studio and Godot 4 over MCP.
Install
Node.js 18.17 or newer is required.
npm install -g onlycli onlycli --version
From source:
npm install
npm run build
npm link # makes `onlycli` available everywhere
npm link points at dist/, so re-run npm run build
after changes; npm unlink -g onlycli removes it. If the command is not
found, restart the terminal — PATH changes do not reach already-open sessions.
During development you can skip the build with npm run dev or
npm run dev -- agent "...".
Quick start
# 1. Store a key (entered as hidden input) onlycli auth add --provider anthropic # 2. Interactive chat onlycli # 3. Or a one-off request onlycli agent "find the off-by-one error in this function" -f src/utils.ts
Providers
| Provider | --provider | Key from | Custom endpoint |
|---|---|---|---|
| Anthropic Claude | anthropic | console.anthropic.com | no |
| Google Gemini | gemini | aistudio.google.com | no |
| OpenAI / compatible | openai | platform.openai.com | yes, --base-url |
--base-url and /baseurl apply only to openai;
the Anthropic and Google SDKs use fixed endpoints. An http:// endpoint
produces a warning, because the key would travel in clear text.
CLI commands
| Command | Description |
|---|---|
onlycli / onlycli chat | Interactive chat. Default command. |
onlycli agent "<prompt>" | Single request, then exit. |
onlycli auth add|list|remove|default | Manage provider API keys. |
onlycli auth endpoint | Set or show the OpenAI-compatible endpoint. |
onlycli auth search add|list|remove | Manage optional web-search keys. |
onlycli status | Membership state and engine availability. |
onlycli setup | Re-run onboarding. |
onlycli --version | Print the version. |
Shared flags
These work on both chat and agent:
| Flag | Effect |
|---|---|
--provider <name> | anthropic, gemini, or openai. |
--model <id> | Model to use for this run. |
--base-url <url> | Override the OpenAI-compatible endpoint. Not saved. |
-f, --file <path> | Add a file to context. Repeatable. |
--scan | Scan the working directory and add source files. |
--no-web | Disable web search and page fetching. |
--max-tokens <n> | Cap the response length. |
--yes | Apply file changes without asking. |
agent also accepts --image <path> and
--clipboard to attach an image. Unquoted prompts are joined rather than
truncated, so onlycli agent add a jump animation sends the whole
sentence.
Slash commands
Inside chat, a line starting with / is handled locally and never sent to
the model. To send literal text that begins with /, start the line with
//.
| Command | Description |
|---|---|
/help | List all commands. |
/pwd, /ls [path] | Show the working directory / list its contents. |
/cd <path> | Change directory. No argument: home directory. |
/file <path...> | Pin a file; re-sent as context every turn. |
/files, /unfile <path|*> | List pinned files / unpin one or all. |
/scan | Scan the project and report a summary. |
/clear | Reset history; directory, provider, and model are kept. |
/provider <name>, /model <id> | Switch provider or model mid-session. Both are remembered for the next run. |
/baseurl <url|reset> | Change the OpenAI-compatible endpoint. |
/apikey | Change the key for the current or a chosen provider. |
/auto [on|off] | Apply file changes without approval. Remembered on this device. |
/web [on|off] | Toggle web search and page fetching. Default on; remembered on this device. |
/mcp <engine> | Connect to an engine. Aliases: /connect, /engine. |
/mcp list | List engines and their status. |
/mcp status | Show the active connection and tool count. |
/mcp disconnect | Close the engine connection. |
/status | Membership and engine status. Alias: /info. |
/version | Print the OnlyCLI version. |
/cls | Clear the screen and redraw the banner. |
/exit | Quit. Ctrl+C also works. |
Multi-line input: end a line with \ to continue it,
or open a block delimiter to paste several lines. Shift+Enter is not usable —
cmd.exe and PowerShell cannot distinguish it from a plain Enter.
Saved preferences
Session settings you change with a slash command are remembered on your own machine,
in ~/.onlycli/config.json. Nothing about them is sent to a server. The
persisted settings are:
| Command | Stored as |
|---|---|
/auto [on|off] | preferences.autoApprove |
/web [on|off] | preferences.web |
/provider <name> | defaultProvider |
/model <id> | models.<provider> (per provider) |
/baseurl <url|reset> | baseUrls.<provider> |
Precedence on startup is: flag for this run > saved preference > built-in
default. So --yes or --no-web stays one-shot and does not
rewrite what you chose earlier, while /auto on inside chat does persist.
The model is remembered per provider, so switching back to a provider restores the
model you last used with it rather than a global value that may not exist there.
Delete ~/.onlycli/config.json to reset every preference. API keys are
not in that file — see key storage.
Approval and /auto
By default every file write is shown as a diff and waits for your answer; press
d to see the full diff before deciding. /auto on (or
--yes) applies changes immediately — convenient for a long build-out
session, risky on a codebase you do not know.
Non-interactive runs never write. With piped input or in CI there is nothing that can approve a change, so pending edits are dropped rather than applied silently.
Web access
The agent can search and read pages by default; --no-web or
/web off turns it off. No key is needed — the keyless DuckDuckGo path is
used. That path scrapes HTML and is rate-limited, so adding a Brave or Tavily key
(onlycli auth search add, or BRAVE_API_KEY /
TAVILY_API_KEY) gives more reliable results.
How MCP works here
/mcp <engine> launches that engine's MCP server as a child process and
talks to it over stdio. On connect, the server's tool list is described to the model;
when the model wants one, it emits a tool block, OnlyCLI executes the call and returns
the result as the next turn's input.
/mcp list # engines and status /mcp roblox-studio # requires Roblox Studio to be open /mcp godot # requires Godot 4 and npx /mcp status # what is connected, how many tools /mcp disconnect
Roblox Studio
- Open Roblox Studio (a recent version, which ships the MCP server).
- Open the Assistant panel → ... ⟩ Manage MCP Servers → enable "Enable Studio as MCP server".
- Run
/mcp roblox-studioin chat.
No plugin and no manual token. Script paths are instance paths with no file
extension. StarterPlayerScripts and StarterCharacterScripts
are children of StarterPlayer, not services, so write the full path:
StarterPlayer/StarterPlayerScripts/Movement.
Creator Store models. A Store model is third-party content you cannot review on the approval screen, and backdoors hidden in free models are a real attack vector in Roblox. Scripts inside inserted models are therefore removed by default and the count is reported, so you notice when functionality is missing.
Godot 4
Godot support runs the community
godot-mcp
server through npx, pinned to a known version so an upstream release
cannot silently change the tool surface. The first connection downloads it.
The Godot binary is resolved in this order: GODOT_PATH, then
PATH, then common install and download folders — Desktop, Downloads,
%LOCALAPPDATA%\Programs, Program Files\Godot, the Steam
library, C:\Godot, plus the usual Unix locations and
Godot.app. Among several candidates the highest version wins, then the
most stable channel, then the non-console build (the _console variant
opens an extra terminal window).
# Windows setx GODOT_PATH "C:\path\to\Godot_v4.4-stable_win64.exe" # macOS / Linux export GODOT_PATH=/path/to/godot
Godot tools (14)
| Tool | Purpose |
|---|---|
launch_editor | Open the Godot editor on a project. |
run_project | Run the project in debug mode. |
get_debug_output | Read stdout/stderr from the running project. |
stop_project | Stop the running project. |
get_godot_version | Report the engine version. |
list_projects | Find Godot projects under a directory. |
get_project_info | Project structure and metadata. |
create_scene | Create a new scene file. |
add_node | Add a node to a scene. |
load_sprite | Load a texture into a Sprite2D/3D. |
export_mesh_library | Export a scene as a MeshLibrary resource. |
save_scene | Save a scene, optionally under a new name. |
get_uid | Resource UID of a file (Godot 4.4+). |
update_project_uids | Refresh UID references project-wide (Godot 4.4+). |
Godot limitations worth planning around
The MCP tools create, they do not revise.
create_scene and add_node add things. There is no tool to
rename, reconfigure, reparent, or delete an existing node, and none to delete a
scene. Iterating therefore happens through ordinary file editing:
.tscn is a readable text format, so OnlyCLI's normal
read/write/diff-approval path covers what the MCP surface cannot.
Engine path ≠ project path. GODOT_PATH points at the
Godot executable. Paths passed to the MCP tools are project paths — a project
directory is one containing project.godot — while the file tools
resolve paths relative to your chat working directory (/cd,
/pwd).
Leave project.godot to the engine. Godot rewrites
that file itself, so a concurrent agent edit can be overwritten or leave a
conflicting state. For keyboard movement without touching it, use the built-in
ui_left / ui_right / ui_up /
ui_down actions, which every project already has. The tradeoff: arrow
keys work immediately, while WASD needs a custom input action — which means
editing project.godot, so add that in the Godot editor rather than
through the agent.
Unity and Unreal appear in /mcp list but are not implemented yet.
Key storage
Keys are looked up in this order:
-
Environment variable —
ANTHROPIC_API_KEY,GEMINI_API_KEY,OPENAI_API_KEY. Overrides everything. Best for CI. -
OS keychain — via the optional
@napi-rs/keyringdependency (Keychain, Credential Manager, Secret Service). Primary storage when installed. -
~/.onlycli/credentials.json— fallback, written with0600.
The file fallback stores keys as plain text and the CLI warns when it is used.
Encrypting it with a key kept on the same machine would add no real protection, so
that is deliberately not done; use an environment variable if you want stronger
isolation. onlycli auth list masks keys and a full value is never printed.
Environment variables
| Variable | Effect |
|---|---|
ANTHROPIC_API_KEY | Anthropic key; overrides stored credentials. |
GEMINI_API_KEY | Google Gemini key. |
OPENAI_API_KEY | OpenAI-compatible key. |
OPENAI_BASE_URL | Default OpenAI-compatible endpoint. |
GODOT_PATH | Path to the Godot executable. |
BRAVE_API_KEY, TAVILY_API_KEY | Web search backends. |
ONLYCLI_DEBUG=1 | Print stack traces on error. |
Security behavior
-
Files that may hold secrets (
.env,credentials.json,*.pem,*.key,.npmrc) are neither added to context nor writable by the agent. -
Agent file paths resolve inside the working directory;
../and escaping absolute paths are rejected. Your own/cdnavigation is unrestricted — the limit is on the agent's authority, not on you. - No file is written without approval unless you opt out with
/autoor--yes. - Web text reaches the model as untrusted data inside an explicitly delimited block; instruction-shaped sentences in it are not obeyed. That is a mitigation, not a guarantee — review diffs when the agent has been reading foreign content.
-
Page fetching allows only
http/httpsand rejectslocalhost, private ranges (10.x, 192.168.x, 172.16–31.x), link-local169.254.x(cloud metadata), and single-label hostnames. Addresses are re-checked after each redirect, so a redirect cannot walk into the internal network (SSRF). -
URLs with embedded credentials (
user:pass@host) are rejected. Response size and request time are capped; non-text responses are not downloaded.
Troubleshooting
| Symptom | What to do |
|---|---|
onlycli not found after install |
Restart the terminal, then confirm the bin directory from npm prefix -g is on PATH. |
| "Godot executable not found" | Set GODOT_PATH to the binary itself, not its folder. |
| Godot connect hangs on the first run | npx is downloading the pinned godot-mcp package. Later connections are fast. |
| Roblox connect fails | Studio must be running with "Enable Studio as MCP server" turned on in the Assistant panel. |
| The model describes an edit but nothing is written | Approval is required; in a piped or CI run nothing can approve, so edits are dropped. |
| Opaque error message | Re-run with ONLYCLI_DEBUG=1 for the stack trace. |
Chat history lives in memory only and is lost when the CLI exits. Multi-model routing, Unity/Unreal targets, and persistent project memory are not implemented yet.