Repository navigation
claude: run Claude Code on a VM of any provider, not only boxes - #1212
Merged
Merged
Conversation
`onctl claude` was pinned to the hosted boxes provider. Now `-p` picks any provider -- `onctl -p hetzner claude`, aws, fc, ac, ... -- and the command creates the project's VM through it the way `onctl create` does, reaches it over plain ssh at its address with the configured key, installs tmux, git, curl and Claude Code, copies the project and starts Claude in tmux, as on a box. Boxes stay the default when no provider is named. Where the provider's user isn't root (aws's ubuntu, gcp, azure), the first connection lets root in with the same key, replacing the restricted line cloud-init leaves for it. --size/--image are the provider's VM type and image (unset, its onctl.yaml defaults); --idle-ttl stays boxes-only; --github forward needs the box image's helpers, so off a box the default is off. `claude ls` lists the provider's VMs and fetch/push address the VM by IP. The setup step now runs before anything that needs git, which a plain image lacks. Checked end to end on ac (Apple container, Ubuntu 24.04): create, setup, copy, tmux, ls and fetch. Claude-Session: https://claude.ai/code/session_019DqSGUERsT3cdmSJbNH7x7
cdalar
enabled auto-merge
October 21, 2026 19:26
…n attachHint The session's hint stays pure: the test runs with whatever provider the package's global holds (gcp in CI), and only a real run knows it. Claude-Session: https://claude.ai/code/session_019DqSGUERsT3cdmSJbNH7x7
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1212 +/- ##
==========================================
+ Coverage 41.25% 45.22% +3.96%
==========================================
Files 69 75 +6
Lines 7560 8732 +1172
==========================================
+ Hits 3119 3949 +830
- Misses 4441 4782 +341
- Partials 0 1 +1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
Summary
onctl claudewas pinned to the hostedboxesprovider (the "for now" inroot.go). This is the follow-updocs/plans/boxes-provider.mdsketched:-pnow picks any provider, andonctl -p hetzner claude(aws, fc, ac, ...) spins up the project's VM through it the wayonctl createdoes, reaches it over plain ssh at its address with the configured key, installs tmux/git/curl and Claude Code, copies the project and starts Claude in tmux -- then everything (--task,ls,fetch/push,--handoff, detach/reattach) works as on a box. Boxes stay the default when no provider is named.cmd/claudevm.go(new): find/resume/create the VM, wait for ssh, and -- where the provider's user isn't root (awsubuntu, gcp, azure) -- let root in with the same key, replacing the restrictedcommand="echo Please login as ..."line cloud-init leaves for it (sshd takes the first matching line).boxSSHgains user/host/port and aremoteURL, sofetch/pushaddress a VM by IP (ssh://form off port 22).--size/--imageare the provider's VM type and image (unset, itsonctl.yamldefaults);--idle-ttlstays boxes-only (warns);--github forwardneeds the box image's helpers, so off a box the default becomesoffand an explicitforwardis an error.Testing
go test ./...,go vet,golangci-lint run: clean. New tests run the root-login script with a stubbedsudo(restricted line replaced, other keys kept, idempotent,PermitRootLoginfixed in drop-in andsshd_config), checkremoteURL, and check the setup script only installs what's missing.ac(Apple container, Ubuntu 24.04):onctl -p ac claude --detachcreated the container, installed tmux/git/curl and Claude Code, copied the project, set the git identity andreceive.denyCurrentBranch, and started Claude in tmux;claude lsshowed it running;claude fetchpulledbox/mainover the IP. Not run against a non-root cloud image (aws/gcp/azure): that path is covered by the script test only.🤖 Generated with Claude Code
https://claude.ai/code/session_019DqSGUERsT3cdmSJbNH7x7