- TypeScript 93.4%
- Shell 5.1%
- PowerShell 1.5%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| .forgejo | ||
| .githooks | ||
| docs | ||
| scripts | ||
| src | ||
| tests | ||
| .gitignore | ||
| CLAUDE.md | ||
| deno.json | ||
| deno.lock | ||
| install.ps1 | ||
| install.sh | ||
| LICENSE.md | ||
| main.ts | ||
| README.md | ||
rotocmd
The operator CLI for RotoStudio. It
bootstraps, updates and runs RotoStudio instances on Docker, renders projects with the headless
renderer on a GPU server, and updates itself. It is a single executable; the only host requirement
is Docker with the compose plugin (for render: Docker with the
NVIDIA Container Toolkit).
Install
# Linux, macOS
curl -fsSL https://git.belowtoxic.cloud/api/packages/belowtoxic.eu/generic/rotocmd/latest/install.sh | sh
# Windows (Docker Desktop)
irm https://git.belowtoxic.cloud/api/packages/belowtoxic.eu/generic/rotocmd/latest/install.ps1 | iex
Both scripts check the binary against its .sha256 file and release-trust.json. ROTOCMD_VERSION
installs a given version; ROTOCMD_INSTALL_DIR changes the target directory (default
~/.local/bin).
Use
rotocmd bootstrap # asks for a directory (./rotostudio) and port (8080), starts it
rotocmd status # containers, pinned image, health and running version
rotocmd update --check # what an update would change
rotocmd update # back up, update, restart, wait for health
rotocmd logs --follow
rotocmd down | up
rotocmd self-update
# Track and export a project prepared in the browser app (headless renderer, NVIDIA GPU)
rotocmd render shot.rsproj --video shot.mp4 --out renders/
rotocmd render shot.rsproj --video shot.mp4 --out renders/ -- --export exr,rgba --from 100 --to 250
| Command | What it does |
|---|---|
bootstrap [--dir] [--version <v>|latest|edge] [--port] [--bind] [--image] [--force] [--no-start] |
Downloads and checks the deploy bundle of a release, writes docker-compose.yml, env.example, README.md and .env with the image pinned to <repo>:<tag>@sha256:…, pulls, starts, waits for /api/health. |
update [--check] [--version] [--image] [--yes] |
A release moves to latest (never back); edge stays on edge. Checks that the image exists, shows the plan (image, changed files, new settings in env.example), backs up .env and changed files to .rotocmd-backup/update-<time>/, writes, pulls, restarts. The health check decides; on failure it prints the rollback. |
list, use [<id>|<path>] | --clear |
Instances on this host (* = selected) and the selection. |
up, down, status, logs [--follow] [--tail] |
docker compose for the instance. |
render <project> --video <file> --out <dir> [--version] [--cpu] [-- <renderer options>] |
Runs the headless renderer image (rotostudio-headless) on a project: checks its release-trust.json, checks that Docker has NVIDIA GPU support (unless --cpu), pulls the image by digest, and runs it with the project and video mounted read-only and --out writable. Progress streams to stderr; Ctrl-C stops the container. The version defaults to the installed instance's (else latest). See rotocmd help render. |
version [--check], self-update [--check] [--version] |
rotocmd itself. |
Every command supports --json, which prints one object:
{ok, command, id, message, messages, data}. Exit codes: 0 ok, 1 failed, 2 wrong usage.
Which instance
An instance is a directory with docker-compose.yml and .env. The directory's name is the
instance id and the compose project name. A command works on:
-i/--instance <id|path>;- otherwise
ROTOSTUDIO_DEPLOY_DIR; - otherwise the instance selected with
rotocmd use; - otherwise the current directory, if it is an instance;
- otherwise the only instance on the host.
rotocmd list finds instances in four places:
- the ones rotocmd set up or was pointed at;
- the ones Docker runs;
- directories one level below
ROTOCMD_INSTANCE_SEARCH(default/opt /srv $HOME); - the current directory.
Instances from before the rename
RotoStudio was called Rotoscopia up to 0.13 (legacy name). rotocmd still works with what those versions left behind (D006):
- An instance whose
docker-compose.ymland.envuse the legacyROTOSCOPIA_IMAGEis found, listed and run as before; its/api/healthmay still answer with the legacy app id. rotocmd updatemoves it to therotostudiopackage and image. It writes the newdocker-compose.yml, renames the legacyROTOSCOPIA_IMAGE=line of.envtoROTOSTUDIO_IMAGE=and leaves every other byte of.envas it is. The plan shows the rename; the backup and the rollback cover the olddocker-compose.ymltoo.- The legacy variable
ROTOSCOPIA_DEPLOY_DIRis used whenROTOSTUDIO_DEPLOY_DIRis not set. rendertakes legacy.rotoscopiaprojects as well as.rsprojones. For an instance still on 0.13 or older, it runs that version's renderer from the legacyrotoscopia-headlesspackage.
A docker-compose.override.yml next to docker-compose.yml is passed to compose last. rotocmd
never writes it.
Environment
| Variable | Default | |
|---|---|---|
ROTOCMD_PACKAGES_URL |
https://git.belowtoxic.cloud/api/packages/belowtoxic.eu/generic |
Registry (deploy bundles and rotocmd) |
ROTOCMD_VERIFY_SIGNATURES |
warn |
off, warn, enforce. Releases are not signed yet (D003). |
ROTOCMD_STATE_DIR |
$XDG_STATE_HOME/rotocmd |
Instance registry and selection |
ROTOCMD_INSTANCE_SEARCH |
/opt /srv $HOME |
Where list looks for instances |
ROTOCMD_HEALTH_TIMEOUT_SECS |
120 |
How long bootstrap/update/up wait for /api/health |
ROTOCMD_HEARTBEAT_SECS |
15 |
"still running" interval for long Docker steps (0: off) |
ROTOCMD_PIN_IMAGE_DIGEST |
1 |
0 writes the tag without digest |
ROTOCMD_DOCKER |
docker |
Docker CLI to call (e.g. podman with a compose provider) |
ROTOCMD_ALLOW_INSECURE_URL |
— | 1 allows a plain-HTTP registry mirror |
ROTOSTUDIO_DEPLOY_DIR |
— | Instance to work on (like -i) |
Develop
git config core.hooksPath .githooks
deno task check # fmt, lint, type check, tests
tests/install_sh_test.sh # install.sh against a local registry
scripts/check-naming.sh # the old app name only on legacy lines (D006)
deno task compile # dist/rotocmd
Releases: see docs/ci.md. Decisions: docs/decisions.md.
License: FSL-1.1-ALv2.