feat(sandbox): add Herdr setup command - #80
Merged
Merged
Conversation
pratikbin
force-pushed
the
feat/setup-herdr
branch
from
August 25, 2026 14:09
d88925c to
7dade1e
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds
createos sandbox setup herdr. It wires the CreateOS Sandbox plugin into Herdr, so a coding agent runs inside a sandbox and its PTY attaches to a Herdr pane.#78 created the
sandbox setupgroup and has merged, so this now targetsmaindirectly and adds the second subcommand to that group.The companion plugin is
NodeOps-app/createos-pluginsunderpackages/herdr-plugin(NodeOps-app/createos-plugins#24).Why this one does the work itself
Orca drives a per-workspace environment, so
setup orcasplits into a machine half (--recipe, which Orca calls) and a human half that prints install instructions, because Orca performs its own plugin install.Herdr has no such hook, and its entire plugin API is the
herdrCLI. So this command can do every step, and does:--doctorstops after step 4 and changes nothing.Review attention
It writes to the user's
config.toml. That is the part worth arguing about, so it is guarded three ways: the file is copied toconfig.toml.before-createosfirst; only bindings that are not already present are appended; andherdr config checkruns afterwards, failing the command if Herdr rejects the result.--no-keysopts out entirely, andherdr config reset-keysundoes it. A second run adds nothing.It never replaces an existing plugin
config.jsonwithout--force. It says so rather than staying silent.The Herdr config root is derived, not guessed.
herdr plugin config-dir <id>returns<root>/plugins/config/<id>, so walking up three levels follows Herdr wherever Herdr puts it, instead of hardcoding~/.config/herdr.--localis the plugin-development path.herdr plugin linkdeliberately skips build commands, which would leave the plugin without the generated launcher carrying absolutebunandcreateospaths — Herdr runs plugin commands as a bare argv with no shell expansion. So the command runsbuild.shitself after linking, and refuses a directory with noherdr-plugin.toml.Verification
go build,go vet,gofmt -l, andgo test ./...are clean. Three unit tests cover the version gate, keybinding idempotency plus backup, and agent-list consistency.Run against an isolated
HOMEwith a local checkout:herdr config checkthen reportedconfig: ok, andherdr plugin listshowed the plugin enabled. A second run reportedkept your existing config.jsonandkeybindings already present.The version gate matters: a naive string compare reads
0.10.0as older than0.7.5and would refuse a newer Herdr.herdrVersionLesscompares per part, and a non-numeric part sorts as 0 so a pre-release never reads as newer.Mesh
fcListSandboxesfc-sdkcreateos-pluginswebsite-04content/docs/Sandbox/CLI/Commands.mddocuments nosetupsubcommand at all,orcaincluded. That gap predates this PR and belongs with #78. Not written here, since documenting an unmerged command is premature.Lint
golangci-lint2.11.3, the version pinned in.tool-versions, reports 0 issues.An earlier revision of this description claimed the linter could not run against this repository. That was wrong on both counts, and is corrected here: the local binary was v1 against a v2 config, and the sandbox attempt used an arbitrary v2.6.2 instead of the pinned 2.11.3. CI runs it correctly. Installing the pinned version with asdf reproduced all fifteen findings locally, and
d88925cfixes every one of them at the source rather than suppressing them — the three#noseccomments that remain each name why the argv or path is safe, matching the convention already used inorca.go.