CLI
bash
npm install -g @ai2in/cliDrive sandboxes from your terminal. Node 18+, zero dependencies.
Auth
bash
ai2in login --key ai2in_live_… # stored in ~/.ai2in/config.json (chmod 600)
ai2in whoami # verify the stored credentialsCredentials resolve from AI2IN_API_KEY / AI2IN_BASE_URL first, then the config file. --url points at a self-hosted engine.
Sandboxes
bash
ai2in run <file.py> # run a file in a fresh sandbox, output streamed
ai2in run -e "print(6*7)" # run an inline snippet
ai2in run app.py --sandbox <id> # reuse an existing sandbox
ai2in run app.py --keep # don't kill the ephemeral sandbox after
ai2in create [--desktop] [--image <img>] # create a sandbox
ai2in ls # list sandboxes (running + paused)
ai2in shell <id> # live bash inside the sandbox (Ctrl+] detaches)
ai2in info <id> # status, timestamps, owning node
ai2in timeout <id> <seconds> # auto-kill after N seconds (extendable)
ai2in pause <id> # park a sandbox
ai2in resume <id> # bring it back
ai2in expose <id> <port> # public HTTPS URL for a bound port
ai2in rm <id> # destroy a sandboxPlatform
bash
ai2in db create <postgres|redis> [--name <n>] # managed database -> connection string
ai2in deploy <image> [--name <n>] [--port <p>] # persistent service -> live URLExample: preview a web app
bash
id=$(ai2in create | awk '{print $1}')
ai2in run --sandbox "$id" --keep -e \
"import subprocess; subprocess.Popen(['python','-m','http.server','3000'])"
ai2in expose "$id" 3000 # -> https://3000-<id>.up.ai2in.devEnvironment
| Var | Purpose |
|---|---|
AI2IN_API_KEY | bearer token (overrides config) |
AI2IN_BASE_URL | engine URL (default https://api.ai2in.dev) |