Function operations are environment-scoped. A Function name, named secrets, version history, schedules, and name-based run lookups belong to a Function environment. Omitted environment selectors use default.
nullspace environment create staging
NULLSPACE_ENVIRONMENT=staging nullspace functions deploy --json
nullspace functions list --env staging --json
nullspace functions history repo-review-agent --env staging --json

Runtime Environment And Secrets

function.py stores env var names and named secret references, not plaintext secret values.
export NULLSPACE_API_URL=https://api.your-nullspace-domain
export NULLSPACE_API_KEY=ns_live_...

nullspace secret create openai \
  --env prod \
  OPENAI_API_KEY="$OPENAI_API_KEY"

nullspace functions run repo-review-agent \
  --env prod \
  --env TASK_ID=task_123 \
  --json
Runtime values and named secrets are injected into the Function process and are not returned by list/get APIs.

Logs, Status, And Machines

nullspace functions status repo-review-agent --run fnrun_123 --json
nullspace functions logs repo-review-agent --run fnrun_123 --follow
nullspace functions outputs repo-review-agent --run fnrun_123 --json
nullspace functions machine repo-review-agent --run fnrun_123
nullspace functions shell repo-review-agent --run fnrun_123 --cmd "pwd"
Use retained machines for live debugging after a failed job or service stop. The retained machine is still a normal machine boundary: inspect files, run commands, open PTY/SSH, or connect a desktop viewer when the template supports it.

Versions, Rollback, And Branching

Deploys create new immutable versions. Rollback moves the Function back to a previous version or checkpoint; it does not mutate the old version.
nullspace functions history repo-review-agent --json
nullspace functions rollback repo-review-agent --version-id fnv_123 --json
nullspace functions tree repo-review-agent

nullspace functions checkpoint repo-review-agent \
  --run fnrun_123 \
  --label before-change \
  --json

nullspace functions branch repo-review-agent \
  --run fnrun_123 \
  --checkpoint-id chk_123 \
  --count 3 \
  --json
Use checkpoints and branches when you need RAM/filesystem state from a job run or service instance, such as reproducing an agent failure or exploring multiple continuations from the same retained state. The same state commands work for services by replacing --run with --service.
nullspace functions checkpoint repo-review-agent \
  --service fnsvc_123 \
  --label before-restart

nullspace functions branch repo-review-agent \
  --service fnsvc_123 \
  --checkpoint-id chk_123 \
  --count 2