Skip to content
Dashboard

Configuration commands

Copy page
View as Markdown

These commands change how a service runs. Typing grayspar env or grayspar volume alone runs its list command. Setting or removing a variable, and adding or removing a volume, redeploy the service by themselves.

List the names of a service’s variables.

Terminal window
grayspar env list [flags]
Flag Description
-s, --service <name> Which service to read.

Set variables on a service.

Terminal window
grayspar env set [flags] <pairs...>
Argument Description
pairs Variables written as KEY=VALUE.
Flag Description
-s, --service <name> Which service to set them on.
Terminal window
grayspar env set STRIPE_KEY=sk_test_123 LOG_LEVEL=debug --service api

Remove variables from a service.

Terminal window
grayspar env remove [flags] <keys...>
Argument Description
keys The names of the variables to remove.
Flag Description
-s, --service <name> Which service to change.
Terminal window
grayspar env remove LOG_LEVEL --service api

List the volumes of a project.

Terminal window
grayspar volume list [flags]
Flag Description
-s, --service <name> Which service to read.

Add a volume to a service.

Terminal window
grayspar volume add [flags] <path>
Argument Description
path The folder inside the service to keep, such as /app/data.
Flag Description
-s, --service <name> Which service keeps it.
Terminal window
grayspar volume add /app/data --service api

Delete a volume and its data.

Terminal window
grayspar volume remove [flags] <path>
Argument Description
path A folder the service keeps.
Flag Description
-s, --service <name> Which service keeps it.
-y, --yes Remove it without asking.

This command deletes the volume’s data, and it needs the owner role.

Terminal window
grayspar volume remove /app/data --yes

Change a service’s path, name or Dockerfile.

Terminal window
grayspar service set [flags] [name]
Argument Description
name The service to change, left out when the project has one.
Flag Description
--path <path> Where the service answers at the project address.
--no-path Reach the service only from the project’s other services.
--name <name> A new name for the service.
--dockerfile <path> Build from this Dockerfile, from the root of the project.
--no-dockerfile Build the way Grayspar found the service again.

A change to a path or a name applies at once. A change to a Dockerfile applies at the next deploy.

Terminal window
grayspar service set api --path /v2
grayspar service set worker --no-path
grayspar service set api --name backend
grayspar service set api --dockerfile docker/api.Dockerfile

Remove a service with its volume and variables.

Terminal window
grayspar service remove [flags] <name>
Argument Description
name The service to remove.
Flag Description
-y, --yes Remove it without asking.

This command stops the service and deletes its volume and variables, and it needs the owner role. A project keeps at least one service, so removing the last one means removing the project. A later deploy that finds the service’s folder again makes a new service.

Terminal window
grayspar service remove worker --yes