Sandbox record and pipe-safe operations.
The Sandbox record is the central type of the SDK. Obtain one from pocketenv-io.pocketenv/create-sandbox or get-sandbox, then pipe operations with Clojure's -> threading macro:
(-> (pocketenv/create-sandbox "my-box") (sandbox/start) (sandbox/wait-until-running) (sandbox/exec "clojure" ["-M:test"]))
Every operation accepts either a bare Sandbox record or an {:ok sandbox} result map, enabling seamless threading. Passing {:error reason} raises an exception, keeping error handling explicit.
Sandbox record and pipe-safe operations.
The Sandbox record is the central type of the SDK. Obtain one from
pocketenv-io.pocketenv/create-sandbox or get-sandbox, then pipe
operations with Clojure's -> threading macro:
(-> (pocketenv/create-sandbox "my-box")
(sandbox/start)
(sandbox/wait-until-running)
(sandbox/exec "clojure" ["-M:test"]))
Every operation accepts either a bare Sandbox record or an {:ok sandbox}
result map, enabling seamless threading. Passing {:error reason} raises
an exception, keeping error handling explicit.(delete sandbox-or-result)(delete sandbox-or-result opts)Deletes the sandbox permanently. Returns {:ok sandbox} with last known state.
Options: :token
Deletes the sandbox permanently. Returns {:ok sandbox} with last known state.
Options: :token(delete-secret sandbox-or-result id)(delete-secret sandbox-or-result id opts)Deletes a secret by its id.
Options: :token
Deletes a secret by its id. Options: :token
(exec sandbox-or-result cmd)(exec sandbox-or-result cmd args)(exec sandbox-or-result cmd args opts)Executes a shell command inside the sandbox.
Returns {:ok ExecResult} with :stdout, :stderr, :exit-code.
Options: :token
Executes a shell command inside the sandbox.
Returns {:ok ExecResult} with :stdout, :stderr, :exit-code.
Options: :token(expose sandbox-or-result port)(expose sandbox-or-result port opts)Exposes a port on the sandbox. Returns {:ok preview-url-or-nil}.
Options: :description, :token
Exposes a port on the sandbox. Returns {:ok preview-url-or-nil}.
Options: :description, :token(get-ssh-keys sandbox-or-result)(get-ssh-keys sandbox-or-result opts)Fetches the SSH key pair for the sandbox.
Options: :token
Fetches the SSH key pair for the sandbox. Options: :token
(get-tailscale-auth-key sandbox-or-result)(get-tailscale-auth-key sandbox-or-result opts)Fetches the Tailscale auth key for the sandbox.
Options: :token
Fetches the Tailscale auth key for the sandbox. Options: :token
(list-ports sandbox-or-result)(list-ports sandbox-or-result opts)Lists all exposed ports on the sandbox.
Returns {:ok [Port]}
Lists all exposed ports on the sandbox.
Returns {:ok [Port]}(list-secrets sandbox-or-result)(list-secrets sandbox-or-result opts)Lists all secrets for the sandbox.
Options: :limit (default 100), :offset (default 0), :token
Lists all secrets for the sandbox. Options: :limit (default 100), :offset (default 0), :token
(set-secret sandbox-or-result name value)(set-secret sandbox-or-result name value opts)Adds an encrypted secret to the sandbox.
Options: :token
Adds an encrypted secret to the sandbox. Options: :token
(set-ssh-keys sandbox-or-result private-key public-key)(set-ssh-keys sandbox-or-result private-key public-key opts)Stores an SSH key pair. The private key is encrypted client-side.
Options: :token
Stores an SSH key pair. The private key is encrypted client-side. Options: :token
(set-tailscale-auth-key sandbox-or-result auth-key)(set-tailscale-auth-key sandbox-or-result auth-key opts)Stores a Tailscale auth key. Must start with "tskey-auth-". Encrypted client-side before transmission.
Options: :token
Stores a Tailscale auth key. Must start with "tskey-auth-". Encrypted client-side before transmission. Options: :token
(start sandbox-or-result)(start sandbox-or-result opts)Starts the sandbox. Re-fetches state after the call.
Options: :repo, :keep-alive, :token
Starts the sandbox. Re-fetches state after the call. Options: :repo, :keep-alive, :token
(stop sandbox-or-result)(stop sandbox-or-result opts)Stops the sandbox. Re-fetches state after the call.
Options: :token
Stops the sandbox. Re-fetches state after the call. Options: :token
(unexpose sandbox-or-result port)(unexpose sandbox-or-result port opts)Removes an exposed port. Returns {:ok sandbox}.
Options: :token
Removes an exposed port. Returns {:ok sandbox}.
Options: :token(vscode sandbox-or-result)(vscode sandbox-or-result opts)Exposes VS Code Server and returns its URL.
Returns {:ok preview-url-or-nil}
Options: :token
Exposes VS Code Server and returns its URL.
Returns {:ok preview-url-or-nil}
Options: :token(wait-until-running sandbox-or-result)(wait-until-running sandbox-or-result opts)Polls until the sandbox status becomes :running.
Options: :timeout-ms (default 60000), :interval-ms (default 2000), :token
Polls until the sandbox status becomes :running. Options: :timeout-ms (default 60000), :interval-ms (default 2000), :token
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |