outsourcerer
Make your AI coding tools work as one team. Orchestrate jobs across Claude, Codex, Cursor, Devin, local models, and more. Carry your setup + context, track every cost.
Safety scan
A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.
Check it deeper on your machine
It has changed since its scan on 11 Nov 2026. Its scripts were only partly scanned.
As a Claude Code plugin, install it and then ask Claude Code:
/plugin marketplace add keithmackay/mackayi/plugin install scanskillsafety@mackayiDo a deep scan of https://github.com/alexgreensh/outsourcerer with scanskillsafety
Or from a terminal, clone it and run it:
git clone https://github.com/keithmackay/scanskillsafety-skill ~/.claude/skills/scanskillsafetynode ~/.claude/skills/scanskillsafety/cli.cjs --deep 'https://github.com/alexgreensh/outsourcerer'
It checks the exact commit: every file, its packages against OSV (api.osv.dev), how it compares with this page's scan (findsafeskills.com receives the repository's address), and, if you agree, Claude reading every file with your own Claude subscription. It never runs the code.
Badge for your README
Markdown
[](/listings/alexgreensh--outsourcerer)HTML
<a href="/listings/alexgreensh--outsourcerer"><img src="/api/listings/alexgreensh--outsourcerer/badge.svg" alt="findsafeskills safety rating" /></a>Install
What was scanned
The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.
.claude-plugin/marketplace.json · Manifest · 31 lines
View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)
This file has changed since it was scanned, so this is not exactly the text that was scanned, and no line is marked. The findings are listed with the safety scan above.
- {
- "$schema": "https://json.schemastore.org/claude-code-marketplace.json",
- "name": "outsourcerer",
- "owner": {
- "name": "Alex Greenshpun",
- "url": "https://github.com/alexgreensh"
- },
- "metadata": {
- "description": "The Outsourcerer marketplace: make your AI coding tools work as one team, with your current session staying the orchestrator.",
- "pluginRoot": "./plugins"
- },
- "plugins": [
- {
- "name": "outsourcerer",
- "source": "./plugins/outsourcerer",
- "description": "Make your AI coding tools work as one team. Route jobs across Claude Code, Codex, Cursor, Devin, Gemini, OpenRouter, and local models; carry the user's setup into delegated work; track limits and cash cost; and convene multi-model reviews.",
- "category": "productivity",
- "tags": [
- "delegation",
- "offload",
- "orchestration",
- "codex",
- "cursor",
- "devin",
- "gemini",
- "openrouter",
- "cost-optimization"
- ]
- }
- ]
- }
README.md · README · 432 lines
View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)
This file has changed since it was scanned, so this is not exactly the text that was scanned, and no line is marked. The findings are listed with the safety scan above.
- <div align="center">
- <img src="readme-assets/hero.png" alt="Outsourcerer, delegate the grind, keep the glory" width="900">
- [](https://github.com/alexgreensh/outsourcerer/releases)
- [](https://github.com/alexgreensh/repo-forensics)
- [](LICENSE)
- 
- 
- 
- 
- 
- 
- ### Your AIs, working as one team.
- Outsourcerer is the orchestrator for every AI you already have. It splits the work, hands each piece to the right model in the right harness, keeps long jobs running, checks the results, and shows you the receipt.
- </div>
- ---
- You already have a fleet: Claude Code, Codex, Gemini, maybe Cursor or Devin, a stack of OpenRouter credits. Each is brilliant at something the others aren't, and they sit in separate rooms. **Outsourcerer gets them working as one team, with you as the boss.**
- The session you're talking to becomes the lead. It hands the grind to a budget model, the hard calls to a frontier one, the private stuff to a model on your own machine, and brings your own skills along to whichever engine does the job. No server, no framework to learn. You just talk to it.
- ## Three things a router can't do
- **It orchestrates.** One crew across Claude Code, Codex, Cursor, Droid, Antigravity, Devin, Hermes, Warp, Cline, Pi and even your Grok Bot. Specialists run side by side, advisors argue out a plan before anyone builds, and every job is watched until it ends with a clear result.
- **It runs long.** A big job lives on disk as a plan, not in a chat. Close the laptop, lose the session, come back tomorrow: the plan picks up where it stopped. Decisions that are yours wait for you, and a watcher can wake you when something needs you.
- **It proves the work.** Nothing grades its own homework. "Done" means your tests passed and the proof is saved. Reviews are tied to the exact build they approved, and merges land one at a time and get tested again.
- And it saves you money and limits along the way. That's what happens when the grind stops running on your most expensive model. *(The [Tab](#the-tab-a-receipt-you-can-actually-believe) shows exactly how much.)*
- ---
- ## You talk. The sorcerer handles it.
- No flags to memorize, no routing tables. You say what you want; it checks what you actually have installed, picks the right engine for each piece, and offers the cheap path before spending a cent it didn't have to.
- <img src="readme-assets/convo-offload.svg" alt="Terminal: you ask to map auth; Outsourcerer offloads it to GLM-5.2 on OpenRouter and logs a real saving to your Tab" width="100%">
- If something isn't installed, it tells you the one command to fix it. You just say yes.
- ---
- ## What you can ask it to do
- - **Run a whole build as a plan.** Advisors plan it, a worker builds it, another model reviews it, and it merges only after your tests pass on the result. Survives crashes and restarts. *(Its own section below.)*
- - **Run agents in parallel.** Fan out a whole multi-agent gauntlet (a QA sweep, a per-module review, N reviewers) across any backend at once with `fanout`, watch them live, and collect every finding into one file. No 16-session bootstrap tax.
- - **Convene advisors.** Have several stronger models review a plan or a diff in parallel, improve it, and only proceed on consensus.
- - **Bring your setup along.** Hand the job your skills (`--with skills=x`, or `all`) and the delegate works with the whole skill - docs, references, scripts - on tool-capable harnesses; text-only lanes get the complete docs with executables honestly marked NOT TRANSFERRED. MCP servers on request (`--with mcp=`), on the Claude lanes, verified present before launch.
- - **Loop it until it's green.** Try, check, try again on a cheap model, with *your* tests deciding when it's done. *(Its own section below.)*
- - **Offload the grind.** Repo mapping, mechanical refactors, running the test suite, big searches. Cheap model does it; your main agent stays the boss.
- - **Generate images.** **GPT-image first** on your Codex plan (keyless, no API credits), then nano-banana or an OpenRouter image model. *(Every illustration in this README was rendered exactly this way, by Outsourcerer, keyless, `$0` cash.)*
- - **Review anything visual.** Screenshots, UI, design, handed to Gemini, keyless on your Antigravity login.
- - **Run it on your own machine.** A local model on Ollama or LM Studio runs the job on your hardware: `$0`, no tokens burned, fully private. *(Its own section below.)*
- - **Find the cheap seats.** Ask what's free or cheap right now across your platforms (`suggest`). It reads each catalog live, so it keeps up as new models drop (a fresh free model on Devin or OpenRouter shows up on its own).
- - **See what you're saving.** The **Tab** shows real spend vs your frontier model, per lane.
- - **Ban a model for good.** `exclude add fable` and it is never picked again, by you or by the router. (It can't see a model an engine picks silently on its own.)
- All of it in plain language. The commands underneath are the sorcerer's, not yours.
- ---
- ## It doesn't just call another model. It brings your whole workshop.
- When Outsourcerer hands a job to a different engine or harness, that engine doesn't show up empty-handed. Grant a skill and the delegate gets the skill's **whole bundle** - SKILL.md plus its references, scripts, and assets - staged on disk next to the job on tool-capable harnesses, and synced into the harness's skills home on Devin. Text-only lanes can't run scripts, so they get the skill's complete documentation serialized into the prompt, with every script and asset explicitly listed as NOT TRANSFERRED - and a grant that can't fit or resolve refuses the dispatch instead of arriving half-loaded. MCP servers come along when you ask for them (`--with mcp=`), on the Claude lanes today; anywhere a grant can't make the trip, Outsourcerer says so up front instead of letting the delegate pretend. It's the difference between borrowing a stranger's bare laptop and having your own, fully set up, wherever the work happens to run.
- ---
- ## Advisors: bring the big brains in, several at once
- <img src="readme-assets/section-advisors.png" alt="The sorcerer presenting work to a council of glowing advisor models that confer and reach consensus" width="100%">
- Delegation runs both directions. Push work *down* to a cheaper model to save money, or pull the **strongest** models *up* as advisors to make the work better, and not just one:
- - **Convene a panel.** Spin up **several strong models in parallel**, one from each subscription if you like (say Sol on Codex, Fable on Claude, Hy3 on OpenRouter), to review a plan or a diff at the same time.
- - **Act only on consensus.** Outsourcerer greenlights the work when the panel agrees; a split is the signal to bring the decision back to you.
- - **Improve, don't just grade.** Ask the advisors to rewrite the weak parts and fold in each other's fixes, not merely flag them.
- <img src="readme-assets/convo-advisor.svg" alt="Terminal: you ask if the plan is sound; Outsourcerer convenes Sol, Fable and Hy3 in parallel across your subscriptions and greenlights on 3/3 consensus" width="100%">
- A second, differently-wired head at the right moment is where the real leverage is. Three of them, agreeing, is even better.
- ---
- ## Run a whole crew at once
- <img src="readme-assets/section-orchestrator.png" alt="The ink-drop sorcerer directing a circle of neon constellation creatures on gold connecting lines" width="100%">
- Outsourcerer runs the whole summoning itself. It decides what to delegate, picks the lane and model on live benchmarks, keeps every delegate interactive and steerable, supervises the fleet, and refuses to end a turn while work is live and waiting on you. The orchestrator contract lives in the skill, so the session you talk to owns the plan and the outcome rather than handing choices back to you.
- **It also works underneath an orchestrator you already have.** Point yours at Outsourcerer and keep it: your orchestrator decides what to delegate and how results get approved, and Outsourcerer runs the assignments. It dispatches each specialist across any provider, then watchdog-supervises every job through to a **classified** end (done / blocked / timed-out) instead of a silent exit, salvages the recoverable ones with a bounded verify→retry loop, tracks the spend, and hands the results back as parsable state. Not just a router: a layer that dispatches, verifies, and accounts for every delegate, whoever is casting.
- **OpenCode models ask before paid use.** Use `--provider opencode -m <model>`; a terminal asks for consent and scripts need `--spend-ok`. OpenCode Go also asks when its billing cannot be proven.
- **Your Grok Bot can join the crew (beta).** Grok Bot has no chat API, but its routines take a webhook. Give Outsourcerer the webhook and `--provider grokbot` hands the bot a task. The bot works on its own cloud computer, pushes a branch to your repo, and Outsourcerer brings the result back. Nothing merges until you say so. The repo also ships a Cursor plugin manifest, so a bot can install Outsourcerer and hand work to the lanes set up on its computer. This direction is new and not yet proven on a live bot.
- **Point it at any agent library and it just works.** A folder of role definitions, your own or a library like [agency-agents](https://github.com/msitarzewski/agency-agents), runs as a squad with `fanout --agents ./crew`, one supervised job per specialist. You never have to edit those files. The whole crew runs on a sensible cheap lane by default, and you add routing only if you want it, three ways, editing files last:
- - **Nothing.** Any library runs unmodified on the default lane, one receipt, one `status --json`.
- - **A one-line name map.** `--route 'security-*=glm-5.2, *architect*=sol, *=haiku'` sends each specialist to its own engine by name, no file edits.
- - **Frontmatter**, if you own the files: `model:` / `effort:` / `lane:` per agent.
- Precedence is unambiguous: global `-m` wins, then `--route`, then frontmatter, then the default. `--task "..."` drops your task into every role, so a pure library of personalities runs against your repo with zero edits.
- ```bash
- outsourcerer fanout --agents ./engineering --route 'security-*=glm-5.2, *=haiku' --task "audit auth" --worktree
- outsourcerer fanout status <id> --json # squad state as a stable JSON envelope your code parses
- outsourcerer fanout collect <id> # every result in one place, then: outsourcerer cleanup <id>
- ```
- `--worktree` runs each editing specialist in its **own disposable git worktree** so parallel edits never collide; worktrees are preserved after the run (never auto-deleted), and `cleanup` refuses to bin one that has unmerged work unless you `--force`. Every job is watchdog-supervised so it ends **classified** (done / blocked / timed-out), carries your skills via `--with` (MCP on the Claude lanes), and lands on the **Tab**. You keep the persona, the decomposition, the merge policy; the sorcerer runs the fleet.
- For sandboxed worktree lanes, opt in to `outsourcerer session approve-policy safe --all` to approve eligible prompts once and log each decision. The default remains off. Sealed test runs can be approved automatically only with an OS isolation tool and a root-owned runner whose path is not writable by the delegate. Without isolation, a manual run requires `--allow-unisolated`.
- `outsourcerer handover --check-context` prepares a handover when the current orchestrator reaches 150,000 input tokens. Set `OSRC_ORCH_CTX_MAX` to change the threshold; keep the current orchestrator supervising until its replacement has adopted the work and armed supervision.
- Supervision refreshes a project-and-limits snapshot every 10 minutes. Change the interval with `OSRC_SUPERVISE_TICK_SECS`; the snapshot lives in `$OSRC_HOME/supervise/<owner-id>/hub.json`.
- `supervise --auto done,limits` can dispatch a verified READY queue item to the reviewer automatically. Verdicts and other judgment calls still wake the orchestrator.
- Reviewer rotation defaults to two reviews or 35% context, configurable with `OSRC_REVIEW_ROTATE_K` and `OSRC_REVIEW_CTX_MAX`. An idle managed reviewer with an empty queue is retired after 50 minutes (`OSRC_REVIEW_IDLE_MIN`).
- Set `OSRC_LEAN_LAUNCH=1` for Claude sessions and delegates to retain `CLAUDE.md` while using strict MCP configuration without `--bare`. Interactive sessions start with no MCP servers unless `OSRC_LEAN_MCP_CONFIG` names a JSON config containing the required servers. Installed skills and plugins are still inherited.
- Re-review briefs use the previous reviewed commit and findings. Use `review next --final` for the full base-to-head merge review; per-round reports use `## Round <number>` sections.
- **It wakes you when a job ends.** Every launch prints a `wait` line. Start it as a background command and Claude Code or Codex gets a turn the moment the work finishes, with the result in hand. **On the roadmap:** pushed completion events for chat bots, and a richer receipt (cost + branch/SHA) in that same JSON.
- ---
- ## Big jobs that outlive the chat
- Big jobs are a chain of steps: map the code, decide the approach, build it, review it, merge it. Keep that chain in one chat and it's gone the moment the session ends. Outsourcerer keeps it on disk as a **plan**, so the work survives crashes, restarts, and tomorrow morning.
- One run, start to finish:
- > *"Add per-user rate limiting. Plan it out and build it."*
- - Two advisors on different models (say Sol on Codex and Opus on Claude) work out an approach **at the same time**, and a third folds the best of both into one plan.
- - A budget model builds it in its own git worktree, and it isn't done until your tests pass.
- - A different model checks the build against the plan. FAIL sends it back with the reason, PASS moves on.
- - The change merges, your tests run again on the merged result, and you get the receipt.
- That's `council-build`, one of the ready-made shapes. A real plan is wider than one line of steps: anything that doesn't wait on something else runs **side by side**, each on its own engine, in its own worktree. Three features at once, a reviewer per feature, a scout mapping the next one. What makes it hold up:
- - **Every worker starts briefed.** It gets the spec, what the steps before it found, and the calls you made along the way.
- - **"Done" means proven.** A worker saying it's finished doesn't count. Code needs real commits, your tests passing and a clean secret scan, and the proof is saved.
- - **Your decisions are part of the plan.** "Pick the winner" or "approve this migration" becomes a step that waits for you, then passes your answer downstream. Give it a default and a deadline, and a plan left running goes ahead with the default if you're away.
- - **Retries fit the failure.** A network blip retries the same model, a broken model moves to the next one on the list, and a run that was too big is retried as a smaller piece. The same failure twice comes to you for a re-plan.
- - **Merges wait their turn.** Work lands one change at a time, your tests run again on the merged result, and your uncommitted edits are never touched.
- - **More shapes.** `spec-build` writes a spec, plans it, builds it and checks it against the spec. `best-of-n` has several models build the same thing side by side, compares them, and lets you pick the winner.
- ```bash
- outsourcerer plan new rate-limit --repo .
- outsourcerer flow run council-build --plan rate-limit --var goal="Add per-user rate limiting" --var check="make test"
- outsourcerer plan run --plan rate-limit # run it again any time to pick up where it stopped
- ```
- You will rarely type these. Say "plan this out and build it" and the sorcerer sets it up. The full guide is in [`references/factory.md`](plugins/outsourcerer/skills/outsourcerer/references/factory.md).
- **Worktrees are not a security sandbox.** They keep files apart, but a worker on a lane without an OS sandbox runs with your user's rights, including outside its worktree. Use sandboxed verbs and lanes for untrusted work.
- ---
- ## Loops: send the laps somewhere cheaper
- <img src="readme-assets/section-loops.png" alt="The sorcerer on a glowing ring track, passing a task orb to a constellation creature that hands it back, past a checkpoint gate, an hourglass beside it" width="100%">
- Loops are not new. Claude Code has them and they work. What is expensive is **who runs the laps**.
- A loop is the same few moves over and over: try it, check it, try again. That is the least interesting work in software and the most repetitive, and if your frontier model is doing it, you are paying archmage rates for someone to re-run your test suite.
- So the sorcerer sends the laps somewhere cheap and keeps the judgment. A budget model does the trying. **Your** tests do the checking. The archmage decides what "done" means and reads the result when it lands.
- Nothing grades its own homework. The check is a real command, your suite, your build, your linter, because a model asked whether it succeeded will say yes.
- And "loop" is not one shape. Build-until-the-tests-pass is the one everybody knows. It is not the only one worth sending away:
- - a machine can settle it, so it runs until the check goes green
- - you do not know how much work is in there, so it sweeps until nothing is left
- - nothing can check it, but you can tell good from bad, so it tries several ways and keeps the best
- - quality is a matter of degree, so one model drafts and another critiques until it stops improving
- - the *plan* is the risky part, so two advisors argue it out before a cheap model touches a file
- You will not type any of it. Describe the problem and the sorcerer picks the shape and offers it:
- > *"That's a build-until-the-tests-pass job. Want me to hand it to GLM and keep re-running your suite until it's green? I'll stop if it stalls, or after twenty minutes."*
- Yes is the whole interface. And it will talk you *out* of a loop when there is nothing that can verify the result, because at that point a loop is just a model marking its own homework in a circle.
- While it runs, you can watch it: which attempt it is on, how long it has been going, and what is still failing. A loop you cannot see inside is a bet, not a tool.
- It stops when the check goes green. It stops when the same failures come back twice, because a loop that is not converging is an expensive way to be wrong. It stops when the time you gave it runs out. It even stops when the *check itself* hangs, which used to be the one way a bounded loop could quietly run forever.
- And stopping early is not a dead end. It keeps the task, the check, and the exact thing that broke last, so you can send it back around from where it stopped instead of paying twice for ground it already covered.
- ---
- ## See your whole fleet in one honest view
- <img src="readme-assets/section-fleet.png" alt="The little wizard reviewing rows of his hat-tipped helper sprites, each holding a glowing gold name-card, one topped with a gold bell because it is waiting on him, with constellation creatures working at desks in the corners" width="100%">
- **Your AI sessions work in separate rooms.** A Claude Code tab here, three jobs you handed to cheaper engines there, one of them quietly waiting on your approval. Every tool shows you its own sessions. None of them show you all of them at once. `fleet` does.
- ```bash
- outsourcerer fleet ls # every session you're running, one honest list
- outsourcerer fleet name # real names from real work, not "session-a3f2"
- outsourcerer fleet show <id>
- ```
- **One list, and it tells the truth.** Every Claude Code session plus every job Outsourcerer ran for you, each with a status read from the live process and its own transcript, never a spinner that lies. A session is **Working**, **Waiting on you**, **Done**, or **Stopped mid-task**, so you walk straight to the one that needs you instead of hunting through tabs.
- **Real names, not hashes.** `fleet name` reads what each session is actually working on and names it, so `session-71` reads as `Refactor the auth retry path`, cached so the list stays instant.
- **It catches the stuck ones, and it reaches you.** Turn on supervision and a background heartbeat watches the fleet, spots a delegate that stalled, never started, or drifted off its pinned model, and either bounds it or **wakes you** through a notifier you set (`OSRC_HEARTBEAT_WAKE`) instead of letting it sit silent for half an hour. The heartbeat verifies its own liveness: it reports itself **armed** only when a real watcher is proven running by pid and start-time, and says so loudly when it is not, so "supervised" never quietly means "unwatched".
- Today it covers your Claude Code sessions and the jobs Outsourcerer runs. Seeing sessions other tools launched on their own is next.
- ---
- ## You decide how much you drive
- The first time it wakes up in a session, Outsourcerer shows you what's ready, how much of your token budget is left, and asks one question: how do you want to drive?
- - **Auto-pilot.** It takes the wheel. Picks the engine, offloads the grind, conserves your limits, and just tells you what it did. For when you want the work done, not the decisions.
- - **You-drive.** Nothing moves without your say-so. It proposes, shows you the cost, and waits. For when the call is yours to own.
- - **Hybrid.** You agree once on what it can handle alone (tests, repo-mapping, the mechanical stuff), and it asks about everything else. The sweet spot most people settle into.
- Pick once and it remembers. Change your mind in plain language any time ("take the wheel", "ask me first"). And no mode is a trap: safety, cloud consent, and your sign-off on anything risky hold in all three. Beginners aren't dropped at a command line, they're handed a steering wheel and told what each pedal does.
- ---
- ## Smart about every pick, and every penny
- You're already smart about this. Even inside Claude Code you hand the small stuff to Sonnet instead of Opus. Outsourcerer takes that instinct across every engine you have: the right model for each job, prompted the way that model likes, without burning through the limits you need for the hard calls.
- ### It knows which model is actually worth it
- You shouldn't have to memorize which model is best at what, or keep up with a leaderboard that shuffles every week. Ask Outsourcerer to pick, and it does the homework for you: it reads what the task really is (code? reasoning? a quick errand?), pulls **live benchmark scores** for every model you can reach, weighs quality against what each one actually costs you, and recommends the best *value* for this job, not just the most famous name.
- That means a frontier-grade answer on a budget lane when the cheap model genuinely clears the bar, and a premium model only when the task truly earns it. It shows you the score and the reason it chose what it chose, so the pick is never a black box, and you can always overrule it. When it can't reach the live boards, it falls back to a built-in capability map, so the recommendation is never worse than a good default.
- This is the same brain your **copilot** uses to choose. In auto-pilot it scores the models, takes the best value, and just proceeds (telling you which and why). In you-drive or hybrid it scores them the same way, then shows you the pick and waits for your nod. The benchmarks drive the choice in every mode; the mode only decides whether it asks first.
- ### One spell, tailored to each model
- <img src="readme-assets/section-model-aware.png" alt="The sorcerer casting a differently-shaped spell at each of three different model-creatures" width="100%">
- The models don't think alike, so Outsourcerer doesn't prompt them alike. The right prompting techniques are **baked in per capability tier**: it frames a task for GPT-5.6 one way, for Fable another, for a genuinely small model a third, each to its strengths. And cheap does not mean dumb: **GLM-5.2, Hy3 and DeepSeek are `capable` tier, frontier capability at a budget price (~Opus-4.8 class)**, so they get the same high-autonomy prompting as the flagships, not a hand-holding work order. You ask in plain language; the sorcerer translates it into the dialect each engine actually responds to. You get better output from the cheap lane than you'd get by sending it the prompt you'd send Claude. Dial thinking depth per task with `--effort`.
- ### It watches your fuel gauge, so you never hit empty
- You know the feeling: 2pm, deep in a build, and your 5-hour limit taps out. Work stops.
- Outsourcerer reads your live usage and, the moment you cross into the danger zone, quietly shifts the heavy lifting off your main model onto a cheaper lane that's still full, and tells you why it did. Your best model stays sharp for the judgment calls instead of getting spent on grep. The wall stops being a surprise you slam into and becomes a corner the sorcerer already saw coming. Different setup, same care: No Devin, and it leans on Codex. Only local models, and it keeps everything on your machine. It conserves with whatever *you* actually have.
- ### Run it on your own machine
- <img src="readme-assets/section-local.png" alt="The ink-drop sorcerer beside his own glowing wireframe machine, a gold padlock and a gold zero-coin" width="100%">
- Point the sorcerer at a local model on Ollama or LM Studio and the whole job runs on your hardware: **`$0`, no tokens burned, nothing leaves the building.** Three reasons people reach for it, all good ones: you just prefer running your own models, you'd rather not spend the tokens, or the code is too sensitive to hand any cloud model. Outsourcerer's `doctor` spots a running local server on its own and offers the private lane, so `run` streams text with zero setup. And when you want the model to actually read your repo and use tools, the agentic path drives it right inside the harness, still local, still keyless. *(The harness plumbing is certified end to end; how much it can chew depends on your local model's own tool-calling.)*
- ### The Tab: a receipt you can actually believe
- <img src="readme-assets/section-tab.png" alt="The sorcerer writing carefully in a glowing ledger beside a balance scale weighing coins against an hourglass" width="100%">
- Most "cost saver" tools show you a number they made up. This one keeps two honest columns, because they aren't the same kind of cost. **Cash** is real money on OpenRouter/API lanes. **Plan limits** are your Codex / Claude / Antigravity / Devin subscription windows: no cash, but finite, so we show what you actually burned of them, never a fake "free."
- ```
- == The Tab == (real output, 2026-07-10)
- runs recorded : 12
- cash billed (measured) : $0.002245 REAL per-generation OpenRouter cost, captured on bg runs
- cash lanes, est-only : 5 run(s) foreground; run in bg to capture measured $
- on your subscription : 3 run(s) $0 cash, spent your ChatGPT / Claude / Antigravity plan limits
- ChatGPT plan usage, 5h window: 6% (resets in 4h 32m) · weekly: 1%
- note: a $0 cash line is NOT "free", subscription lanes spend finite plan rate limits.
- ```
- A number on the Tab is only as fresh as its last reading. A subscription window comes from whatever your CLI recorded the last time it ran, which can be hours old if you have been elsewhere, and usage only ever climbs, so an old number quietly reads as headroom you do not have. The sorcerer says how old it is, and won't send work down a lane the reading only *thinks* has room left.
- That `$0.002245` is not an estimate. For OpenRouter lanes the Tab reads the **exact per-generation cost** back from the provider after the run, because the harness's own built-in cost number runs roughly **28× high** on cheap lanes. For the subscription lanes it reads the real 5-hour and weekly rate-limit numbers the CLI records after each call. The archmage only gets billed for archmage work, and a no-cash line never pretends a plan lane was free.
- ---
- ## No wands, just plumbing
- Under the robe it's deliberately boring: a self-contained bash script you can read in one sitting. No server, no proxy, no telemetry, nothing resident. It shells out to the CLIs you already have (`claude`, `codex`, `devin`, `agy`), reads **exactly one** key from `~/.env` when a paid lane needs it, and keeps the ledger in a local JSONL on your machine. The magic is in the orchestration decisions, not the machinery, which is exactly where you want it.
- **When it goes sideways:** a stalled delegate gets killed by a watchdog and reported with its last progress line, never silently retried against a half-edited tree. Exit codes distinguish *done* / *done-but-unverified* / *blocked*, and "done-but-unverified" is treated as unverified. Before it dispatches, `doctor` preflights your machine, so if a lane's helper is missing it warns you up front instead of letting a delegated model discover it mid-run.
- ---
- ## How it compares
- | | Claude's own subagents | Router / proxy (claude-code-router, LiteLLM) | 🧙 Outsourcerer |
- |---|:---:|:---:|:---:|
- | Crosses *agents*, not just models | Claude only | model-swap inside one harness | **Codex · Antigravity · Claude Code · Devin · Pi · Grok Bot** |
- | Multi-step plans that outlive the session | ✗ | ✗ | ✅ task graph on disk, context hand-off, evidence-checked merge gate |
- | Carries your skills to the delegate | ✗ | ✗ | ✅ whole skill bundles on tool lanes; complete docs on text lanes (executables marked NOT TRANSFERRED); MCP on request (Claude lanes) |
- | Advisor panel + consensus | ✗ | ✗ | ✅ several top-tier models, act only when they agree |
- | Per-model prompting built in | ✗ | ✗ | ✅ tier-aware wrappers |
- | Keyless on what you already pay for | Claude sub only | API keys | ✅ your existing subscriptions, or the API key of your choice |
- | Shows you the money saved | ✗ | ✗ | ✅ the **Tab**, per lane, vs your frontier model |
- | Setup | zero | proxy + routing config | none, you just talk to it |
- | Server-side routing at scale | ✗ | ✅ | ✗ this is a local tool, on purpose |
- ---
- ## Handled with gloves (security)
- <img src="readme-assets/section-security.png" alt="The sorcerer in protective gloves guarding a single glowing key behind a ward, keeping it away from open lanes" width="100%">
- Audited by [repo-forensics](https://github.com/alexgreensh/repo-forensics) on every release, **every finding triaged by name, no suppressions** ([SECURITY.md](SECURITY.md)). The tool you install and run scans with **zero critical findings**; its flags are background-job supervision, self-locating shell, and one scoped key read. The only "critical" flags belong to the experimental, opt-in local-inference proxy forwarding your prompt to *your own* model on `127.0.0.1` (and its test). No remote exfiltration anywhere, and the [local lane](#run-it-on-your-own-machine) leaves your machine untouched entirely.
- - **Keyless by default** where your subscription allows, Gemini/Antigravity, GPT-image, and the native Claude / Codex / Devin lanes. Keyless means **no API key and no cash**, not free: these lanes spend your subscription's finite 5-hour and weekly limits, and the Tab shows how much. Keys are only for the paid OpenRouter lanes.
- - **Single-key sourcing.** Only the one key a lane needs is read from `~/.env`, never your whole environment. A budget model never sees a secret it wasn't handed.
- - **Tells you the lane and tier on every dispatch** (and the sandbox posture, read-only / can-write), and asks before anything destructive.
- - **`:free` models may train on your prompts.** Outsourcerer flags `:free` lanes as may-train and defaults them to least-privilege, so you decide before sensitive context goes down one.
- - **Your credentials can't ride along to the cloud.** Before any cloud delegation, a hard-block refuses the route if a real credential file (`.env`, `id_rsa`, `credentials`, …) is anywhere in the working tree, root or nested, and it runs on every call, fails closed, and tells you exactly what left the machine. A local, gitignored `.env.local` does not stop your work: the job runs in a clean copy of your checkout that leaves it behind. Prefer nothing leaves at all? The **local lane** routes to a model on your own machine: no key, no network. See [SECURITY.md](SECURITY.md#your-repo--what-leaves-the-machine).
- You can trust one lane in one repo, and nothing wider. Name a lane and the repos you trust it in, and the credential-file block stands down *there* and nowhere else, never for a secret you pasted into a prompt, which is a different decision you did not make. Empty out of the box, so an untouched install is as strict as it ever was, and the disclosure always tells you when the gate stood down. Not an env var: that would leak into every background job you spawn. A file, scoped to the one repo you meant.
- ---
- ## Get it (30 seconds, per host)
- | Your agent | One-time install |
- |---|---|
- | **Claude Code** | `/plugin marketplace add alexgreensh/outsourcerer` then `/plugin install outsourcerer@outsourcerer` |
- | **Antigravity** | `agy plugin import claude-code` (or let Outsourcerer's `parity` mirror it in) |
- | **Codex** | `outsourcerer parity-codex` (adds the entry point Codex reads) |
- | **Devin** | `outsourcerer parity` (mirrors the skill + your local tools) |
- | **Hermes** | `outsourcerer parity-hermes` (symlinks the skill into `~/.hermes/skills`) |
- | **Cursor** and **Grok Bot** (beta) | the repo ships a `.cursor-plugin` manifest; a team admin can import the repo into your team plugin marketplace |
- Then just talk to it. On first use it runs its own health check and tells you if anything needs installing, with the exact command.
- ---
- ## Pairs well with
- - **[repo-forensics](https://github.com/alexgreensh/repo-forensics).** The security auditor (27 scanners, 500+ patterns) that vets this plugin, and anything else, before you install it. That green badge up top is its verdict.
- - **[Token Optimizer](https://github.com/alexgreensh/token-optimizer).** Keeps your main agent's *context* lean while Outsourcerer moves the *work* off it. Two halves of "spend less, do more." (Its calibrated token math is what the Tab uses to price a run.)
- <details>
- <summary><b>Under the hood</b>, the commands the sorcerer drives for you (you rarely type these)</summary>
- <br>
- The model alias picks the lane automatically; `--provider` selects a different backend when needed.
- | Verb | Does |
- |---|---|
- | `run` / `research` / `edit` / `yolo` | offload a read / sandboxed investigation / code change / approvals-off change |
- | `continue` / `session` | multi-turn follow-ups (Devin) |
- | `bg` / `status` / `watch` / `result` / `logs` / `cancel` | background jobs + the liveness watchdog |
- | `second-opinion` | consensus-gated re-check |
- | `image` | text-to-image (GPT-image preferred → nano-banana → OpenRouter) |
- | `tab` / `estimate` | cost ledger + pre-flight quote |
- | `suggest` / `deals` | live cheap & free models available per platform right now |
- | `doctor` / `models` | health check + live model list |
- | `parity` / `parity-codex` / `parity-hermes` | mirror into Devin/Antigravity/Hermes; reverse-bridge into Codex/Droid/Cursor |
- | `plan` / `task` / `flow` / `land` | the software factory: durable plans, task hand-off, ready-made flows, the merge gate |
- | `exclude` | ban a model or a whole family from every pick |
- **Lanes:** `hy3`/`glm-5.2`/`deepseek-*` (OpenRouter, via `cc` or `codex`) ·
- `sol`/`terra`/`luna` (Codex native) · `fable`/`opus`/`sonnet`/`haiku` (Claude native) ·
- `gemini-pro`/`gemini-flash` (Antigravity, keyless) · `hermes` / `-m <any>` (your Hermes setup, whatever model + provider keys you've configured) · `ollama:<model>`/`local` (your own machine, keyless, `$0`, private) · `gpt-image`/`nano-banana` (images).
- Add capability to one offload with `--with skills=<name>` / `--with mcp=<name>`.
- </details>
- ## Roadmap
- <img src="readme-assets/section-roadmap.png" alt="The sorcerer facing a row of magic portals, two open and two still forming in the distance" width="100%">
- **Today it drives like a copilot.** It greets you each session, shows your live token budget, and hands you the wheel: **auto-pilot**, **you-drive**, or **hybrid**, then conserves your limits on its own when the session runs hot. And it works across **Claude Code · Codex · Antigravity · Devin · Cursor · Droid · Hermes**, on Mac, Linux, and Windows (Git Bash, no WSL). Next up:
- - More harnesses as the frontier expands.
- - An OpenRouter server-side subagent lane, and pushed completion events for chat-bot orchestrators.
- - *Already shipped:* one `supervise` watcher for every job, session and remote lane, a single-reviewer queue, the Mission Control page (`hub serve`), paid lanes that always ask first, and Claude multi-account lanes in v0.16.0; cloud jobs that run in a clean copy when your secrets are gitignored, plus Codex writes on Windows, in v0.15.3; steadier time limits and launch checks in v0.15.2; default answers for held decisions and retries that fit the failure in v0.15.1; the **Pi** and **Grok Bot** lanes plus Cursor plugin packaging in v0.15.0; the **software factory** (durable plans, automatic context hand-off, a done contract, a serialized merge gate, and ready-made flows) plus a saved model exclude list in v0.14.0; the **`fleet`** view (one honest list of every session you're running, with real names and honest states) in v0.7.0; the **Cline** engine lane in v0.6.4, fully supervised, running on your own Cline setup (your API keys, or a ClinePass subscription for discounted open-weight models like GLM, DeepSeek, and Kimi); **loops** (a bounded try→check→retry cycle run on a cheap external model, verified by your own tests) and per-repo lane trust in v0.4.13; the interactive copilot (auto/manual/hybrid modes + live-limit auto-conservation) and **Cursor**, **Droid**, and the `claudex` lane (your ChatGPT model inside the Claude Code harness) in v0.4.8; reverse bridges so you can drive Outsourcerer *from* Codex, Droid, Cursor, or Hermes too (Hermes goes both ways: delegate to it with `-m <any>`, or drive Outsourcerer from inside a Hermes session via `parity-hermes`); parallel `fanout` (v0.2.0); the local Ollama/LM-Studio lane (v0.3.0); git-worktree isolation, agent-library routing, and machine-readable `status --json` (v0.3.1).
- Issues and PRs welcome.
- ## Claude accounts
- `outsourcerer accounts` lists Claude config directories and their weekly and five-hour headroom. Add one with `outsourcerer accounts add work`, or supply an absolute directory as the third argument. Shared settings, instructions, skills, agents, hooks, plugins, and memory are linked from `~/.claude`; login and live session state remain separate. Follow the printed login instruction yourself. `outsourcerer accounts check work` reports changed or missing links. `outsourcerer accounts rm work` removes the registry entry and links it created, leaving real files and the config directory intact. The `default` account is `~/.claude`.
- New Claude lanes prefer subscription accounts with the most known weekly headroom below configured lane caps. Use `--account work` to select one explicitly. Unreadable usage is shown as unknown; an account with unknown usage cannot satisfy a configured cap. Without a cap, the default account can still launch. Each new process keeps its chosen account; running lanes do not move. Console and other per-use accounts require spend consent.
- Release note: Anthropic's terms on one person using several personal subscriptions have not been confirmed by us.
- ## License
- **PolyForm Noncommercial 1.0.0**, plus a written [small business permission](LICENSE-SMALL-BUSINESS.md). Personal, research, education: free. Companies with fewer than 5 people and under $20k/month revenue (whole company, not seats): free. Commercial: [reach out](mailto:me@alexgreenshpun.com).
- <details>
- <summary>License FAQ</summary>
- **Personal / hobby / research / education?** Go for it. No license purchase needed, including your own open-source side projects. What counts is who the work is for, not where it runs: work for your employer is your employer's use, even from home.
- **Small business?** If your **whole company** has fewer than 5 people **and** under $20k/month revenue, you get a no-cost commercial license, in writing: [LICENSE-SMALL-BUSINESS.md](LICENSE-SMALL-BUSINESS.md). Both limits apply to the entire organization (including any parent or sister companies), not to how many people install it, so a larger company does not qualify by limiting it to a handful of users. It covers use inside your own business, not reselling it or running it as a service for others.
- **Growing into a business?** You get 32 days after you stop qualifying to sort out a commercial license. Past use is fine.
- **Larger company?** Contact [Alex Greenshpun](https://linkedin.com/in/alexgreensh) or [me@alexgreenshpun.com](mailto:me@alexgreenshpun.com).
- </details>
- ---
- <div align="center">
- Built by [Alex Greenshpun](https://github.com/alexgreensh)
- [](https://linkedin.com/in/alexgreensh)
- [](https://x.com/alexgreensh)
- *Delegate the grind. Keep the glory.*
- </div>
- ## Mission Control
- Mission Control shows your projects, running work, decisions, and lane limits in one place. Open it with `outsourcerer mc`.
plugins/outsourcerer/skills/outsourcerer/scripts/lib/perm.sh · Bundled script · 626 lines · 1 finding marked
- #!/usr/bin/env bash
- # perm.sh — `--perm safe|default` permission profiles for interactive `session start`,
- # plus the session-launch helpers moved here from outsourcerer.sh (file-size ratchet:
- # outsourcerer.sh is legacy and may only shrink; new code lives in scripts/lib/).
- #
- # Loaded by the byte-identical CONTRACT line in outsourcerer.sh directly after
- # `OSRC_JOBS="$OSRC_HOME/jobs"`, and again from the real script dir after the factory
- # loader (see briefs/LOADER.md — the second line covers sourced mode and symlinked
- # invocation, where $SCRIPT_DIR does not point at this file's folder).
- #
- # osrc_perm_flags <engine> <profile> <workdir>
- # Prints the EXTRA launch flags for the profile, one argv element per line.
- # profile=default (or an engine with no faithful safe rung) prints NOTHING, so the
- # launch is byte-identical to before. Every flag below was verified against the
- # engine's own --help / bundled docs — see sessions/2026-11-13-autonomy/out/L5-AUDIT.md.
- # ---- moved verbatim from outsourcerer.sh (session-launch helpers) ---------------
- _session_launch_error() {
- local provider="$1" reason="$2"
- die "session start: $provider interactive launch unavailable ($reason). Use '$0 --provider $provider run \"task\"' for one-shot work or '$0 --provider $provider bg run \"task\"' for supervised background work."
- }
- _session_probe_help() {
- local probe_file rc=0 _tmp_base="${TMPDIR:-/tmp}"
- probe_file="$(mktemp "${_tmp_base%/}/osrc-session-probe.XXXXXX" 2>/dev/null)" || return 1
- _timeout 3 "$@" > "$probe_file" 2>&1 || rc=$?
- if [ "$rc" -ne 0 ] || [ ! -s "$probe_file" ]; then
- rm -f "$probe_file"
- [ "$rc" -ne 0 ] && return "$rc"
- return 1
- fi
- cat "$probe_file"
- rm -f "$probe_file"
- }
- _session_shell_command() {
- local arg quoted out=""
- for arg in "$@"; do
- printf -v quoted '%q' "$arg"
- [ -n "$out" ] && out="$out "
- out="$out$quoted"
- done
- printf '%s\n' "$out"
- }
- # _session_help_has_model_flag <help-text> -> 0 if a model override flag is documented in the FULL
- # help text, 1 otherwise. Matches both long (--model <id> / --model=<id>) and short (-m <id> /
- # -m, --model <id>) forms, delimited so a flag like --mode or -mode cannot false-positive. This is
- # the evidence-based proof behind the general model-pin guard: a lane may only append a model flag
- # to an interactive launch when its own CLI documents that flag at the level being invoked. The
- # droid bug was an unverified COMMENT asserting "interactive droid accepts --model too" — the flag
- # was never in `droid --help`, fell through into the prompt, and the run billed Claude quota on the
- # DEFAULT model (claude-opus-5). Verifying the real --help (never truncated) is the only proof.
- _session_help_has_model_flag() {
- # Here-string, not a pipeline: help text is never truncated, so it can outgrow the pipe buffer
- # and `printf | grep -q` would take grep's early-exit SIGPIPE (141) under pipefail as a miss.
- grep -Eq -- '--model([ =]|$)|(^|[[:space:],])-m([[:space:],]|$)' <<<"$1"
- }
- # _session_assert_model_pinnable <provider> <cli> [help-args...] -> probe the real CLI help and
- # REFUSE (via _session_launch_error) if no model override flag is documented at the level being
- # invoked. Returns 0 silently when the flag is proven present. This is the general guard: a lane
- # that cannot PROVE it honors an explicit model must fail loudly, never start on the lane default
- # and bill silently. A failed/timed-out probe is also a refusal — "could not prove it" is not "it
- # is supported". <help-args> are the subcommand/help args to probe (e.g. `hermes chat --help`).
- #
- # Uses a GENEROUS timeout (OSRC_SESSION_MODEL_PROBE_SECS, default 8) rather than the 3s
- # _session_probe_help cap: this is a once-per-session safety check, and heavy node CLIs (e.g.
- # gemini-cli) can take ~5s to print --help on a cold start. A 3s cap falsely refused a lane that
- # DOES document -m/--model, which is its own kind of silent breakage. The cost is paid only when a
- # model is explicitly pinned (MODEL_EXPLICIT=1), not on every session start.
- _session_assert_model_pinnable() {
- local provider="$1" cli="$2"; shift 2
- local help_text probe_file rc=0 _tmp_base="${TMPDIR:-/tmp}"
- probe_file="$(mktemp "${_tmp_base%/}/osrc-mpg.XXXXXX" 2>/dev/null)" || _session_launch_error "$provider" "model-flag probe: could not create a temp file"
- _timeout "${OSRC_SESSION_MODEL_PROBE_SECS:-8}" "$cli" "$@" > "$probe_file" 2>&1 || rc=$?
- if [ "$rc" -ne 0 ] || [ ! -s "$probe_file" ]; then
- rm -f "$probe_file"
- _session_launch_error "$provider" "the model-flag help probe for \`$cli $*\` failed or timed out (rc=$rc) — cannot prove interactive model pinning, refusing rather than billing on the lane default"
- fi
- help_text="$(cat "$probe_file")"; rm -f "$probe_file"
- _session_help_has_model_flag "$help_text" \
- || _session_launch_error "$provider" "interactive $provider has no model override in \`$cli $*\` (verified against the real CLI --help). A --model/-m token would not be honored and the run would proceed on the lane DEFAULT model, billing silently. Drop -m to use the lane's configured model, or use the lane's exec/delegate path (e.g. '$0 --provider $provider run -m <model> \"task\"') where the flag is documented."
- }
- # ---- --perm safe|default ---------------------------------------------------------
- # Canonical "safe" shell-command prefixes: read-only commands, git read commands, and
- # test/lint/build commands. One prefix per line; emitters turn each into the engine's
- # native allow syntax. Everything not matching still prompts — the list only removes
- # prompts for routine dev work.
- #
- # Deliberately EXCLUDED (they prompt): env/xargs/parallel/watch/nice/nohup/time/command
- # (exec wrappers), awk/perl/ruby/python/node (arbitrary code — only the `-m pytest|unittest`
- # forms are listed), make/just/task/tox/nox (task runners), npm exec/npx/bunx/uv/poetry run
- # (fetch+exec), curl/wget/ssh/scp/rsync/sftp, docker/kubectl/aws/gcloud/az/terraform/
- # vercel/firebase/netlify, psql/mysql/sqlite3/redis-cli/mongosh, tmux/screen/osascript/
- # automator/open/launchctl/crontab/at/batch, sudo/doas, git mutating verbs (push/pull/
- # fetch/commit/checkout/restore/reset/clean/rebase/merge/am/apply/cherry-pick/revert/
- # stash-mutations/worktree add|remove|prune/submodule update|init/bisect/gc/prune/
- # update-ref/read-tree/write-tree/commit-tree/mktree/hash-object), tar/unzip/zip/patch/
- # cp/mv/ln/install/dd/tee/touch/mkdir/rmdir/chmod/chown/xattr/chflags, less/more/vim/
- # nano/emacs/bat/man (interactive — would stall a turn), sed/yq (in-place write forms
- # can't be prefix-excluded), sips (--out writes), npm install/i/ci/add/remove/update/
- # publish/link, pip install/download, brew install/uninstall, gem install, apt/yum/
- # dnf/pacman/zypper entirely, jq kept (no write flags).
- #
- # Also excluded after review (L5 round 2): printenv (dumps every secret in the
- # environment into the delegate's context), defaults read / nvram -p (can print stored
- # tokens), mount (bare form lists, but `mount <dev> <dir>` mutates — the prefix emitter
- # cannot exclude the arg form), gh api (a later -X DELETE on the same line is not
- # excluded by a GET prefix), and commands that never return on their own — ping,
- # traceroute, nettop, fs_usage, log stream, syslog, gh run watch, sleep, tail -f (via
- # ask rules), log show (unbounded dump) — for the same reason interactive pagers are
- # excluded: they would stall the delegate's turn. black/isort write in place by
- # default (no read-only form to allow); prettier/eslint/ruff keep their read-only
- # defaults and their write flags are ask-listed instead.
- #
- # Prefix-write holes verified live in a scratch repo and removed: `git remote -v`
- # (its ` *` tail accepts `git remote -v prune|update` — prune RAN, verified), bare
- # `git reflog` (`git reflog expire|drop` mutate), and both `git symbolic-ref` forms
- # (`git symbolic-ref [--short] HEAD <ref>` WRITES HEAD — verified rc=0). git's own
- # action-conflict guard rejects the smuggled combos on the kept entries
- # (`branch -a -d`, `tag -l -d`, `config -l --add`, `worktree list prune` all error).
- _osrc_perm_safe_cmds() {
- cat <<'EOF'
- ls
- cat
- head
- tail
- grep
- egrep
- fgrep
- rg
- ag
- fd
- eza
- exa
- wc
- file
- stat
- readlink
- realpath
- basename
- dirname
- pwd
- echo
- printf
- which
- whereis
- type
- date
- uname
- hostname
- whoami
- id
- arch
- nproc
- locale
- tree
- du
- df
- ps
- lsof
- netstat
- jq
- sort
- uniq
- cut
- tr
- column
- diff
- cmp
- md5
- shasum
- cksum
- true
- false
- sw_vers
- find
- git status
- git diff
- git log
- git show
- git blame
- git grep
- git ls-files
- git ls-tree
- git ls-remote
- git rev-parse
- git rev-list
- git describe
- git shortlog
- git merge-base
- git name-rev
- git cherry
- git show-branch
- git count-objects
- git fsck
- git cat-file
- git verify-commit
- git verify-tag
- git stash list
- git stash show
- git worktree list
- git submodule status
- git remote show
- git remote get-url
- git branch --show-current
- git branch --list
- git branch -a
- git tag -l
- git tag --list
- git reflog show
- git config --get
- git config --get-all
- git config --list
- git config -l
- git var
- git version
- gh pr view
- gh pr list
- gh pr checks
- gh pr diff
- gh issue view
- gh issue list
- gh run list
- gh run view
- gh release view
- gh release list
- gh repo view
- npm test
- npm run test
- npm run lint
- npm run build
- npm run typecheck
- npm run check
- npm ls
- npm list
- npm outdated
- npm explain
- npm why
- npm view
- npm fund
- npm search
- yarn test
- yarn lint
- yarn build
- yarn typecheck
- yarn run test
- yarn run lint
- yarn run build
- yarn run typecheck
- yarn list
- yarn info
- yarn why
- pnpm test
- pnpm lint
- pnpm build
- pnpm typecheck
- pnpm run test
- pnpm run lint
- pnpm run build
- pnpm run typecheck
- pnpm run check
- pnpm ls
- pnpm list
- pnpm why
- pytest
- py.test
- python -m pytest
- python3 -m pytest
- python -m unittest
- python3 -m unittest
- cargo test
- cargo build
- cargo check
- cargo clippy
- go test
- go build
- go vet
- go list
- dotnet test
- dotnet build
- mvn test
- mvn verify
- mvn compile
- mvn package
- ./mvnw test
- ./mvnw verify
- ./mvnw compile
- ./mvnw package
- gradle test
- gradle build
- gradle check
- ./gradlew test
- ./gradlew build
- ./gradlew check
- mix test
- swift test
- swift build
- deno test
- deno check
- deno lint
- bun test
- rspec
- phpunit
- php artisan test
- jest
- vitest
- mocha
- ava
- cypress run
- playwright test
- eslint
- prettier
- ruff check
- mypy
- pyright
- tsc --noEmit
- pip list
- pip show
- pip freeze
- pip3 list
- pip3 show
- pip3 freeze
- gem list
- gem contents
- brew list
- brew info
- brew search
- brew leaves
- brew deps
- brew cat
- plutil -p
- plutil -lint
- codesign -dv
- xcodebuild -list
- system_profiler
- ioreg
- kextstat
- vm_stat
- log stats
- diskutil list
- diskutil info
- diskutil apfs list
- hdiutil info
- hdiutil imageinfo
- qlmanage -m
- spctl --status
- spctl -a -vv
- csrutil status
- fdesetup status
- pmset -g
- EOF
- }
- # Ask-listed patterns: matched commands PROMPT (not allow, not deny) even when an allow
- # prefix would cover them. Covers the dangerous corners INSIDE allowed families:
- # find -delete/-exec/-ok/-fprint/-fls, output-file writers (--out*, sort -o is left to
- # Claude's own path guard), exec-via-flag commands (fd -x/-X/--exec, rg/ag --pre/
- # --pager/--hostname-bin, git grep -O / --open-files-in-pager, sort
- # --compress-program), formatter/test-runner write+stall flags (prettier --write,
- # eslint --fix/-o, ruff --fix, go/dotnet/cargo output-dir flags, --watch/--ui/--debug/
- # --pdb interactive modes, tail -f, lsof +r, gh --watch, playwright --ui/--debug),
- # secret exposure (ps env forms), and .git writers (git fsck --lost-found).
- #
- # Claude Code rule order is deny -> ask -> allow and a matching ask rule prompts even
- # when a MORE SPECIFIC allow rule also matches — there is no specificity tiebreak
- # (code.claude.com/docs/en/permissions). Verified live on Claude Code 2.1.323
- # (claude-haiku-5-5, -p): `ls && rm -rf dir`, `ls && touch f`, `echo $(touch f)`,
- # `cat f | sh`, and `echo x > f` were all stopped by Claude's OWN command parser
- # before the allow rules mattered — it splits compounds, refuses unverifiable nested
- # commands, and asks before any file creation even inside the workdir. The `>`/`<`
- # ask rules were therefore redundant and are dropped: they cost the commonest
- # delegate command (`2>&1 | tail`, `2>/dev/null`) a prompt for no added safety.
- # What remains asks on flags the parser does not model as separate operations.
- _osrc_perm_ask_patterns() {
- printf '%s\n' \
- 'Bash(*-delete*)' 'Bash(*-exec*)' 'Bash(*-ok*)' 'Bash(*-fprint*)' 'Bash(*-fls*)' 'Bash(*--out*)' \
- 'Bash(*--ext-diff*)' 'Bash(*--textconv*)' \
- 'Bash(fd *-x*)' 'Bash(fd *-X*)' 'Bash(fd *--exec*)' \
- 'Bash(rg *--pre*)' 'Bash(rg *--hostname-bin*)' 'Bash(rg *--pager*)' 'Bash(ag *--pager*)' \
- 'Bash(sort *--compress-program*)' \
- 'Bash(git grep *-O*)' 'Bash(git grep *--open-files-in-pager*)' 'Bash(git fsck *--lost-found*)' \
- 'Bash(tail *-f*)' 'Bash(tail *-F*)' 'Bash(tail *--follow*)' \
- 'Bash(ps e*)' 'Bash(ps * e*)' 'Bash(ps *-E*)' \
- 'Bash(lsof *+r*)' \
- 'Bash(*--watch*)' 'Bash(*--pdb*)' \
- 'Bash(playwright *--ui*)' 'Bash(playwright *--debug*)' 'Bash(vitest *--ui*)' \
- 'Bash(go build *-o*)' 'Bash(go test *-o*)' 'Bash(dotnet *-o *)' 'Bash(cargo *--target-dir*)' \
- 'Bash(eslint *--fix*)' 'Bash(eslint *-o *)' \
- 'Bash(prettier *--write*)' 'Bash(ruff *--fix*)'
- }
- # Script-name families that also appear in colon form (`npm run test:unit`, `yarn build:prod`).
- # The ` *` space form misses the colon, so emitters add the `:*` trailing-wildcard variant.
- _osrc_perm_colon_families() {
- printf '%s\n' \
- 'npm run test' 'npm run lint' 'npm run build' 'npm run typecheck' 'npm run check' \
- 'yarn test' 'yarn lint' 'yarn build' 'yarn typecheck' \
- 'yarn run test' 'yarn run lint' 'yarn run build' 'yarn run typecheck' \
- 'pnpm test' 'pnpm lint' 'pnpm build' 'pnpm typecheck' \
- 'pnpm run test' 'pnpm run lint' 'pnpm run build' 'pnpm run typecheck' 'pnpm run check'
- }
- # _osrc_perm_claude_args -> --allowedTools rules + --settings ask-list for `claude` safe mode.
- # Rule syntax per code.claude.com/docs/en/permissions: `Bash(<prefix>)` exact,
- # `Bash(<prefix> *)` prefix+args; `Edit(./**)`/`Write(./**)` scope file edits to the
- # session workdir (cwd). Read/Grep/Glob are always-safe tool names.
- _osrc_perm_claude_args() {
- local p s a asks=''
- printf '%s\n' '--allowedTools' 'Read' 'Grep' 'Glob' 'Edit(./**)' 'Write(./**)'
- while IFS= read -r p; do
- [ -n "$p" ] || continue
- printf 'Bash(%s)\n' "$p"
- printf 'Bash(%s *)\n' "$p"
- done < <(_osrc_perm_safe_cmds)
- while IFS= read -r s; do
- [ -n "$s" ] || continue
- printf 'Bash(%s:*)\n' "$s"
- done < <(_osrc_perm_colon_families)
- printf '%s\n' '--settings'
- while IFS= read -r a; do asks="$asks\"$a\","; done < <(_osrc_perm_ask_patterns)
- asks="${asks%,}"
- printf '{"permissions":{"ask":[%s]}}\n' "$asks"
- }
- # _osrc_perm_gemini_args <workdir> -> --approval-mode auto_edit only: gemini-cli's edit
- # tools auto-approve while shell commands keep the default approval behavior.
- #
- # A generated [[rule]] policy file was tried and WITHDRAWN (L5 round 2, review finding
- # 3): commandRegex is tested against the tool-call JSON args, and the round-1 regexes
- # both stopped at the first quoted string (`[^\"]*`) and anchored only the first word,
- # so `echo "hi" > ~/.zshrc`, `find . -delete`, `ls && rm -rf ~`, `cat a | sh` and
- Note: Quoted as data in code: Runs `rm -rf` against a root or home-directory path
- Line 436 on GitHub
- # `sort -o /tmp/x` all evaluated as allow. gemini-cli refuses OAuth on this machine,
- # so no live session can prove a corrected policy — per the review, emit only
- # auto_edit until one does.
- _osrc_perm_gemini_args() {
- printf '%s\n' '--approval-mode' 'auto_edit'
- }
- # osrc_perm_apply_launch <provider> <lane> — append the safe-profile flags to the
- # SESSION_LAUNCH array built by a _session_launch_* adapter. Called from
- # _session_launch_adapter after the lane fn returns. Engines whose safe rung is a
- # SUBSTITUTION rather than an append (cx: --approve-for-me replaces -s) handle
- # PERM_PROFILE inside their own adapter; everything else lands here.
- # A flag-generation failure is fatal: silently launching with default permissions
- # under a "safe" banner is exactly the lie the banner exists to prevent.
- osrc_perm_apply_launch() {
- local provider="$1" lane="$2" eng _pa _flags
- eng="${SESSION_LAUNCH_ENGINE:-$lane}" # separate stmt: `local a= b=$a` expands before assign
- [ "${PERM_PROFILE:-default}" = "default" ] && return 0
- type osrc_perm_flags >/dev/null 2>&1 \
- || _session_launch_error "$provider" "--perm $PERM_PROFILE needs scripts/lib/perm.sh, which is missing from this install"
- _flags="$(osrc_perm_flags "$eng" "$PERM_PROFILE" "$PWD")" \
- || _session_launch_error "$provider" "--perm safe flag generation failed for engine '$eng'"
- while IFS= read -r _pa; do [ -n "$_pa" ] && SESSION_LAUNCH+=("$_pa"); done <<< "$_flags"
- # Explicit rc0: a no-rung engine yields empty _flags, and the while/read above
- # returns 1 at EOF — without this the ADAPTER reports failure for exactly the
- # engines safe mode is supposed to launch unchanged (droid/hermes/cline/pi).
- return 0
- }
- # osrc_perm_desc <engine> -> one-line honest description of what `safe` actually does
- # for that engine, or rc 1 when the engine has no faithful safe rung. "safe" is NOT
- # one thing across engines (review finding 4): Claude gets an explicit allow-list;
- # devin/codex/cursor get the engine's OWN auto-approval rung, where a model or server
- # classifier judges each action — not a list; agy gets the vendor's auto mode;
- # gemini-cli gets edit-tools-only auto-approval. The launch banner prints this so the
- # receipt never claims an allow-list the engine does not have.
- osrc_perm_desc() {
- case "$1" in
- devin|dv) printf '%s' "devin --permission-mode smart (MODEL-JUDGED: a fast model auto-runs what it judges safe; installs, mutating git, rm/sudo, dotenv/keys still prompt)" ;;
- cx|codex) printf '%s' "codex --approve-for-me (MODEL-JUDGED: approval requests route through automatic review; replaces -s workspace-write)" ;;
- cc|claude) printf '%s' "claude --allowedTools allow-list + ask rules (EXPLICIT LIST: read-only/git-read/test-build commands + workspace edits; deletes, exec-flags, redirects and everything else still prompt)" ;;
- cursor) printf '%s' "cursor --auto-review (CLASSIFIER-JUDGED: a server classifier auto-runs safe tool calls)" ;;
- agy|antigravity) printf '%s' "agy --mode auto (engine auto mode per vendor docs — not an allow-list)" ;;
- gemini|gmnative|gm) printf '%s' "gemini-cli --approval-mode auto_edit (edit tools auto-approve; shell commands still ask)" ;;
- *) return 1 ;;
- esac
- }
- # _osrc_perm_banner <provider> — print the honest [perm] line after a safe-profile
- # launch is built. No-op unless PERM_PROFILE=safe. Engines with no faithful rung get
- # an explicit "launched default" line instead of a false success banner.
- _osrc_perm_banner() {
- [ "${PERM_PROFILE:-default}" = "safe" ] || return 0
- local _pb_eng="${SESSION_LAUNCH_ENGINE:-$1}" _pb_desc
- if _pb_desc="$(osrc_perm_desc "$_pb_eng" 2>/dev/null)"; then
- printf '>>> [perm] safe — %s. Anything outside still prompts.\n' "$_pb_desc" >&2
- else
- printf '>>> [perm] safe: no faithful safe rung for %s; launched with DEFAULT permissions (everything prompts).\n' "$1" >&2
- fi
- }
- # osrc_perm_string_suffix <engine> <profile> -> prints " <flag> <flag>..." with each
- # flag %q-quoted, for launch vectors carried as ONE shell string (tmux send-keys,
- # winpty launch.bash is an array and does NOT use this, respawn-pane). default or a
- # no-rung engine prints nothing; rc 1 when safe was requested but osrc_perm_flags is
- # unavailable, so callers can die loudly instead of launching unprotected.
- osrc_perm_string_suffix() {
- local eng="$1" prof="${2:-default}" _pa out=""
- [ "$prof" = "safe" ] || return 0
- type osrc_perm_flags >/dev/null 2>&1 || return 1
- while IFS= read -r _pa; do [ -n "$_pa" ] && out="$out $(printf '%q' "$_pa")"; done < <(osrc_perm_flags "$eng" "$prof" "$PWD")
- printf '%s' "$out"
- }
- # _osrc_perm_restore_profile <session-id> — set the global PERM_PROFILE from the
- # session's latest start record (registry field 5, written by _session_registry_append
- # at launch). Relaunch/effort-relaunch rebuild the command from scratch, so without
- # this a `--perm safe` session silently comes back with default permissions. Records
- # written before L5 lack the field -> env/default. Not local: the relaunch_fn lanes
- # and the registry append read the global.
- _osrc_perm_restore_profile() {
- local _ps_saved
- _ps_saved="$(_session_record "$1" 2>/dev/null | cut -f5)"
- case "$_ps_saved" in safe|default) PERM_PROFILE="$_ps_saved" ;; *) PERM_PROFILE="${PERM_PROFILE:-${OSRC_PERM_PROFILE:-default}}" ;; esac
- case "$PERM_PROFILE" in safe|default) ;; *) PERM_PROFILE=default ;; esac
- }
- # ---- session relaunch vectors (moved from outsourcerer.sh for the size ratchet) ---
- # Both read the global PERM_PROFILE, which _session_control_relaunch restores from
- # the session's registry record before calling _session_relaunch_command.
- # _session_cc_uuid_valid <id> -> 0 only for a real claude sessionId shape (a
- # UUID). --resume takes the value verbatim, so the check must be strict: the
- # looser _external_session_id_valid charset accepts a leading-dash id like
- # --dangerously-skip-permissions, which claude would read as a flag, and any
- # process the delegate starts can plant a matching ~/.claude/sessions file.
- _session_cc_uuid_valid() {
- printf '%s\n' "${1:-}" | grep -qE '^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$'
- }
- # _session_cc_resume_id <tmux-pane> -> the pane claude's sessionId for
- # `claude --resume <id>`, or nothing (= the caller falls back to --continue).
- # Live proof first: ~/.claude/sessions/*.json maps the running claude pid to its
- # sessionId via _fleet_cc_session_for_pane; the registry start record's
- # cc_session_id is the fallback for a pane whose session file is already gone.
- # --resume beats --continue because --continue picks the newest conversation in
- # the folder, which may be a DIFFERENT session's when two claude panes share a
- # cwd; the id pins this pane's own conversation.
- _session_cc_resume_id() {
- local pane="$1" pid cwd match sid
- pid="$(tmux display-message -p -t "$pane" '#{pane_pid}' 2>/dev/null)"
- cwd="$(tmux display-message -p -t "$pane" '#{pane_current_path}' 2>/dev/null)"
- if [ -n "$cwd" ]; then cwd="$(cd "$cwd" 2>/dev/null && pwd -P)" || cwd=""; fi
- if [ -n "$pid" ] && [ -n "$cwd" ]; then
- match="$(_fleet_cc_session_for_pane "$pid" "$cwd" 2>/dev/null)" || match=""
- sid="${match%%$'\t'*}"
- if _session_cc_uuid_valid "$sid"; then printf '%s\n' "$sid"; return 0
- elif [ -n "$sid" ]; then echo "session resume: ignoring live claude session id '$sid' (not a UUID; the id shape may have changed)" >&2; fi
- fi
- sid="$(_state_jsonl_read "$OSRC_SESSION_REGISTRY" 2>/dev/null | jq -r --arg id "$pane" 'select(.event=="start" and .session_id==$id) | .cc_session_id // empty' | tail -1)"
- if _session_cc_uuid_valid "$sid"; then printf '%s\n' "$sid"
- elif [ -n "$sid" ]; then echo "session resume: ignoring registry cc_session_id '$sid' (not a UUID; the id shape may have changed)" >&2; fi
- }
- # _session_cc_resume_for <prov> <pane> -> the resume id for cc/claude panes,
- # empty for every other provider (and whenever no id can be proven).
- _session_cc_resume_for() {
- case "$1" in cc|claude) _session_cc_resume_id "$2" 2>/dev/null ;; esac
- }
- # Relaunch command for `session effort` on a cc session (claude honors effort via
- # MAX_THINKING_TOKENS plus the session-scoped --effort flag). $3 is the pane's
- # claude sessionId when known: --resume <id> pins THIS conversation, --continue
- # (the fallback) picks the newest in the folder and can grab a sibling pane's.
- # --perm safe adds the same allow-list/ask-rules suffix session start emits
- # (default -> empty suffix). No effort -> rc1 (the caller leaves it intact).
- _session_relaunch_cc() {
- local tokens suffix flag resume="${3:-}"
- tokens="$(_effort_thinking_tokens "$2")"
- [ -n "$tokens" ] || return 1
- suffix="$(osrc_perm_string_suffix cc "${PERM_PROFILE:-default}")" || return 1
- flag="$(_cc_effort_flag "$2")"
- printf 'env MAX_THINKING_TOKENS=%q -u CLAUDECODE -u CLAUDE_CODE_ENTRYPOINT -u CLAUDE_CODE_SESSION_ID -u CLAUDE_CODE_CHILD_SESSION -u CLAUDE_CODE_EXECPATH claude --model %q' "$tokens" "$1"
- if _session_cc_uuid_valid "$resume"; then printf ' --resume %q' "$resume"
- elif [ -n "$resume" ]; then printf ' --continue'; echo "session relaunch: resume id '$resume' is not a UUID; falling back to --continue" >&2
- else printf ' --continue'; fi
- printf '%s' "$suffix"
- if [ -n "$flag" ] && _session_cc_effort_supported; then printf ' --effort %q' "$flag"; fi
- }
- # Relaunch command for codex/cx. --perm safe applies the SAME substitution as
- # session start: --approve-for-me replaces `-s workspace-write` (the two conflict).
- _session_relaunch_cx() { # <model> <effort> -> relaunch command string
- local cid code_mode_host sbx
- cid="$(resolve_model_row "$1")"; cid="${cid%%|*}"; [ -n "$cid" ] || cid="$1"
- _validate_model_token "$cid"
- code_mode_host="$(_codex_code_mode_host_flag)" || return 1
- sbx="-s workspace-write"
- [ "${PERM_PROFILE:-default}" = "safe" ] && sbx="--approve-for-me"
- printf 'codex -m %q %s -c features.code_mode_host=%q -c model_reasoning_effort=%q' "$cid" "$sbx" "$code_mode_host" "$2"
- }
- # osrc_perm_flags <engine> <profile> <workdir> — see header. Engine keys accept both
- # provider tokens and lane names; gm resolves to its vehicle via OSRC_GEMINI_VEHICLE
- # or a PATH probe when called directly.
- osrc_perm_flags() {
- local engine="$1" profile="$2" workdir="${3:-$PWD}"
- [ "$profile" = "safe" ] || return 0
- case "$engine" in
- devin|dv) printf '%s\n' '--permission-mode' 'smart' ;;
- cx|codex) printf '%s\n' '--approve-for-me' ;;
- cc|claude) _osrc_perm_claude_args ;;
- cursor) printf '%s\n' '--auto-review' ;;
- agy|antigravity) printf '%s\n' '--mode' 'auto' ;;
- gemini|gmnative|gm)
- # The gm lane's safe flags depend on its VEHICLE: agy has --mode auto; gemini-cli
- # gets --approval-mode auto_edit (edit tools auto-approve, shell commands still
- # ask). SESSION_LAUNCH_ENGINE normally carries the resolved vehicle; direct calls
- # resolve it the same way _session_launch_gm does.
- local veh="${SESSION_LAUNCH_ENGINE:-${OSRC_GEMINI_VEHICLE:-}}"
- [ -n "$veh" ] || { command -v agy >/dev/null 2>&1 && veh=agy; }
- [ -n "$veh" ] || { command -v gemini >/dev/null 2>&1 && veh=gemini; }
- [ -n "$veh" ] || veh=gemini
- case "$veh" in
- agy) printf '%s\n' '--mode' 'auto' ;;
- *) _osrc_perm_gemini_args "$workdir" ;;
- esac ;;
- *) : ;; # droid/hermes/cline/pi/warp/etc: no faithful per-launch safe rung
- esac
- }
plugins/outsourcerer/skills/outsourcerer/scripts/run-or-codex.sh · Bundled script · 65 lines · 1 finding marked
- #!/bin/bash
- # Run Codex CLI against ANY OpenRouter model, NATIVE OpenAI Responses API, no shim.
- # Inline -c overrides only: your normal Codex (ChatGPT-sub) sessions are untouched;
- # config.toml is never modified.
- #
- # Usage:
- # run-or-codex.sh [model] tui # interactive TUI (attach in tmux)
- # run-or-codex.sh [model] exec "the task" # headless one-shot, clean stdout (offload)
- #
- # model OpenRouter model id (default: tencent/hy3:free)
- #
- # Key is sourced from ~/.env (OPENROUTER_API_KEY), never inline.
- MODEL="${1:-tencent/hy3:free}"
- MODE="${2:-tui}"
- export PATH="$HOME/.local/bin:$PATH"
- # Guard: this script routes through OpenRouter ONLY. The BARE ChatGPT-subscription aliases/ids
- # (sol/terra/luna and bare gpt-5.x) are NOT served by OpenRouter and 400 here. Match only bare tokens
- # -- NOT provider-qualified slugs like `openai/gpt-5.6-sol`, which ARE valid OpenRouter models (no
- # leading-`*` glob, so a slug containing a `/` is never matched). Point the caller at the native path.
- case "$MODEL" in
- */*) : ;; # provider-qualified slug (e.g. openai/gpt-5.6-sol) -> a real OpenRouter id, allow it through
- sol|terra|luna|gpt-5|gpt-5.*)
- echo "ERROR: '$MODEL' is a bare ChatGPT-subscription model; it 400s on OpenRouter." >&2
- echo " For an interactive NATIVE-codex session (your ChatGPT auth) use:" >&2
- echo " outsourcerer --provider codex session start -m $MODEL" >&2
- echo " (--provider must precede the subcommand. This script is only for OpenRouter model ids.)" >&2
- exit 2 ;;
- esac
- # Extract ONLY the OpenRouter key, never allexport the whole ~/.env into Codex's env.
- _l="$(grep -E '^[[:space:]]*(export[[:space:]]+)?OPENROUTER_API_KEY=' "$HOME/.env" 2>/dev/null | tail -n1)"
- OPENROUTER_API_KEY="${_l#*OPENROUTER_API_KEY=}"; OPENROUTER_API_KEY="${OPENROUTER_API_KEY%\"}"; OPENROUTER_API_KEY="${OPENROUTER_API_KEY#\"}"; OPENROUTER_API_KEY="${OPENROUTER_API_KEY%\'}"; OPENROUTER_API_KEY="${OPENROUTER_API_KEY#\'}"; export OPENROUTER_API_KEY
- if [ -z "$OPENROUTER_API_KEY" ]; then
- echo "ERROR: OPENROUTER_API_KEY not found in ~/.env" >&2
- exit 1
- fi
- # OpenRouter provider, passed per-invocation (NOT persisted to config.toml).
- # wire_api MUST be "responses", Codex 0.144+ dropped Chat Completions;
- # OpenRouter serves a Responses-compatible endpoint at /api/v1/responses.
- # ISOLATION: --ignore-user-config so this OpenRouter run does not LOAD your live ~/.codex config
- # (above all its mcp_servers, which can wedge a headless run demanding interactive OAuth). The OR
- # provider below fully defines the lane; auth is the env key, not config. Opt out: OSRC_CODEX_USER_CONFIG=1.
- IUC=(); [ "${OSRC_CODEX_USER_CONFIG:-0}" = "1" ] || IUC=(--ignore-user-config)
- OR=(
- -c model_provider=openrouter
- -c 'model_providers.openrouter.name="OpenRouter"'
- -c 'model_providers.openrouter.base_url="https://openrouter.ai/api/v1"'
- -c 'model_providers.openrouter.env_key="OPENROUTER_API_KEY"'
- -c 'model_providers.openrouter.wire_api="responses"'
- )
- if [ "$MODE" = "exec" ]; then
- shift 2 2>/dev/null
- echo "==> Codex (headless) on OpenRouter model: $MODEL" >&2
- exec codex exec --skip-git-repo-check --dangerously-bypass-approvals-and-sandbox \
- Note: Starts a coding agent with its permission prompts off
- Line 58 on GitHub
- ${IUC[@]+"${IUC[@]}"} "${OR[@]}" -m "$MODEL" "$@"
- else
- # NOTE: --ignore-user-config is an `exec`-only flag; the interactive TUI is human-driven (a human
- # can answer an MCP OAuth prompt), so the headless-only wedge doesn't apply here. Don't pass IUC.
- echo "==> Codex (interactive TUI) on OpenRouter model: $MODEL"
- exec codex "${OR[@]}" -m "$MODEL"
- fi
Ratings and comments
Sign in to rate this skill.
Sign inFree to use. If it’s helped, pass it on.