zert-cli

command module
v0.7.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 28, 2026 License: MIT Imports: 27 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

Zert

Zert-cli is the client for the zert sandbox service. Boot a vm hosted in Norway, copy your repo, work inside an airgapped development enviroment, with access to Norwigian hosted AI. Debug, build or test knowing your data is safe.

  • One static Go binary.
  • Your SSH key authenticates you to your VMs; the session token never appears in argv or URLs.
  • Leaving the ssh session never kills the VM. Detaching (exit, Ctrl-C, a closed laptop lid, a dead network) drops the connection, and the VM keeps running, Detached. A Detached VM then waits out its Idle window: the 4 hours it gets after its last connection closes. Only zert kill, or an expired Idle window, ends a VM.

Install

brew tap Torgersrud/zert
brew install zert

or the Go toolchain:

go install github.com/Torgersrud/zert-cli@latest

Prebuilt binaries for every platform are on the releases page (tagging vX.Y.Z builds and publishes them automatically).

Quickstart

zert login
zert vm                         # create a VM and ssh into it (leaving never kills it)
zert ./myproject                # run a zert vm with your repo
zert extract ~/report.pdf       # copy a file/dir out of your live vm
zert status                     # your machine in plain words: running with
                                 # its time left, asleep, or none yet
zert ls                         # the technical listing: raw ids with state
                                 # words and time left
zert kill                      # terminate your VM(s) — same as kill all
zert kill <id>                  # terminate a VM
zert kill all                   # terminate all your VMs
zert --version

zert ./myproject starts a VM if none is live and drops you into an ssh session afterwards; when you leave, that VM keeps running. If one is already live it just copies into it.

zert status answers the one question — is my machine on? — in plain words: a running machine says so with the time its Idle window has left, a sleeping one says asleep (it wakes on your next connect, with everything as you left it), one still being made says so, and having none says that and points at zert vm. A state this version of the CLI has never seen is admitted, not guessed at. Raw ids appear in zert ls and nowhere else on the customer-facing surface.

Coming back to your VM is the same as getting in: zert vm, zert <path>, or the stable name in your ssh config (ssh zert). The machine need not be running — one that fell asleep wakes on your next connect, a few seconds' pause, then the same shell, with everything as you left it. Raw ids appear in zert ls and nowhere on the way in: entry never names an id, so there is no command to enter a machine by id. Leaving never kills the VM — only zert kill ends it: an idle machine falls asleep, and your next connect wakes it.

Every interactive entry (zert vm and the entry after a copy) runs inside one tmux session in the VM, named zert. That is what makes a Detach restorable: your scrollback, running programs and background jobs keep running, and the next entry lands back in the same shell. Two entries show the same screen (they mirror the session). To leave on purpose without exiting your shell, use tmux's detach key Ctrl-b d. A VM from the old, pre-tmux Template falls back to a plain shell: you still get in, only without the session restore. Passing your own remote command to ssh runs it as given, outside the session. The longest single connection is 8 hours, and reaching that cap detaches you — it does not kill the VM.

zert extract <vm-path> [dir] is the way back out: it copies a file or directory from your live VM into [dir] (default: the current directory). VM paths resolve against the VM's home directory, just like after a fresh ssh login. The entry is streamed back as one compressed tar, and extraction refuses to write anything outside the chosen destination. It never creates or kills a VM — start one with zert vm or zert <path> first.

To add args for the zert ssh session, pass them after the command (e.g. zert vm -L 8080:localhost:8080 or zert ./myproject -L 8080:localhost:8080). With zert <path>, extra ssh args also make you enter an already-running VM after the copy. Entering — and leaving — never ends a VM either way; zert kill is the only way one dies — an idle machine falls asleep instead. The old --keep flag is still accepted on every entry command (zert vm, zert <path>) for existing scripts; it prints --keep is obsolete — vms no longer die on exit and changes nothing.

Account commands

The bare zert answer names the commands that matter; these are the rest:

  • zert login [--host URL] [--insecure] — authenticate and store credentials.
  • zert login --stdin [--host URL] [--insecure] — non-interactive login for GUIs: the email then the password arrive as two lines on stdin — never argv, so nothing shows in process listings; the outcome is one machine-readable word on stdout (ok, bad-credentials, unprovisioned, rate-limited, error: <reason>) with the matching exit status 0-4.
  • zert logout — delete stored credentials.
  • zert me — show profile, quota, pubkey.
  • zert key register — register the account's ssh public key — the key line arrives on stdin, never argv (zert key register < ~/.ssh/id_ed25519.pub); one account has one active laptop, so registering over a previous key displaces that laptop — its key stops working.

Configuration

  • Credentials live in ~/.config/zert/credentials
  • Server host resolution: --host flag > $ZERT_HOST > stored credentials.
  • $ZERT_TUNNEL_TOKEN is an internal handoff used by the hidden zert tunnel ProxyCommand child — you never set it yourself.

Security

Short version: HTTPS is enforced (plain http:// only for loopback or an explicit --insecure flag), tokens never touch argv or URL query strings, and server text is sanitized against terminal-escape injection. Full notes in SECURITY.md; known limitations and planned hardening (host-key pinning, token revocation) are tracked in docs/FOLLOWUPS.md — its idempotent-create item is closed there: POST /v1/vm is now the door's idempotent ensure call. Report vulnerabilities privately — see SECURITY.md.

Development

go build ./... && go test ./...    # tests use httptest stubs, no VMs needed
./build.sh                         # static cross-compile → dist/ + SHA256SUMS

License

MIT — see LICENSE.

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
⌂ 换网址