Objective
1-click/line VS Code Remote SSH into a sandbox
End game DX
codebox vscode demo-project
Running this on macOS opens VS Code connected directly to the demo-project sandbox over SSH — no manual SSH config editing, no copy-pasting host aliases. The developer is dropped into the remote workspace immediately.
Proposed solution
SSH config management
codebox maintains a dedicated SSH config tree at ~/.codebox/ssh_config, using SSH's Include directive to aggregate per-instance entries:
~/.codebox/ssh_config
Include ~/.codebox/instances/*/ssh_config ← per-instance entries (glob)
During installation (opt-in, like shell completion), users are instructed to add one line to their ~/.ssh/config:
Include ~/.codebox/ssh_config
This means VS Code Remote SSH (and all other SSH tooling) picks up codebox-managed hosts with no additional configuration.
On codebox create, codebox writes ~/.codebox/instances/<name>/ssh_config:
Host codebox-demo-project
HostName localhost
User user
Port <host-port>
StrictHostKeyChecking no
IdentityFile <instance-key> # if set
ProxyJump <remote> # if --remote is set
On codebox delete, the per-instance file is removed.
codebox vscode <instance>
The command:
- Looks up the instance's host port (same logic as
shell)
- Writes/refreshes
~/.codebox/instances/<name>/ssh_config
- Constructs the URI:
vscode://vscode-remote/ssh-remote+codebox-<name>/home/user
- Opens it via
open "<uri>" on macOS (xdg-open on Linux, start on Windows)
Intermediate command
Before the full vscode subcommand lands, a lower-effort stepping stone:
codebox ssh-config demo-project
Writes (or refreshes) the per-instance SSH config entry and prints:
SSH config written to ~/.codebox/instances/demo-project/ssh_config
Open in VS Code:
open "vscode://vscode-remote/ssh-remote+codebox-demo-project/home/user"
This lets users validate the SSH config approach before the open automation is wired in, and doubles as a repair command if the config drifts.
Objective
1-click/line VS Code Remote SSH into a sandbox
End game DX
Running this on macOS opens VS Code connected directly to the
demo-projectsandbox over SSH — no manual SSH config editing, no copy-pasting host aliases. The developer is dropped into the remote workspace immediately.Proposed solution
SSH config management
codebox maintains a dedicated SSH config tree at
~/.codebox/ssh_config, using SSH'sIncludedirective to aggregate per-instance entries:During installation (opt-in, like shell completion), users are instructed to add one line to their
~/.ssh/config:This means VS Code Remote SSH (and all other SSH tooling) picks up codebox-managed hosts with no additional configuration.
On
codebox create, codebox writes~/.codebox/instances/<name>/ssh_config:On
codebox delete, the per-instance file is removed.codebox vscode <instance>The command:
shell)~/.codebox/instances/<name>/ssh_configvscode://vscode-remote/ssh-remote+codebox-<name>/home/useropen "<uri>"on macOS (xdg-openon Linux,starton Windows)Intermediate command
Before the full
vscodesubcommand lands, a lower-effort stepping stone:Writes (or refreshes) the per-instance SSH config entry and prints:
This lets users validate the SSH config approach before the
openautomation is wired in, and doubles as a repair command if the config drifts.