rea
morluto
Reverse engineer anything with agents, from app behavior down to native binaries.
PROJECT TOPICS
INSTALL REFERENCE
dsh plugin --profile web add github:luisrinaldi/dsh-free-llm
该命令指向仓库当前默认分支;尚无绑定当前 commit 的完整验证结果。
PROJECT README
Use the AI coding CLIs you already have (including OpenCode's free models) as model providers inside DeepSeek Harness. No extra API keys, no proxy server: every turn is answered by a CLI installed on your own machine, under its own login, and a local dashboard shows what each one has used.
| Route | CLI | How a turn runs |
|---|---|---|
opencode |
OpenCode | opencode run --model <m> --format json — opencode/*-free models need no account |
grok |
Grok Build (xAI) | grok -p <prompt> -m <m> --output-format streaming-json |
codex |
OpenAI Codex | codex app-server --listen stdio:// (streamed JSON-RPC) |
*-free models (for example
opencode/deepseek-v4.1-flash-free) work without an account.Requirements: Node.js 20.11+ and a DeepSeek Harness profile. The peer
packages @deepseek-ai/cordis and @deepseek-ai/dsh-llm come from the harness.
Add the plugin to your profile. In the profile's package.json
(for example ~/.dsh/profiles/<name>/package.json):
{
"dependencies": { "dsh-free-llm": "git+https://github.com/luisrinaldi/dsh-free-llm.git#v1.0.1" },
"dsh": { "profile": { "bundles": ["dsh-free-llm"] } }
}
Pinning a tag (#v1.0.1) means you only get new code when you change it.
Use the git+https form: npm resolves the github: shorthand over SSH,
which fails on machines without a GitHub key.
Install the CLIs you want (any subset):
npm install -g @opencode/cli # OpenCode — free models, no account needed
npm install -g @openai/codex # Codex — then: codex login --device-auth
# Grok Build: follow xAI's instructions — then: grok login --device-auth
If you skip this step, the plugin installs a missing CLI the first time you use it (or press Install CLI on the plugin page).
Restart the profile. The routes appear in the model picker, and the plugin page appears under Plugins → Free LLM · OpenCode, Grok, Codex and Settings → Free LLM usage.
See docs/MOUNTING.md for a local checkout (junction/symlink) or a plain file insert.
Do not mount it next to another plugin that registers the same
opencode,grokorcodexroutes in the same profile.
This plugin starts other programs on your machine, so its defaults are conservative. Read SECURITY.md for the full model.
| Behaviour | Default | Change it with |
|---|---|---|
Install a missing CLI the first time a route needs it (official npm packages or the official x.ai installer, into ~/.dsh/clis) |
On | autoInstall: false |
| Install a CLI from the plugin page (Install CLI button, this machine only) | On | — |
| Check for or install plugin updates on a timer | Off | autoUpdate: 'check' or 'apply' |
| Codex sandbox | read-only |
providers.codex.sandbox: workspace-write |
| Dashboard from another machine | Refused | dashboardToken (16+ characters) |
| Setup and update actions from another machine or through a proxy/tunnel | Always refused | — |
Other guarantees:
.cmd shims are resolved
to their real target instead of being handed to cmd.exe.0600 and removed
after the turn.luisrinaldi/dsh-free-llm).includeSystemPrompt: false).toolBridge: false.--image, OpenCode
--file, Grok ACP image blocks. PNG, JPEG, WebP and GIF; up to 8 images of
20 MiB each (OpenCode: one image per request). Vision needs a capable model.provider_signin / provider_signin_status tools and
the plugin page show the CLI's real device URL and code, then poll until you
approve in the browser. Existing logins are reused.~/.dsh/clis — nothing is
installed globally. Installs are deduplicated, time-limited and verified with
--version.The bundle mounts the entry with defaults. A profile cordis.patch.yml
overrides it by id (a replacement config must restate every field it keeps):
- id: free-llm
config:
cwd: '/path/to/agent/workspace'
usageFile: '/path/to/.dsh/free-llm-usage.json'
providers:
opencode:
models: [opencode/deepseek-v4.1-flash-free]
codex: {}
grok: {}
# Optional budget gauges (the CLIs publish no quota for Grok/OpenCode):
plan:
grok:
monthlyBudgetUsd: 20
resetDay: 1
weeklyPremium: { usedPercent: 1, resetAt: '2026-10-23T15:13:00Z' }
opencode:
monthlyBudgetTokens: 100000000
resetDay: 1
| Option | Meaning |
|---|---|
cwd |
Fallback workspace for calls without a session. Session turns use the session's own workspace; a missing one fails explicitly. providers.<id>.cwd overrides it per route. |
providers.<id> |
false or { enabled: false } drops a route. Also bin, defaultModel, displayName, contextWindow. |
providers.<id>.models |
Explicit model list. Entries are a model id or { id, name?, contextWindow?, maxOutputTokens? }; a configured entry wins over any CLI cache and is labelled configured for this model. |
providers.opencode.contextWindowCap |
Caps OpenCode context (default 500,000). With preserveFreeContext: true (default), *-free models of 1M+ tokens keep their native context. modelInfoArgs: false disables catalog lookup. |
providers.codex.sandbox |
read-only (default) or workspace-write. The CLI's own policy can still refuse; the plugin never bypasses it. |
providers.codex.appServer |
false uses the older exec --json transport. liveQuota: false disables live quota requests; appServerArgs overrides the launch arguments. |
timeoutMs |
Per-turn timeout. |
includeSystemPrompt |
Forward system/developer instructions (default true). |
toolBridge |
JSON harness-tool relay (default on); false disables it. |
| Option | Meaning |
|---|---|
autoInstall |
Install a missing CLI on its first model turn or sign-in request (default true). false leaves installation to the Install CLI button or to you. |
cliInstallDir |
Absolute managed-install directory (default ~/.dsh/clis). |
installTimeoutMs |
Installer timeout (default 5 minutes). |
providers.<id>.installCommand |
Trusted operator setting { bin, args, binPath, binArgs? } for offline or custom installers. HTTP callers can never supply commands. |
signInTtlMs |
How long a device-code sign-in waits for you (default 10 minutes). |
| Option | Meaning |
|---|---|
usageFile |
Usage ledger (default ~/.dsh/free-llm-usage.json). Writes are locked and merged, so profiles can share it. |
dashboardToken |
Required for dashboard reads from another machine; 16+ characters. Sent as ?token=, an x-free-llm-token header, or the free_llm_token cookie. |
plan.<route> |
Optional monthlyBudgetUsd, monthlyBudgetTokens, resetDay (1–28) gauges; plan.grok.weeklyPremium copies grok.com's weekly limit. |
grokUsageDir |
Grok session stores (default ~/.grok/sessions). |
codexUsageDir |
Codex rollouts (default ~/.codex/sessions). |
codexModelsCache |
Codex model catalog (default ~/.codex/models_cache.json). |
opencodeStats.args |
Arguments for opencode stats (default stats --json --all --models --cost). |
autoUpdate |
false (default), 'check' or 'apply'. |
updateIntervalMs |
Timer for autoUpdate (default 24 h, minimum 1 min). |
updateSource |
Where the version check reads package.json (default this repository's main). |
updateInstall |
{ method: 'npm' \| 'git', dir, spec } when the plugin cannot detect how it was installed. |
Endpoints on the harness's own web server:
| Endpoint | Purpose |
|---|---|
GET /free-llm/usage · GET /free-llm/usage.json |
Charted page / JSON. ?days= or ?hours= (or the 5h · 7d · 30d · 90d · all buttons) set the window; ?force=1 rereads the CLI sources. |
GET /free-llm/setup.json · POST /free-llm/setup |
Host-only install, sign-in, status and cancel actions. |
GET /free-llm/update.json · POST /free-llm/update |
Host-only update check and install (needs the action token). |
The page shows every route and model with its limits, daily tokens per CLI, an
activity heatmap, token mix, cost by model, per-model tables, live Codex
5-hour and weekly limits (with recorded snapshots as a fallback) and, when you
configure plan, used-vs-budget gauges. An update installs with `npm install
Two independent views answer different questions:
~/.grok/sessions/<workspace>/<sessionId>/usage.json
(cost in ticks of 1e-10 USD). Until the CLI has run a session, the view is
"unavailable", not zero.opencode stats --json --all --models --cost (cached).
--days takes whole days, so sub-day windows are served at one day and the
page says so.token_count event of
~/.codex/sessions/<yyyy>/<mm>/<dd>/rollout-*.jsonl and queries
account/rateLimits/read through the installed CLI without starting an
inference turn.A figure a CLI does not report is shown as a dash, never as zero. Codex cost is always a dash. The two views can split the same total differently (Grok counts cached input inside input tokens; the turn event reports it separately), but both add up to the same total.
~/.grok/models_cache.json; real per-session
tokens and cost; no subscription quota (grok.com's weekly premium limit is
behind a private RPC), so the weekly gauge uses plan.grok.weeklyPremium or a
~/.grok/subscription.json snapshot.opencode api GET /api/model, and
usage via opencode stats. opencode/*-free needs no account; magpie/*
needs an authenticated OpenCode account.| Symptom | Fix |
|---|---|
free-llm: <cli> is not installed and autoInstall is false … |
Press Install CLI on the plugin page, install the CLI yourself, or remove autoInstall: false. |
| A CLI install fails | Check that Node/npm (and, for Grok on macOS/Linux, bash plus curl or wget) are available and that the machine has internet access. |
| The turn answers with a device code | The CLI is signed out: open the URL, enter the code, and retry. |
Cannot launch the Windows shim … |
Set providers.<id>.bin to the real executable. |
| Dashboard returns 403 from another machine | Configure dashboardToken (16+ characters) and pass it as ?token=. |
| Install/update buttons are refused | They only work on the machine running DSH, without proxies or tunnels. |
| A CLI view says "unavailable" | That CLI has not recorded any session yet on this machine. |
npm test # every test/*.test.mjs in its own process
The suite has no dependencies and makes no network calls: it drives stub
CLIs (test/stubs/stub-cli.mjs) that emit the CLIs' real JSON shapes and builds
synthetic Codex rollouts. Every test mount uses its own scratch ledger, so a
test run never touches a live profile. CI runs the syntax check and the suite on
Node 20, 22 and 24, on Linux and Windows.
Optional probes, not part of npm test: node test/_descendants.mjs checks
child-process cleanup on the current OS; node test/_codex-live-probe.mjs asks
a real, signed-in Codex CLI for its quota without starting an inference turn.
MIT.
This project is not affiliated with DeepSeek, OpenAI, xAI or OpenCode. Their names are used only to describe compatibility.
CLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: llm、free-llm、deepseek-harness。