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.

install
npm install -g onlycli
onlycli --version

From source:

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

first run
# 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--providerKey fromCustom endpoint
Anthropic Claudeanthropicconsole.anthropic.comno
Google Geminigeminiaistudio.google.comno
OpenAI / compatibleopenaiplatform.openai.comyes, --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

CommandDescription
onlycli / onlycli chatInteractive chat. Default command.
onlycli agent "<prompt>"Single request, then exit.
onlycli auth add|list|remove|defaultManage provider API keys.
onlycli auth endpointSet or show the OpenAI-compatible endpoint.
onlycli auth search add|list|removeManage optional web-search keys.
onlycli statusMembership state and engine availability.
onlycli setupRe-run onboarding.
onlycli --versionPrint the version.

Shared flags

These work on both chat and agent:

FlagEffect
--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.
--scanScan the working directory and add source files.
--no-webDisable web search and page fetching.
--max-tokens <n>Cap the response length.
--yesApply 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 //.

CommandDescription
/helpList 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.
/scanScan the project and report a summary.
/clearReset 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.
/apikeyChange 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 listList engines and their status.
/mcp statusShow the active connection and tool count.
/mcp disconnectClose the engine connection.
/statusMembership and engine status. Alias: /info.
/versionPrint the OnlyCLI version.
/clsClear the screen and redraw the banner.
/exitQuit. 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:

CommandStored 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
/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

  1. Open Roblox Studio (a recent version, which ships the MCP server).
  2. Open the Assistant panel → ... ⟩ Manage MCP Servers → enable "Enable Studio as MCP server".
  3. Run /mcp roblox-studio in 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).

GODOT_PATH
# Windows
setx GODOT_PATH "C:\path\to\Godot_v4.4-stable_win64.exe"

# macOS / Linux
export GODOT_PATH=/path/to/godot

Godot tools (14)

ToolPurpose
launch_editorOpen the Godot editor on a project.
run_projectRun the project in debug mode.
get_debug_outputRead stdout/stderr from the running project.
stop_projectStop the running project.
get_godot_versionReport the engine version.
list_projectsFind Godot projects under a directory.
get_project_infoProject structure and metadata.
create_sceneCreate a new scene file.
add_nodeAdd a node to a scene.
load_spriteLoad a texture into a Sprite2D/3D.
export_mesh_libraryExport a scene as a MeshLibrary resource.
save_sceneSave a scene, optionally under a new name.
get_uidResource UID of a file (Godot 4.4+).
update_project_uidsRefresh 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:

  1. Environment variableANTHROPIC_API_KEY, GEMINI_API_KEY, OPENAI_API_KEY. Overrides everything. Best for CI.
  2. OS keychain — via the optional @napi-rs/keyring dependency (Keychain, Credential Manager, Secret Service). Primary storage when installed.
  3. ~/.onlycli/credentials.json — fallback, written with 0600.

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

VariableEffect
ANTHROPIC_API_KEYAnthropic key; overrides stored credentials.
GEMINI_API_KEYGoogle Gemini key.
OPENAI_API_KEYOpenAI-compatible key.
OPENAI_BASE_URLDefault OpenAI-compatible endpoint.
GODOT_PATHPath to the Godot executable.
BRAVE_API_KEY, TAVILY_API_KEYWeb search backends.
ONLYCLI_DEBUG=1Print stack traces on error.

Security behavior

Troubleshooting

SymptomWhat 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.