Brewless Brewless Docs

Command line

Commands

Every command of the Brewless command line client, with its arguments and options.

On this page

Every command that works on an environment takes the name of the environment as its first argument, such as production. Commands read brewless.yml in the current directory to know which application they are about.

Project

login

Sign this machine in to an organisation. See Signing in.

brewless login [organisation] [--no-browser]

logout

Forget this machine's sign-in to an organisation.

brewless logout <organisation>

init

Connect this project to an application at Brewless, write brewless.yml, add the environments the application should have and set them up.

brewless init [--organisation=] [--application=] [--name=] [--project=] [--share-project=] [--project-name=] [--framework=] [--php=] [--environments=] [--region=]
              [--database=] [--database-resource=] [--queue=] [--bucket] [--mail=] [--edge-cache=] [--from-vapor] [--yes] [--force]

For a new application, with several Scaleway projects connected, init asks which one it runs with; --project= names it, by its name or its ID, so nothing is asked. With one project connected nothing is asked. The choice holds for every environment of the application; see Several Scaleway projects. When that key may make projects, init asks where its Scaleway project comes from: one of its own, or the project of an application that has one, to share a database, a cache or a mail domain with it. For a project of its own it asks a name, such as websites when more applications will share it; empty, it is named after the application. --share-project= names the application to share with by its slug, --project-name= the name, so nothing is asked; without a terminal and without either, the application gets a project of its own named after it. init waits for a new project and names it. When it could not be made, init says why and goes on; setting up the first environment tries again.

After the application, init asks:

  1. which environments to add, production and staging unless you pick otherwise, and in which region;
  2. for each one, which database: a new Serverless SQL Database, one that stands in the application's Scaleway project already, or none;
  3. where its jobs wait: in that database, in a queue at Scaleway Queues, or nowhere;
  4. whether it gets a private bucket for its files;
  5. for production, which mailer it sends with (--mail=scaleway, lettermint or false);
  6. for a Laravel application, once for every new environment, how long the edge may keep its public pages: an hour (the default), a day, or not at all. It is written into brewless.yml as edge.cache; --edge-cache=1h, 1d, 30m, a number of seconds or 0 says it without a question, and a script that says nothing gets 1h. When composer.lock holds brewless/laravel older than 0.18, init says how to update it, so guests get no session cookie. See Edge cache.

It then says what that comes to and, after one yes, makes it in your own accounts. Say no and it prints the brewless provision line that does the same later. What each choice makes is described under Setting an environment up.

Without Scaleway connected the environments are added and nothing is asked; connect it and run brewless provision. Run without a terminal, init adds the environments --environments= names and sets them up only with --yes.

With a vapor.yml in the project, init offers to start from it. It writes a brewless.yml with every environment of vapor.yml and each setting Brewless has a key for, such as memory, timeouts, queues, the scheduler, build steps, deploy hooks as release commands, the database, the bucket and the domains, and prints once what it could not carry over. It then sets each environment you add up with a new database, a queue at Scaleway Queues and a bucket where Vapor had one. Nothing at Vapor or AWS is read or changed. Your variables, the data in your databases and the files in your buckets are yours to move; init lists them at the end, with a brewless domain:add line for every domain. See Moving from Laravel Vapor.

Option What it does
--organisation= The organisation the application belongs to
--application= The slug of an application that exists already
--name= The name of a new application to create. Without a terminal, init needs this or --application=
--share-project= For a new application, when the key may make projects: the slug of an application whose Scaleway project it shares
--project-name= For a new application, when the key may make projects: the name of its Scaleway project of its own
--framework= laravel, laravel-rust, symfony or generic; detected from composer.json when left out, or from a laravel-rust dependency in Cargo.toml (CLI 1.8.0 or later, see Laravel for Rust)
--php= The PHP version to build for, such as 8.4. See PHP version
--environments= The environments to add, such as production,staging; none adds none
--region= Where new environments stand. See Regions
--database= For every new environment: new, existing or none
--database-resource= The name of the existing database to use
--queue= For every new environment: database, sqs or none
--bucket Make a private bucket for the files of every new environment
--from-vapor Start from the vapor.yml of this project without asking
--yes Set the new environments up without asking first
--force Overwrite an existing brewless.yml

Releases

deploy

Deploy the current commit to an environment. Without an environment it deploys to default-environment from brewless.yml. First it does what brewless.yml asks of the environment's resources: it makes the environment when it does not exist yet, sets it up, and adds a database, queue or bucket it is missing. It names the domains of the file the environment does not answer on yet and asks before it adds them. See Deployments.

brewless deploy [<environment>] [--domains]
Option What it does
--domains Add the domains of brewless.yml the environment does not answer on yet without asking. Without a terminal they are only added with this option

From a pipeline, see Deploying from a pipeline.

plan

Show what brewless.yml asks for next to what stands now, per environment: what is the same (=), what would change (~), what would be added (+), what stays because the file leaves it out (·), what a deploy would refuse (!, with why), what cannot be read (?), and advice about what stands (*, with the advice under it), such as a homepage the edge cannot keep. It changes nothing. When Brewless refuses the file, each reason comes with the line it is about. See brewless.yml.

brewless plan [<environment>]

service:push

Build a service of brewless.yml with Docker on this machine and put it live in an environment. Needs Docker. See Services.

brewless service:push <environment> <service>

releases

List the latest releases of an environment, with the times in this machine's zone (TZ, else the system's). For a release under way it also says which step it is at and what that step waits for.

brewless releases <environment>

cancel

Stop the release that is under way in an environment, after asking. A release that waits is cancelled at once; one at work on a step finishes that step first. What earlier steps did is not undone, and the release that is live stays live. See Deployments.

brewless cancel <environment> [--yes]
Option What it does
--yes Do not ask for confirmation

rollback

Put the image of an earlier release live again. See Rollbacks.

brewless rollback <environment> [--release=] [--force]
Option What it does
--release= The number of the release to put back; the one before the live one when left out
--force Do not ask for confirmation

Environment

db:failover

Switch an environment to the standby copy of its Managed Database, in another zone. It asks first, says what it does, and follows the release that puts the new address live. See A standby copy.

brewless db:failover <environment> [--force]
Option What it does
--force Do not ask for confirmation

db:capacity

Show the capacity of the environment's Serverless SQL Database: what Scaleway gives it now, the bounds it should have, its normal bounds, and its running and planned boosts. See Database capacity.

brewless db:capacity <environment> [--database=]

db:boost

Raise the database's capacity: now, for a while (--for), or planned (--at). It shows what that costs at Scaleway and asks first, then follows the change until the database has its minimum. A pipeline token may boost the databases of its own application only, within the limits of the environment's capacity key.

brewless db:boost <environment> --min= --max= (--for= | --until=) [--at=] [--prewarm=] [--cooldown=] [--name=] [--key=] [--database=] [--yes] [--no-wait]
Option What it does
--min=, --max= The vCPUs during the boost
--for= For how long from now, such as 90m or 2h
--at= When it starts, in this machine's time zone unless it has an offset
--until= When it ends: a time on the day of the start, or a date and time
--prewarm=, --cooldown= Minutes to warm up before and to cool down after; 15 and 30 for a planned boost
--key= Your own key for the boost, so a pipeline step can be sent again safely
--yes Do not ask for confirmation
--no-wait Return once the boost is sent

db:boost:extend, db:boost:cancel

Give a boost a later end, or cancel it: a boost that has not started is dropped, one that runs ends now and cools down.

brewless db:boost:extend <environment> <key> --until=
brewless db:boost:cancel <environment> <key> [--yes]

db:import

Copy a PostgreSQL or MySQL database, or a file pg_dump wrote, into the environment's database; MySQL into PostgreSQL is converted on the way. It never changes the source, and refuses a destination that holds tables unless --replace is given. It asks first and follows the copy. See Moving your database.

brewless db:import <environment> [<postgres|mysql>://<user>@<host>[:<port>]/<database>] [--file=] [--from-env=] [--replace] [--local] [--dry-run] [--no-follow] [--force]
Option What it does
--file= Copy from a pg_dump file on this machine instead of from a database; always runs here, in Docker
--from-env= Read the source's DB_* values from this .env file
--replace Remove what the destination holds first; on production you type the environment's name to confirm
--local Copy from this machine, in Docker, instead of a job in your Scaleway project
--dry-run Copy nothing; sign in to both databases and count what they hold
--no-follow Start the copy in your project and return
--force Do not ask for confirmation

db:import-status

Show the last copy into the environment's database, while it runs and after it ended.

brewless db:import-status <environment>

env:pull

Fetch an environment's variables from your own Secret Manager, through Brewless. With --direct, straight from your machine with a Scaleway key of your own. See Environment variables.

brewless env:pull <environment> [--file=] [--direct]

env:push

Write an environment's variables to your own Secret Manager, through Brewless or, with --direct, straight from your machine.

brewless env:push <environment> [--file=] [--force] [--direct]

provision

Make what a new environment needs in your own cloud accounts. See Setting an environment up.

brewless provision <environment> [--database=] [--database-resource=] [--queue=] [--bucket] [--no-database]

Without options, in a terminal, it asks what init asks for one environment. With an option, or run by a script, it asks nothing: what is left out is a new database, its jobs in that database and no bucket.

Option What it does
--database= new for a Serverless SQL Database, existing for one in your project, none
--database-resource= The name of the existing database to use
--queue= database, sqs for a queue at Scaleway Queues, or none
--bucket Make a private bucket for the files of the application
--no-database The same as --database=none

storage:import

Copy the files of a bucket at AWS, or at any other S3 service, into the environment's bucket. It never removes anything, and a file that is there already is left alone. It asks first and follows the copy. See Moving your files from S3.

brewless storage:import <environment> [s3://<bucket>[/<folder>]] [--from-env=] [--source-profile=] [--source-region=] [--source-endpoint=] [--source-path-style] [--local] [--dry-run] [--no-follow] [--force]
Option What it does
--from-env= Read the source's AWS_* values from this .env file
--source-profile= Take the key and region of this profile of the AWS CLI
--source-region= The region of the source bucket; at AWS it is looked up when left out
--source-endpoint= The endpoint of an S3 service other than AWS
--source-path-style Address the source bucket in the path instead of the host name
--local Copy from this machine instead of a job in your Scaleway project
--dry-run Copy nothing; count what the source holds
--no-follow Start the copy in your project and return
--force Do not ask for confirmation

The source's key comes from SOURCE_AWS_ACCESS_KEY_ID and SOURCE_AWS_SECRET_ACCESS_KEY, --source-profile or --from-env, or is asked for.

storage:status

Show the last copy into the environment's bucket: how far it got while it runs, what it came to after.

brewless storage:status <environment>

domain:add

Make an environment answer on a domain of your own, with a certificate. It says when it took over the domain's DNS zone, and when your application still calls the provider's address its own it offers to set APP_URL to the domain; only after a yes, for the next deploy. See Domains and Moving your domain to Brewless.

brewless domain:add <environment> <hostname>

When the domain's DNS is kept at a provider of your own, domain:add finishes with the record to make there, and Brewless looks it up by itself; see DNS at a provider of your own.

domain:list, domain:check

domain:list lists the domains of an environment with their state and, for a domain whose DNS you keep yourself, the record to make and what Brewless last found, and then the DNS records mail needs when its zone is kept elsewhere too. domain:check looks the record of one domain up now, also for a domain Brewless stopped waiting for; once a minute per domain.

brewless domain:list <environment>
brewless domain:check <environment> <hostname>

mail:records

mail:records lists every DNS record the domain an environment sends mail from needs, at Transactional Email or at Lettermint: the type, the name and the whole value, and whether the mailer found it. --check has the mailer look them up now, and then every quarter of an hour for two hours, or until it found them all; once a minute. See Mail.

brewless mail:records <environment>
brewless mail:records <environment> --check

dns:list, dns:add, dns:update, dns:remove

Read and change the records of a DNS zone Brewless manages, at Bunny DNS or Scaleway DNS. dns:list without a zone lists the zones with the provider each lives at; with one it lists the records and their ids (a number at Bunny DNS, a UUID at Scaleway DNS). dns:remove asks first; with --no-interaction it fails unless you pass --force. See DNS records.

brewless dns:list [<zone>]
brewless dns:add <zone> <type> <name> <value> [--ttl=] [--priority=] [--weight=] [--port=] [--flags=] [--tag=]
brewless dns:update <zone> <id> [--type=] [--name=] [--value=] [--ttl=] [--priority=] [--weight=] [--port=] [--flags=] [--tag=]
brewless dns:remove <zone> <id> [--force]

scale

Set between how many replicas your provider scales an environment. See Scaling.

brewless scale <environment> [--min=] [--max=]

edge:rotate-secret

Replace the secret with which the edge proves to your containers that a request came through it. Your containers hold the new secret and the one before it until the edge has moved over, so your site keeps answering; it takes two releases of the image that is live. See The edge secret.

brewless edge:rotate-secret <environment> [--force]

edge:rotate-origin-token

Replace the token with which the edge is let in to a private web container (edge.private_origin). The new token works before the edge sends it, and the old one is deleted only after, so your site keeps answering; no release is needed. Needs CLI 1.7. See Replacing the token.

brewless edge:rotate-origin-token <environment> [--force]

command

Run one console command in an environment and show what it prints. See Commands.

brewless command <environment> <line> [--force]

tinker

Run a line of PHP in an environment with tinker and show what it prints. Needs CLI 1.6 and brewless/laravel 1.11.1 or later. See A line of PHP.

brewless tinker <environment> <code> [--force]

wakes

List the addresses that reached the web container over the last 24 hours: the requests the edge did not answer itself, most first, with the cache status bunny.net logged. Read from the request log of the environment's pull zone; see Scaling.

brewless wakes <environment>

logs

Show the logs of an environment, read live from your provider. See Logs.

brewless logs <environment> [--tail] [--range=] [--search=] [--source=]

Backups

The commands for backups by Brewless. They need version 1.9 of the client or later.

backup:status

Show the backups of an environment: the last run, how well it is protected, the schedule, and what is backed up where.

brewless backup:status <environment>

backup:list

List the recovery points of an environment, newest first.

brewless backup:list <environment>

backup:run

Back an environment up now. The backup runs in your own Scaleway account, like a scheduled one.

brewless backup:run <environment> [--wait]
Option What it does
--wait Follow the run until it ends

backup:restore

Restore a database or a bucket from a backup, into a new database or bucket unless you say otherwise. See Restoring from backups.

brewless backup:restore <environment> [--database=] [--bucket=] [--path=*] [--point=] [--to=new] [--prefix=] [--region=] [--force=]
Option What it does
--database= The database to restore
--bucket= The bucket to restore
--path= Only these files or folders of the bucket; repeat it for more
--point= The recovery point (see backup:list); the newest when left out
--to= new (the default): a new database or bucket. The name of the environment's own database writes over it, after you confirm that it is you
--prefix= With --path and --to=<the bucket itself>: the folder in that bucket to restore the files under
--region= The region of the new database or bucket; that of the environment when left out
--force= Write over the database without asking; give its name

backup:download

Download a database as a .sql.zst dump, or one file of a bucket, through a link into a bucket of your own.

brewless backup:download <environment> [--database=] [--path=] [--bucket=] [--point=] [--output=] [--link]
Option What it does
--database= A database
--path= One file of a bucket, by its key
--bucket= The bucket of --path, when the environment has more than one
--point= The recovery point; the newest when left out
--output= Where to save it; by default its own name in this folder
--link Only print the link, do not download

backup:kit

Download the Recovery Kit: everything needed to restore without Brewless, except the recovery key.

brewless backup:kit <environment> [--output=]
Option What it does
--output= The zip to write. Default: recovery-kit-<environment>.zip

backup:recovery-key

Make a new recovery key. The runner makes it in your account and encrypts it for this machine; it is shown once, here, and Brewless never knows it. Once you have stored it, the previous recovery key stops working.

brewless backup:recovery-key <environment>

backup:destination:add, backup:destination:list, backup:destination:test

Add a second destination for the backups of every environment, list them, or test one from your own account. add asks for the access key and the secret key and puts them in your Secret Manager.

brewless backup:destination:add <name> [--kind=s3] [--endpoint=] [--region=] [--bucket=] [--prefix=] [--path-style] [--no-tls-verify] [--object-lock]
brewless backup:destination:list
brewless backup:destination:test <name>
Option What it does
--kind= s3 (any S3-compatible service, the default), bunny or scaleway (a bucket in another Scaleway account)
--endpoint= The S3 endpoint, https://…
--region= The region of the bucket
--bucket= The bucket
--prefix= A folder in the bucket; by default the application and environment
--path-style Address the bucket in the path rather than the host name
--no-tls-verify Do not check the endpoint's certificate
--object-lock The bucket has Object Lock on

Leaving

export

Write everything Brewless knows about an environment to a folder, with Terraform and without the value of any secret. See Leaving Brewless.

brewless export <environment> [--output=]
Option What it does
--output= The folder to write to. Default: brewless-export-<application>-<environment>

detach

Stop Brewless managing an environment. Everything keeps running in your own accounts. See Leaving Brewless.

brewless detach <environment> [--output=] [--force]
Option What it does
--output= The folder for the last export
--force Do not ask for confirmation