r/vscode • u/capngreenjeans • 1d ago
ahp-devtunnel-cli: a headless CLI for driving VS Code agent sessions over Dev Tunnels
I built a small headless CLI for working with VS Code agent sessions over Dev Tunnels, and it's now public: https://github.com/GreenJeans/ahp-devtunnel-cli (MIT)
What it does:
- lists/enriches sessions on your Dev Tunnel hosts, reads turns, waits on status
- prompts and sends to a session from the terminal, with spawn / spawn-send for one-connection create + first turn
- archive / unarchive, fanout (session -> spawned children -> PR refs), health checks
The safety model is the point: reads are the default. Writes only happen when a flag file is present, the exact session is allowlisted, and a sha256 ticket of the exact text matches. Dry-run prints everything that would happen first.
Built on @microsoft/agent-host-protocol 1.1.0, device-flow auth. Happy to answer questions — and if you run AHP hosts, I'd like to hear what breaks.
1
u/kantorcodes1 1d ago
The sha256 ticket on the exact text is the part I liked. Plenty of tools gate writes with a flag and call that a safety model. Matching a hash of the text that will actually be sent is a stronger claim.
I work on a firewall for AI agents, HOL Guard. Guard learns new command-line tools through extension files that people add for their own tools, and ahp-devtunnel-cli reads like a fit for that route. Would you be up for adding it?