Skip to content

prepare-sh/environment-ctl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

envctl

Minimal CLI to manage exposed ports on your prepare.sh sandbox VM — from inside the VM's terminal.

envctl ls                      list exposed ports on the current VM
envctl add <port> [--public]   expose a port (optionally public)
envctl rm  <port>              remove an exposed port
envctl public  <port>          make a port public (no auth)
envctl private <port>          make a port owner-only

  [--vm <name>] [--alloc <id>]  target a specific VM (auto-detected otherwise)

Auth

Uses the token already injected into the VM — no login needed:

  1. PREPARESH_TOKEN if set,
  2. otherwise ANTHROPIC_API_KEY (the same psh.* token).

It's sent to api2 as the Session header and resolves to your account.

Which VM

One account can have several VMs, so envctl auto-detects the current one by matching the machine hostname against your allocations. If it can't tell (multiple matches), it lists them — pass --vm <name> or --alloc <id>.

Config

Env var Default Meaning
PREPARESH_TOKEN token (falls back to ANTHROPIC_API_KEY)
PREPARESH_API https://prepare.sh/apiv2 api2 base (set to https://dev.prepare.sh/apiv2 on dev)

Install

curl -fsSL https://github.com/prepare-sh/environment-ctl/releases/latest/download/envctl-linux-amd64 \
  -o /usr/local/bin/envctl && chmod +x /usr/local/bin/envctl

Or build: go build -o envctl .

Examples

envctl add 3000 --public      # expose your dev server publicly
envctl ls                     # see its URL
envctl private 3000           # lock it back to owner-only
envctl rm 3000

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages