CLI Reference

Complete reference for the sf command-line tool. Use the search box to filter commands by name or description.

Stack Commands

sf stack create <name> [--entrypoint <service>]
Create a new stack blueprint
sf stack create myapp --entrypoint frontend
sf stack add <stack> <service> --image <img> --tag <tag> [options]
Add a service to a stack. Options: --depends-on, --min-instances, --max-instances, --volume, --env
sf stack add myapp api --image myapi --tag latest --depends-on db
sf stack remove <stack> <service>
Remove a service from a stack
sf stack remove myapp api
sf stack list [-r <regex>]
List all stacks, optionally filtered by regex
sf stack list -r "^myapp"
sf stack get <name> [--output json|yaml]
Get stack details
sf stack get myapp --output yaml
sf stack delete <name> [--force]
Delete a stack
sf stack delete myapp --force
sf stack output <stack> [variant] [--role <role>] [--watch]
View console output from stack instances
sf stack output myapp prod --role api --watch
sf stack kill <stack> [variant] [--role <role>]
Kill running instances of a stack
sf stack kill myapp dev --role frontend

Variant Commands

sf variant create <stack> <name> [options]
Create a variant. Options: --base, --override, --use, --label, --env
sf variant create myapp pr-42 --base dev --override frontend.tag=pr-42
sf variant list [<stack>]
List variants, optionally for a specific stack
sf variant list myapp
sf variant get <stack>/<name> [--output json|yaml]
Get variant details
sf variant get myapp/prod --output json
sf variant delete <stack>/<name> [--force]
Delete a variant
sf variant delete myapp/pr-42 --force

Alias Commands

sf alias add <domain> --stack <stack> --service <service> [--variant <variant>]
Add a custom domain alias
sf alias add www.myapp.com --stack prod --service frontend
sf alias list [--stack <stack>]
List aliases
sf alias list --stack prod
sf alias get <domain>
Get alias details
sf alias get www.myapp.com
sf alias delete <domain> [--force]
Delete an alias
sf alias delete www.myapp.com --force

Image Commands

sf image build --context <path>
Build an image from a Dockerfile context
sf image build --context apps/nodetest
sf image run [options] --context <path>
Run an image. Options: --hypervisor, --interactive, --command
sf image run --hypervisor firecracker --interactive --context apps/nodetest
sf image shell --context <path> [--persist]
Open a shell in an image for debugging
sf image shell --context apps/nodetest --persist
sf image push --context <path>
Push an image to the registry
sf image push --context apps/nodetest
sf image pull <name>:<tag>
Pull an image from the registry
sf image pull nodetest:latest
sf image list
List local images
sf image list
sf image cp <src> <dst> --context <path>
Copy files to/from an image (: prefix = guest path)
sf image cp /tmp/file.txt :/app/file.txt --context apps/nodetest

Volume Commands

sf volume create <name> <mount_path> --size <size> [--access-mode rwo|rwx|rox] [--provider image|disk]
Create a persistent volume
sf volume create mydata /data --size 1G
sf volume list [-r <regex>]
List volumes
sf volume list -r "^db-"
sf volume resize <name> <new_size>
Resize a volume (image provider only)
sf volume resize mydata 2G
sf volume delete <name> [--force]
Delete a volume
sf volume delete mydata --force
sf volume mount <name> <local_path>
Mount a volume locally for debugging
sf volume mount mydata /mnt/local
sf volume umount <name>
Unmount a locally mounted volume
sf volume umount mydata
sf volume snapshot create <volume> --name <snapshot_name>
Create a snapshot of a volume
sf volume snapshot create mydata --name backup-1
sf volume snapshot list [<volume>]
List volume snapshots
sf volume snapshot list mydata
sf volume snapshot restore <snapshot> --name <new_volume> --path <path>
Restore a volume from a snapshot
sf volume snapshot restore backup-1 --name mydata-clone --path /data

Instance Commands

sf instance list [--dc <dc>]
List running instances
sf instance list --dc dc1
sf instance start <image>:<tag> --dc <dc> [--count <n>] [--output]
Start new instances
sf instance start nodetest:latest --dc dc1 --count 2 --output
sf instance stop <image>:<tag> --dc <dc> [--timeout <seconds>]
Stop instances
sf instance stop nodetest:latest --dc dc1 --timeout 30
sf instance output <vm_id>
Stream console output from an instance
sf instance output 42
sf instance kill <vm_id>
Kill a running instance
sf instance kill 42
sf instance exec <vm_id> [--dir <dir>] [--timeout <seconds>] -- <command>
Execute a command inside a running VM
sf instance exec 42 -- cat /etc/resolv.conf
sf instance snapshot <vm_id> --name <name>
Create a VM snapshot (includes GPU memory)
sf instance snapshot 42 --name warm-python

Pool Commands

sf pool create <name> --image <image>:<tag> --min-warm <n> --max-warm <n>
Create a warm pool of pre-started VMs
sf pool create node-pool --image node22:latest --min-warm 3 --max-warm 10
sf pool list [-r <regex>]
List pools
sf pool list -r "^node-"
sf pool get <name>
Get pool details
sf pool get node-pool
sf pool delete <name> [--force]
Delete a pool
sf pool delete node-pool --force

CAS Commands

sf cas status
Show CAS storage status
sf cas status
sf cas list [--long]
List blobs in CAS
sf cas list --long
sf cas list-referenced
List referenced blobs
sf cas list-referenced
sf cas list-orphaned
List orphaned blobs
sf cas list-orphaned
sf cas cleanup [--dry-run]
Clean up orphaned blobs
sf cas cleanup --dry-run
sf cas delete <repo> [<tag>]
Delete a tag or all tags for a repository
sf cas delete apps/nodetest latest

Service Commands

sf service list [-r <regex>]
List all services from all stacks
sf service list -r "^api\."
sf service get <role>.<stack>
Get service details
sf service get web.myapp
sf service output <role>.<stack>
View console output from service instances
sf service output web.myapp
sf service kill <role>.<stack>
Kill all instances of a service
sf service kill web.myapp
sf service scale <role>.<stack> --count <n>
Manually scale a service
sf service scale web.myapp --count 3

Organization Commands

sf org create <name>
Create a new organization
sf org create mycompany
sf org list
List organizations
sf org list
sf org get <name>
Get organization details
sf org get mycompany
sf org delete <name>
Delete an organization
sf org delete mycompany
sf org use <name>
Set current organization in config
sf org use mycompany

Project Commands

sf project create <name>
Create a new project
sf project create myproject
sf project list
List projects
sf project list
sf project get <name>
Get project details
sf project get myproject
sf project delete <name>
Delete a project
sf project delete myproject
sf project use <name>
Set current project in config
sf project use myproject
sf project current
Show current project
sf project current

Stage Commands

sf stage create <name>
Create a new stage in current project
sf stage create production
sf stage list
List stages in current project
sf stage list
sf stage get <name>
Get stage details
sf stage get production
sf stage delete <name>
Delete a stage (by name or regex pattern)
sf stage delete staging
sf stage set-default <name>
Set default stage for current project
sf stage set-default production
sf stage current
Show current default stage
sf stage current

Snapshot Commands

sf snapshot <image> [--context <path>] [--id <id>]
Snapshot a distro or app
sf snapshot library/ubuntu:latest --context .
sf restore [--id <id>]
Restore a distro or app from snapshot
sf restore --id 2

Config Commands

sf config show
Show current configuration context
sf config show
sf config path
Show config file path
sf config path

Node Commands

sf node list
List all nodes in cluster
sf node list
sf node info <node>
Show node details
sf node info worker1
sf node remove <node>
Remove a node from cluster
sf node remove worker1
sf node get <key>
Get a node config value (with cluster fallback)
sf node get max_vms
sf node set <key> <value>
Set a node config value
sf node set max_vms 100
sf node del <key>
Delete (unset) a node config value
sf node del max_vms
sf node config
Show full node configuration
sf node config

Cluster Commands

sf cluster status
Show cluster status and info
sf cluster status
sf cluster init
Initialize cluster (usually automatic)
sf cluster init
sf cluster get <key>
Get a config value
sf cluster get default_hypervisor
sf cluster set <key> <value>
Set a config value
sf cluster set default_hypervisor firecracker
sf cluster del <key>
Delete (unset) a config value
sf cluster del default_hypervisor
sf cluster config
Show all cluster configuration as JSON
sf cluster config

Kernel Commands

sf kernel push <path>
Push kernel images to OCI registry
sf kernel push ./vmlinux
sf kernel pull <name>
Pull kernel images from OCI registry
sf kernel pull default

Initramfs Commands

sf initramfs push <path>
Push initramfs to OCI registry
sf initramfs push ./initramfs.cpio
sf initramfs pull <name>
Pull initramfs from OCI registry
sf initramfs pull default

Storage Class Commands

sf storage-class create <name> [options]
Create a new storage class
sf storage-class create fast-ssd --provider disk
sf storage-class list
List storage classes
sf storage-class list
sf storage-class get <name>
Get a storage class
sf storage-class get fast-ssd
sf storage-class delete <name>
Delete a storage class
sf storage-class delete fast-ssd

Assignment Commands

sf assignment list
List all service assignments
sf assignment list
sf assignment get <id>
Get details of a specific assignment
sf assignment get abc123
sf assignment delete <id>
Delete an assignment (will be recreated by scheduler if service still exists)
sf assignment delete abc123
sf assignment reset <id>
Reset an assignment to pending status (useful for debugging)
sf assignment reset abc123
sf assignment output <id>
View console output for an assignment (captured on failure)
sf assignment output abc123

Endpoint Commands

sf endpoint list
List all registered endpoints
sf endpoint list
sf endpoint get <id>
Get details of a specific endpoint
sf endpoint get frontend.prod
sf endpoint delete <id>
Delete an endpoint (for cleanup)
sf endpoint delete frontend.prod

VM Snapshot Commands

sf vm-snapshot list
List all VM snapshots
sf vm-snapshot list
sf vm-snapshot get <name>
Show details of a VM snapshot
sf vm-snapshot get warm-python
sf vm-snapshot delete <name>
Delete a VM snapshot
sf vm-snapshot delete warm-python

Resolve Commands

sf resolve show <stack>/<variant>/<role>
Resolve a stack/variant/role to see final configuration
sf resolve show myapp/prod/web

Other Commands

sf env set <KEY>=<VALUE> [--match <field>=<value>]...
Set environment variable with label-based selectors
sf env set DATABASE_URL="postgres://db/app" --match stack=myapp --match variant=prod
sf env list [--match <field>=<value>]
List environment variables
sf env list --match stack=myapp
sf cleanup
Clean stale TAP devices, port forwards, etc.
sf cleanup
sf completions <shell> --install
Install shell completions (bash, zsh, fish)
sf completions bash --install
sf ops list [--watch] [--kind <kind>] [--status <status>]
List operations (scale, create volume, etc.)
sf ops list --watch
sf events list [--watch] [--kind <kind>]
List resource events (audit log)
sf events list --kind WorkloadAssignment
sf edgelet --dc <dc> --node <node>
Run edgelet worker
sf edgelet --dc dc1 --node worker1