CLICommand referenceservice service
Commands, arguments, and options for openship service.
See the workflow guide for examples. Global flags such as --json go before the command; see global options.
Manage the services in a compose stack (a multi-service project)
openship service|services [options] [command]
List the stack's active-deployment containers
openship service containers [options]
| Option | Meaning |
|---|
-p, --project <id|slug|name> | Stack (project) id, slug, or name |
Add a service to a stack
openship service create [options] <name>
| Argument | Meaning |
|---|
name | Service name (unique within the stack) |
| Option | Meaning |
|---|
-p, --project <id|slug|name> | Stack (project) id, slug, or name |
--image <image> | Container image (e.g. postgres:16) |
--build <context> | Build context path (relative to repo root) |
--dockerfile <path> | Dockerfile path (relative to build context) |
--port <mapping> | Port mapping, e.g. 8080:80 (repeatable) (default: []) |
--depends-on <service> | Service this depends on (repeatable) (default: []) |
--env <KEY=VALUE> | Compose environment default (repeatable) (default: []) |
--command <command> | Override the container command |
--restart <policy> | Restart policy: no | always | on-failure | unless-stopped |
--expose | Expose the service publicly through managed routing |
--exposed-port <port> | Container port to expose publicly |
--domain <label> | Free subdomain label (with --expose) |
Remove a service from a stack
openship service delete|rm [options] <service>
| Argument | Meaning |
|---|
service | Service name or id |
| Option | Meaning |
|---|
-p, --project <id|slug|name> | Stack (project) id, slug, or name |
-y, --yes | Skip the confirmation prompt |
Resolve compose drift on a service (upstream compose changed a value you edited)
openship service drift [options] [command]
Apply the upstream compose values, discarding your edits
openship service drift accept [options] <service>
| Argument | Meaning |
|---|
service | Service name or id |
| Option | Meaning |
|---|
-p, --project <id|slug|name> | Stack (project) id, slug, or name |
Keep your edits and stop flagging the upstream change
openship service drift keep [options] <service>
| Argument | Meaning |
|---|
service | Service name or id |
| Option | Meaning |
|---|
-p, --project <id|slug|name> | Stack (project) id, slug, or name |
Read and write a service's environment variables
openship service env [options] [command]
List a service's environment variables (secrets masked)
openship service env get [options] <service>
| Argument | Meaning |
|---|
service | Service name or id |
| Option | Meaning |
|---|
-p, --project <id|slug|name> | Stack (project) id, slug, or name |
-e, --env <environment> | Environment: production | preview | development |
Set a service's environment variables for one environment
openship service env set [options] <service> <pairs...>
| Argument | Meaning |
|---|
service | Service name or id |
pairs | KEY=VALUE pairs |
| Option | Meaning |
|---|
-p, --project <id|slug|name> | Stack (project) id, slug, or name |
-e, --env <environment> | Environment: production | preview | development (default: "production") |
--secret | Mark the provided variables as secret |
--replace | Replace ALL variables for this environment with only the given pairs |
Run a shell command inside a service's isolated container
openship service exec [options] <service> <command>
| Argument | Meaning |
|---|
service | Service name or id |
command | Shell command (quote it as one argument) |
| Option | Meaning |
|---|
-p, --project <id|slug|name> | Stack (project) id, slug, or name |
--cwd <path> | Working directory inside the container |
--timeout <ms> | Command timeout in milliseconds (default: "30000") |
Show one service's configuration
openship service get [options] <service>
| Argument | Meaning |
|---|
service | Service name or id |
| Option | Meaning |
|---|
-p, --project <id|slug|name> | Stack (project) id, slug, or name |
List the services in a stack
openship service list [options]
| Option | Meaning |
|---|
-p, --project <id|slug|name> | Stack (project) id, slug, or name |
Show or stream a service's runtime logs
openship service logs [options] <service>
| Argument | Meaning |
|---|
service | Service name or id |
| Option | Meaning |
|---|
-p, --project <id|slug|name> | Stack (project) id, slug, or name |
-f, --follow | Stream new log lines as they arrive (SSE) |
--tail <n> | Number of lines to show from the end (default: "200") |
Bounce a service's container (does NOT apply changed env — use deploy --refresh for that)
openship service restart [options] <service>
| Argument | Meaning |
|---|
service | Service name or id |
| Option | Meaning |
|---|
-p, --project <id|slug|name> | Stack (project) id, slug, or name |
--force | Bounce even with pending env changes (they will NOT be applied) |
Start a service's container
openship service start [options] <service>
| Argument | Meaning |
|---|
service | Service name or id |
| Option | Meaning |
|---|
-p, --project <id|slug|name> | Stack (project) id, slug, or name |
Stop a service's container
openship service stop [options] <service>
| Argument | Meaning |
|---|
service | Service name or id |
| Option | Meaning |
|---|
-p, --project <id|slug|name> | Stack (project) id, slug, or name |
Sync a stack's services from a docker-compose file (services not in the file are removed)
openship service sync [options] <compose-file>
| Argument | Meaning |
|---|
compose-file | Path to docker-compose.yml / compose.yaml |
| Option | Meaning |
|---|
-p, --project <id|slug|name> | Stack (project) id, slug, or name |
-y, --yes | Skip the confirmation prompt |