man oscar The manual

Everything, explained.

Oscar is a small agent with a lot of edges. This page is the working manual for v0.0.1: install, providers, approvals, the jail, Matrix, Lua and the harness. It tracks the repository docs as they change.

VERSION 0.0.1 PLATFORM Linux LICENSE MIT (public release) STATE pre-release
MANUAL / v0.0.1PRE-RELEASE

Install

Oscar ships as a single Linux binary. The installer downloads the latest release, verifies its SHA-256, and puts oscar in ~/.local/bin.

install · linux
curl -fsSL https://oscar-agent.com/install.sh | sh
Pre-release. Pin a build with OSCAR_VERSION=0.0.1, or choose a prefix with OSCAR_PREFIX=/usr/local. The installer refuses macOS and Windows.

From source

Rust is the only build dependency. There is no Python, Node, or package manager at runtime.

build from source
git clone https://git.arkhost.cloud/ArkHost/OscarAgent.git
cd OscarAgent
cargo build --release
./install.sh

First run

With no configuration, oscar offers setup on a terminal. Setup asks for a provider, a key (hidden), and a model, then verifies the credentials with one small live request before writing anything.

first run
oscar setup
oscar
oscar run "summarise the README" --workspace .

Configuration lives in ~/.oscar. The key goes to credentials.env (0600); the rest goes to config.toml, which contains no secrets.

No default provider. Oscar will not assume OpenAI, and it will not silently fall back to another vendor. If nothing is configured, it says what is missing.

Configuration

Precedence is: explicit flag → environment → config.toml → default. Provider, model and base URL are resolved together, so changing provider by environment cannot pair an OpenCode model with OpenRouter.

~/.oscar/config.toml
# ~/.oscar/config.toml (no secrets)
provider  = "opencode-go"
model     = "deepseek-v4.1-flash"
base_url  = ""                 # optional provider override
workspace = "/home/you/code"
approve   = "ask"              # ask | auto | never
sandbox   = "host"             # host | workspace
SettingEnvironment
providerOSCAR_PROVIDER
modelOSCAR_MODEL
workspaceOSCAR_WORKSPACE
homeOSCAR_HOME
approval modeOSCAR_APPROVE

Keys use the provider's own variable: OPENCODE_GO_API_KEY, OPENROUTER_API_KEY, OPENAI_API_KEY, ANTHROPIC_API_KEY. They are never printed; oscar doctor reports only whether a key is configured and where it came from.

Providers

ProviderBase URL
opencode-gohttps://opencode.ai/zen/go/v1
openrouterhttps://openrouter.ai/api/v1
openai-compatiblehttps://api.openai.com/v1 or OPENAI_BASE_URL
anthropichttps://api.anthropic.com

OpenCode Go routing

OpenCode Go serves different model families through different APIs. Oscar chooses per model:

  • Chat completions by default.
  • Anthropic Messages for claude-, minimax-, qwen and union-alpha models.
  • OpenAI Responses for gpt-, grok- and muse-spark models, with reasoning carried between turns.

Requests carry a per-conversation x-opencode-session header (a hash, never the local session id). Model ids are the bare slug: glm-5.3, not opencode-go/glm-5.3.

Models

models
oscar model                 # current provider, model, base and source
oscar model list            # live list, cached 1h; unusable models marked
oscar model set glm-5.3     # validate and persist
oscar model set --provider openrouter anthropic/claude-sonnet-4.5

Inside chat, /model <id> switches for that chat only; /model <Tab> completes from the live list. In Matrix, !model <id> switches for that room. Oscar refuses an id the live endpoint doesn't list.

Approvals & sandbox

Approval tiers are allow, ask, deny and confirm. Policy deny is final in every mode. Dangerous-but-recoverable commands (recursive deletes, git reset --hard, force pushes, dd of=) always require a human, even with --approve auto.

ModeBehaviour
askPrompt for ask-tier calls; refuse when there is no terminal.
autoApprove ask-tier calls and append an audit line before running.
neverRefuse ask-tier calls without prompting.

sandbox = "host" (the default) runs commands and file tools on the machine as you, with network, like a person at the terminal. Oscar's own folder is out of reach (apart from the skill folders, which skills read and run scripts from), secrets are removed from the environment commands see, and every command is written to ~/.oscar/audit/commands.jsonl.

Want a hard boundary? Use the workspace sandbox. With sandbox = "workspace" shell tools run in a user + mount + pid + network namespace with a chroot, dropped capabilities and no_new_privs. Every .git entry is read-only and the workspace is the only folder in reach. In host mode the approval gate is the boundary, and it is documented as such.

Chat & TUI

On a terminal, oscar opens the full-screen TUI. --line (or a non-terminal) gives the plain line interface.

  • Enter sends, Alt+Enter adds a line.
  • Tab completes commands, model ids and sessions.
  • PgUp / PgDn scroll; Ctrl-C stops a turn, then clears, then quits.
  • Approval box: y allow, s allow for the session, n deny.
CommandDoes
/helpCommand palette
/model [id]Switch model for this chat
/undoRemove your last message and its reply
/retryAsk the last message again
/newStart a new session
/costTokens and cost so far
/memoryRead or edit long-term memory
/proposalsSkills proposed from your work; /accept <id>, /reject <id>
/checkpointCreate or restore a checkpoint
/exitLeave

Matrix gateway

Oscar joins as its own account and answers only allowed users. A SQLite delivery ledger means a restart never answers the same event twice; one message is processed at a time per gateway.

matrix · serve
export MATRIX_HOMESERVER=https://matrix.example.org
export MATRIX_ACCESS_TOKEN=...
export MATRIX_ALLOWED_USERS=@you:example.org
export MATRIX_E2EE=on
oscar matrix serve

Encryption

  • Keys live in ~/.oscar/matrix-crypto/. Keep this folder; losing it means a new device login.
  • MATRIX_E2EE=on serves encrypted rooms; otherwise they are refused. Plaintext is never sent into an encrypted room.
  • Default trust: decrypt only from, and share keys only with, devices their owner cross-signed. MATRIX_E2EE_TRUST=any relaxes both.

Room commands

Matrix clients keep /, so Oscar uses !: !new, !status, !model [id], !undo, !retry, !stop, !approve, !approve session, !deny, !usage, !whoami, !proposals, !accept <id>, !reject <id>, !help.

Approval messages carry pre-seeded ✅ / 🔁 / ❌ reactions. Only an allowed user's reaction resolves the request; the bot's own pills are ignored. Timeout is a deny.

Lua tools

A tool is one file in ~/.oscar/tools/ returning a table. It runs in a fresh Lua 5.4 VM with only table, string, math, utf8 and coroutine. There is no io, os, package, debug, require, load or dofile.

~/.oscar/tools/word_count.lua
-- ~/.oscar/tools/word_count.lua
return {
  name = "word_count",
  description = "Count words in a workspace file.",
  parameters = {
    type = "object",
    properties = { path = { type = "string" } },
    required = { "path" }
  },
  capabilities = { "fs.read" },
  run = function(args)
    local n = 0
    for _ in oscar.fs.read(args.path):gmatch("%S+") do n = n + 1 end
    return tostring(n)
  end
}

Capabilities are explicit: fs.read exposes oscar.fs.read and oscar.fs.list; fs.write exposes oscar.fs.write and makes the tool approval-tier. Paths go through the same workspace check as the built-in file tools. Each call has an instruction budget and a 32 MiB memory limit; exceeding either fails the call, not the agent.

exec and http capabilities are not offered yet. A tool that asks for them is refused at load.

Skills & memory

Skills are directories with a SKILL.md (name, description, body). Provenance comes from location: bundled (read-only), user, or agent. Bundled skills cannot be archived, shadowed or managed.

Oscar learns in the background, after the reply: every 10 messages a memory review saves what is worth keeping, and after 10 tool-using steps a skill review may write a proposal (a new skill, or a patch when one overlaps). Proposals never apply themselves: oscar proposals accept, /accept in chat, !accept in Matrix. oscar learn distils a source into a proposal. OSCAR_REVIEW=0 turns the reviews off.

Memory is two small files in ~/.oscar, in every prompt: MEMORY.md (environment facts, 2,200 characters) and USER.md (who you are, 1,375 characters). A full file asks the agent to consolidate. The memory tool writes atomically behind a lock and refuses credential-shaped content. The curator is inactivity-gated, never deletes, and never moves a pinned skill.

Project files load as context, the first kind found: .oscar.md / OSCAR.md (up to the git root), the AGENTS.md chain from the git root down, CLAUDE.md, or .cursorrules. SOUL.md in ~/.oscar is the persona.

Connectors

Everything here is optional. A component that is not configured is simply not offered to the model; oscar doctor lists each one as on or off and how to turn it on. Keys use the usual variable names in ~/.oscar/credentials.env; choices go in config.toml.

ConnectorHow it works
web_searchKeyless free tier by default; Tavily, Exa, Parallel, Firecrawl, Brave or SearXNG with a key or web_backend.
browserA real Chromium over CDP: Browserbase, any CDP endpoint, or a local Chromium. Only http(s); local addresses need BROWSER_ALLOW_PRIVATE=true. No anti-bot evasion code.
Hindsightmemory_provider = "hindsight": recall before each turn, save after, and hindsight_* tools. Cloud or your own server; extra banks can be read-only.
MCP serversLocal (stdio) or remote (HTTP, OAuth). Each server tool becomes an Oscar tool. oscar mcp catalog lists 66 servers; oscar mcp add, login, refresh.

Each search, page, browser action and MCP call asks for approval like web_fetch does; "allow for this session" makes it one click.

Harness & Pi

Oscar speaks its own one-way JSON-lines harness protocol on stdin/stdout. Pi talks to it through the adapter in contrib/pi-adapter/; Pi's RPC is not reused, so the boundary stays explicit.

harness
# one-way JSONL: Oscar's own harness protocol
oscar serve --jsonl

# Pi side adapter (contrib/pi-adapter)
# Pi sends prompts, Oscar streams events and tool results back.

The harness is the surface for editor and agent integrations. A real Pi 1.6.0 round trip is in the repository's design notes.

CLI reference

CommandDoes
oscarFull-screen chat; offers setup when unconfigured
oscar chatChat with an explicit session
oscar run "task"One-shot run
oscar setupProvider, key, model, live verify, save
oscar modelShow or set the default model
oscar doctorEnvironment, key source, confinement; --probe
oscar sessionsRecent sessions
oscar matrixProbe, sync once, send, serve, create-room
oscar skillsList, lint, archive, restore
oscar curatorInactivity lifecycle, consolidate
oscar memoryRead or edit MEMORY.md / USER.md
oscar learnDistil a source into a skill proposal
oscar proposalsList, show, accept, reject
oscar mcpCatalog, add, remove, list, login, logout, refresh
oscar serve --jsonlHarness protocol

Troubleshooting

ErrorWhat to do
no provider configuredRun oscar setup, or set OSCAR_PROVIDER, OSCAR_MODEL and the key.
HTTP 401Wrong or missing key. oscar model shows where the key is expected from.
a connector is offoscar doctor says why (no key, no Chromium, Hindsight unreachable) and what to set.
approval refusedNo terminal, or mode is never. Run in a TTY or use --approve auto (audited).
encrypted room refusedSet MATRIX_E2EE=on. Oscar never sends plaintext into an encrypted room.
credentials readable by otherschmod 600 ~/.oscar/credentials.env.
Docs still cooking. The repository's docs/ directory is the source of truth while v0.0.1 stabilises. If this page and the repository disagree, the repository wins.