
Binky
io.github.andreisilva1由 GitHub 账号 andreisilva1 发布v0.1.2更新于 Nov 10, 2026
Isolated dev environments, one per git worktree: ports, env, and DB slices as agent tools.
概览
为每个 git worktree 提供独立的本地开发环境——端口、环境变量、数据库切片和 URL——让并行的编码代理互不冲突。
- 可以做什么
- Binky 运行一个机器级守护进程,按名称创建或复用 git worktree,在任何进程启动前为每个进程分配端口并注入完整端口映射,使服务启动时就知道自己和依赖项的地址(R124、R125)。适配器从一台共享服务器上切出隔离的切片——数据库、键前缀、存储桶、主题前缀或索引前缀——而不是为每个工作树各跑一个服务器(R60、R63)。它按 depends_on 顺序启动服务、做健康检查并收集日志,还把 service.worktree.domain 代理到正确端口(R127、R128)。通过 MCP 暴露 up、down、status、env 和 verify 工具(R114)。
- 适用场景
- 当多个编码代理或分支在同一台机器上并行运行,并在端口、.env 文件或共享数据库上互相冲突时,值得加入(R10、R11、R12)。它面向单用户开发工作站,不提供真正的隔离或多租户能力(R142)。如果你同一时间只跑一个分支,它只是一个你并不需要的守护进程和配置文件(R53)。
- 运行要求
- 本地 stdio 进程,可用 uvx 运行(也可用 uv tool install 或 pipx 安装)。需要 Python 3.11+ 和 git,支持 Linux 或 Windows;macOS 目前尚不支持(R16、R17)。适配器驱动以 extras 形式提供,例如 binky[postgres] 或 binky[all-adapters](R19)。适配器切片需要访问共享服务器,管理凭据通过环境变量提供,例如 ${env.POSTGRES_ADMIN_URL}(R23)。MCP 服务器本身未声明任何认证。
安装
在 SourceWeft 中
- 打开 控制台中的 Binky,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
Binky
One isolated local world per git worktree — ports, env, database, URLs.
So a swarm of coding agents runs in parallel on one machine without anything colliding.
[CI] [PyPI] [Python] [License]
Docs · Quickstart · Adapters · Commands · For agents · How it works · Troubleshooting
docker-compose was built for one process at a time. Binky is built for fifteen at once.
Status: alpha. The core works end to end — worktree isolation, ports, adapters, supervision, reconciler, admission, proxy, HTTPS. The config format is stable; the CLI may still move.
The problem
You point three agents at the same repo. The second one runs pnpm dev and gets EADDRINUSE.
The third runs your migrations and drops the table the first was reading. You start hand-editing
.env files, and now you're the scheduler.
Binky is the scheduler. One binky up <branch> per agent, and each gets its own ports, its own
database, its own URLs — from the same committed config.
Install
Python 3.11+ and git, on Linux or Windows — the two platforms Binky is tested on for real. macOS isn't a supported target yet; a well-tested port would be a welcome contribution.
Or from a clone, to run the unreleased main or to hack on it:
Adapters that need a driver ship as extras — installing Binky for Redis shouldn't pull boto3:
Quickstart
Already have a docker-compose.yml? Start from it:
Or write it by hand — this is the whole config:
Then bring worktrees up in parallel:
Two branches, four processes, four ports nobody chose by hand. Hand a worktree's coordinates to whoever needs them — a shell, an agent, a test run:
And the rest of the lifecycle:
Nothing is hardcoded and nothing is discovered at runtime: every process boots already knowing the whole port map, its own and its dependencies'.
One rule to internalise. A service gets a port when it declares
urlorports— asking is explicit. A service with neither gets none, which is correct for a worker or a one-shot job, and a trap if you then write${self.port}in itscmd. Unknown tokens are left alone rather than blanked, so the literal${self.port}reaches the shell and the process dies on its own argument parsing.binky checkwarns when a service does this.
What it costs to run N worlds
The claim is that N isolated worlds shouldn't cost N times one world. Measured, not asserted —
benchmarks/worlds.py is in this repo and reproduces the table below (postgres:16, 200,000 rows
per world, Docker Desktop on Windows 11):
The 8th world costs +150 MiB and +4.8s as its own container, or +17 MiB and +1.7s under Binky.
Read the first row too. At one world Binky is behind — it pays for a server plus a golden
template nobody is using yet, and only earns that back on the second. And disk is not a win:
CREATE DATABASE ... TEMPLATE is a file copy, not copy-on-write, so every world is still a full
copy of the rows. What Binky removes is the server per world, not the bytes per world. It also
doesn't make your own app processes cheaper — one dev server per worktree costs the same either way.
When you don't need Binky
Worth saying plainly, because the first row of that table already says it:
- One branch at a time. If you never have two worlds up at once, Binky is a daemon and a config file you didn't need. Use it when the second agent shows up.
- Everything already runs in containers, and that's fine. Binky's win is removing the server per world. If your compose stack is small enough that N copies fit comfortably, there's nothing to reclaim.
- You need real isolation, not local isolation. Binky runs your commands as you, on your machine. It is not a sandbox — see Security.
Adapters
An adapter carves an isolated slice of one shared server — a database, a key prefix, a bucket — instead of running one server per worktree. 16 names, 10 implementations, every one exercised against a real server in CI.
Protocol-compatible names share one implementation rather than a copy of it — valkey is the Redis
adapter, percona is the MySQL one, opensearch is the Elasticsearch one.
clone_from: pay for migrate+seed once
With clone_from, the first binky up builds a golden template — provision, migrate, seed —
and every worktree after that is a copy of it. The template is keyed by a hash of your migrate and
seed commands, so changing either rebuilds it automatically.
Supported where the server can copy a slice server-side (postgres, mysql, mariadb, percona,
mongodb). Where it isn't, or where a clone fails on something environmental — a client binary too
old to authenticate, a missing grant — Binky falls back to provision+migrate+seed for that
worktree and logs clone_fallback. Correctness never depends on cloning; only speed does.
One sharp edge worth knowing: the hash covers the migrate and seed commands, not the files they
call. Editing a script those commands run does not rebuild the template — delete its marker under
~/.binky/golden/ to force one.
Writing your own
Two tiers, one contract. Both implement the same four verbs:
In-process adapters are Python classes in this repo, discovered by name. External adapters
are executables in any language, discovered as binky-adapter-<name> on PATH and driven over a
one-shot subprocess + JSON protocol:
Python authors get the protocol for free — binky.adapter_sdk.run() bridges a normal adapter class
to it. See examples/adapters/filestore.py for a complete,
dependency-free one in 30 lines.
Commands
For agents
binky mcp speaks MCP over stdio, exposing up, down, status, env and verify — the same
verbs the CLI calls, against the same daemon.
In Claude Code, one line wires it up:
Any other client that speaks the protocol takes the same stdio server as a config block — the same one everywhere, only the file differs:
To run it with nothing installed, hand it to uvx instead — claude mcp add binky -- uvx --from "binky[mcp]" binky mcp, or as a block, "command": "uvx", "args": ["--from", "binky[mcp]", "binky", "mcp"]. For a project whose worktrees provision adapter slices, add those extras too, e.g.
binky[mcp,postgres] (or binky[mcp,all-adapters] for the whole matrix).
Binky is published in the MCP Registry as
io.github.andreisilva1/binky, so registry-aware clients can discover and install it from there.
For the tool list and an agent-oriented walkthrough, see AGENTS.md.
How it works
A single machine-global daemon sits between your worktrees and the machine:
- Worktree — creates/uses a git worktree per name.
- Ports — a global allocator assigns every process a port before anything starts and injects
the whole map, so nothing collides (
${self.port},${api.url}, …). - Resources — adapters carve an isolated slice per worktree and tear it down on remove.
- Supervision — starts services in
depends_onorder, waits for health, captures logs. - Proxy — routes
<service>.<worktree>.<domain>to the right port (WebSockets/HMR included). Sethttps = trueand Binky fronts it with Caddy for TLS via a local CA, when Caddy is on PATH. - Admission — a FIFO queue that only starts a worktree when the machine has room: fewer than
max_parallelrunning and enough free RAM (a percentage kept in reserve) and enough free disk (a fixed GB headroom). If a running swarm later crosses the RAM reserve, the daemon suspends the newest worktree to relieve pressure and resumes it — in fairness order — once room returns. Tune the reserves withbinky reserve; see them withbinky config.
State lives in ~/.binky/ (a SQLite registry plus a settings store, migrated in place across
upgrades). Nothing runs in the cloud, and Binky never phones home.
Examples
- examples/hello — the smallest possible project.
- examples/rag — vector search where each worktree gets its own embedded corpus.
The case where sharing a database actually hurts: two agents re-indexing, one
TRUNCATE. - examples/adapters/filestore.py — an external adapter, complete.
Security
Binky runs your commands on your machine as you. It is a developer tool for a
single-user workstation, not a multi-tenant sandbox — a binky.toml is as trusted as a Makefile,
and binky up on a repo you don't trust is make on a repo you don't trust. The threat model and
what's explicitly out of scope are written down in SECURITY.md.
The one rule worth repeating here: never put a credential inline in a committed binky.toml.
Use ${env.NAME} or an env_file. binky check warns when you do, and binky init never writes
one.
Something not working?
TROUBLESHOOTING.md covers the cases that actually come up — a port held from
outside, a dev server ignoring $PORT, a stale golden template, *.localhost not resolving. Start
with binky doctor.
Development
Adapter integration tests skip unless you point them at a real server —
BINKY_TEST_PG, BINKY_TEST_REDIS, BINKY_TEST_MYSQL, BINKY_TEST_MONGO, BINKY_TEST_S3,
BINKY_TEST_RABBITMQ, BINKY_TEST_KAFKA, BINKY_TEST_QDRANT, BINKY_TEST_CLICKHOUSE,
BINKY_TEST_ELASTICSEARCH. CI provides all of them.
Contributing
Bug reports, new adapters, and PRs are welcome — see CONTRIBUTING.md to get set up, and ARCHITECTURE.md for a map of the internals.
License
来源:README.md,提交 a65cb54
工具
0版本历史
1- v0.1.2最新Sep 16, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分