Commands that take a resource ID accept it as an argument, e.g.
shardcloud app restart <id>. If you omit the ID and the current directory is
linked to that resource type, the CLI uses the
linked resource. If neither is given, the command fails with a clear error
— unlike v1, there is no interactive selection menu to pick from your
resources.Linking a Directory
A link ties the current directory to one existing app, database, or VM, so you can omit the ID on every subsequent command run from that directory. It’s stored in a.shardcloud.json file:
.shardcloud.json (the directory link) is separate from .shardcloud (the
app’s own build/deploy config file) — linking a directory doesn’t touch
your .shardcloud file, and vice versa.shardcloud app create auto-links the directory it’s run from to the newly created app, the same way v1’s create did — you don’t need to run shardcloud link yourself right after creating an app. Databases and VMs have no creation-time side effect to piggyback a link off of (databases are created with db create, VMs only from the dashboard), so link those with shardcloud link <id> --type database / --type vm after the fact if you want to omit their ID from a directory.
auth / config
See Authentication for auth login / auth logout / auth whoami and config profile *. config set <key> <value> sets a free-form CLI setting — currently used for api_url, to point the CLI at a different API base URL:
app
app has an apps alias — shardcloud apps list works the same as shardcloud app list.Create
create always writes a .shardcloud.json link to the current directory pointing at the new app, whichever path you use.
Deploys
Env
env set merges into the app’s existing variables — it doesn’t wipe ones you don’t mention. All env subcommands accept --app <id> in place of a positional ID/link.
Exec
db
db has database/databases aliases.--type accepts postgres, mysql, mongo, or redis.
vm
vm has a vms alias. shardcloud vm create does not exist. VMs are
created from the web dashboard only — creating one starts a real recurring
subscription charge, so the CLI deliberately doesn’t expose a way to
trigger that. Every other vm command works once a VM exists.backup
Generic across apps, databases, and VMs — the same commands work for all three resource types, since it’s one backup API underneath.
--target-database is only relevant when backing up/restoring a database resource. download without -o/--output prints the backup’s download URL instead of saving it.
lb
Load balancers require a Pro or Enterprise plan. Creating one, or
claiming a domain for one, on a lower plan fails with a plan-tier error.
lb (and its aliases loadbalancer/loadbalancers) has no domain or error-page subcommands — claiming a custom domain for a load balancer is done from the web dashboard, not the CLI.
image
Custom Docker images: build them from a directory or zip, then deploy them as apps.
--context accepts either a directory (zipped Docker-context-aware, honoring .dockerignore and keeping the Dockerfile) or a path to an existing .zip.