CLI
Qovery provides a very easy to use CLI (Command Line Interface) designed to fit the developer workflow perfectly.
The purpose of the CLI is to integrate seamlessly with your development workflow:
- Write code
- Commit
- Qovery - deploy a new version of your application
- Qovery CLI - check the status of your application
- Qovery CLI - debug your application
- Repeat
First usage
Install
- Linux
- MacOS
- Windows
- Docker
- *nix
- Arch Linux
- Manual
To download and install Qovery CLI on any Linux distribution:
$ curl -s https://get.qovery.com | bash
Sign up
# Sign up and sign in command$ qovery auth
Your browser window with sign-in options will open.
Click here to authorize Qovery to clone and build your applications.
Congratulations, you are logged-in.
Help
You can see all the commands available by executing:
$ qovery help
$ qovery helpA Command-line Interface of the Qovery platformUsage:qovery [command]Available Commands:application Manage applicationsauth Log in to Qoverycompletion Generate the autocompletion script for the specified shellconsole Opens the application in Qovery Console in your browsercontainer Manage containerscontext Manage CLI contextcronjob Manage cronjobsdatabase Manage databasesenv Manage Environment Variables and Secretsenvironment Manage environmentshelp Help about any commandlifecycle Manage lifecycle jobslog Print your application logsservice Manage servicesshell Connect to an application containerstatus Print the status of your applicationtoken Generate an API tokenupgrade Upgrade Qovery CLI to latest versionversion Print installed version of the Qovery CLIFlags:-h, --help help for qoveryUse "qovery [command] --help" for more information about a command.
Context
Context command lets you configure the CLI to work with your chosen application. Before executing other commands, you need first to set up the context.
The context is then remembered and used by the CLI. You can configure a new context anytime by running the qovery context set
command.
Set New Context
To set a new context, type qovery context set
:
$ qovery context setQovery: Current context:Organization | QoveryProject | testEnvironment | developmentApplication | websiteQovery: Select new contextOrganization:✔ QoveryProject:✔ adminEnvironment:✔ mainApplication:✔ appQovery: New context:Organization | QoveryProject | adminEnvironment | mainApplication | app
Print Current Context
$ qovery contextQovery: Current context:Organization | QoveryProject | adminEnvironment | mainApplication | appQovery: You can set a new context using 'qovery context set'.
Log
Log command allows you to display the application logs.
$ qovery logTIME MESSAGEJul 15 08:46:13.019717 at /usr/src/app/autoFunctions/levels.js:17:16Jul 15 08:46:13.019721 at Array.forEach (<anonymous>)Jul 15 08:46:13.019724 at Timeout._onTimeout (/usr/src/app/autoFunctions/levels.js:15:14)Jul 15 08:46:13.019728 at listOnTimeout (internal/timers.js:557:17)# ... the rest of logs
By default, the last 1000 logs is displayed.
Follow Logs
To make the CLI follow your logs, use -f
flag:
$ qovery log -fTIME MESSAGEJul 15 08:46:13.019717 at /usr/src/app/autoFunctions/levels.js:17:16Jul 15 08:46:13.019721 at Array.forEach (<anonymous>)Jul 15 08:46:13.019724 at Timeout._onTimeout (/usr/src/app/autoFunctions/levels.js:15:14)Jul 15 08:46:13.019728 at listOnTimeout (internal/timers.js:557:17)# ... the rest of logs
This will make the CLI follow your application logs and append any new logs till you use CTRL+C
.
Status
Status command lets you print the basic status of your application.
$ qovery status15 Jul 21 10:55 CESTApplication | BackendStatus | RUNNING
Console
Console command quickly opens the Qovery Console in your browser to let you display more information about your application.
$ qovery consoleQovery: Opening https://console.qovery.com/platform/organization/your-org/projects/your-proj/environments/your-env/applications/your-app/summary
Shell
Shell command allows you to open a connection and execute commands directly on the container running application.
$ qovery shell/ # lsbin media srvdev mnt sysdocker-entrypoint.d opt tmpdocker-entrypoint.sh proc usretc root varhome run wwwlib sbin
Generate API token
To use the Qovery API you will need to generate an authentication token. To generate an API token you can install the CLI and type
$ qovery tokenQovery: Select organizationOrganization:✔ My OrganizationChoose a token nameToken name: RomaricChoose a token descriptionToken description: used for Github ActionsQovery: ---- Never share this authentication token and keep it secure ----Qovery: qov_4LnEg2wFxxxxxHObGSQ22rjBZZyyyySgyR6Y_2500882691Qovery: ---- Never share this authentication token and keep it secure ----
To use your token and list your organizations.
curl -X GET -H 'Authorization: Token qov_4LnEg2wFxxxxxHObGSQ22rjBZZyyyySgyR6Y_2500882691' https://api.qovery.com/organization
Check out our API documentation
Managing services and environments
The CLI allows you to manage and deploy the environment and services within your organization
### application, container, lifecycle, cronjob These commands allow you to manage all these services via the CLI. You can run the following actions on these services:
- cancel: Cancel the service deployment
- delete: Delete a service
- deploy: Deploy a service
- list: List the service of the specified type
- redeploy: Redeploy a service (already deployed before)
- stop: Stop a service
Each action allows you to specify additional parameters to define the service you want to modify (you can find them via the --help command)
Example: Listing applications and triggering a deployment
$ qovery application listName | Type | Status | Last Updatebackend | Application | STOPPED | 2023-02-02 14:48:05.339652 +0000 UTCfront-end | Application | STOPPED | 2023-02-09 14:04:38.079792 +0000 UTC$ qovery application deploy -n "backend"Deploying application backend in progress..$ qovery application listName | Type | Status | Last Updatebackend | Application | RUNNING | 2023-02-13 12:59:23.228231 +0000 UTCfront-end | Application | STOPPED | 2023-02-09 14:04:38.079792 +0000 UTC
Environment
The command environment
allow you to manage a specific environment via the CLI. You can run the following actions on environments:
- cancel: Cancel an environment deployment
- clone: Clone an environment
- delete: Delete an environment
- deploy: Deploy an environment
- list: List environments
- redeploy: Redeploy an environment
- stage: Manage deployment stages
- stop: Stop an environment
Each action allows you to specify additional parameters to define the service you want to modify (you can find them via the --help command)
Example: Manage deployment stages and triggering deployment
~ $ qovery environment stage list# deployment stage 1: "DATABASE DEFAULT"Rename me to avoid default/legacy orderingType | NameDATABASE | RedisDATABASE | DB# deployment stage 2: "JOB DEFAULT"Rename me to avoid default/legacy ordering<no service># deployment stage 3: "CONTAINER DEFAULT"Rename me to avoid default/legacy orderingType | NameCONTAINER | Rabbitmq# deployment stage 4: "APPLICATION DEFAULT"Rename me to avoid default/legacy orderingType | NameAPPLICATION | BackendAPPLICATION | FrontendAPPLICATION | Pablo Backend AppAPPLICATION | API gateway~ $ qovery environment deployEnvironment is deploying!
Managing the Deployment Pipeline
In the following sections we will describe how to modify the Deployment Pipeline.
List stages
You can list all the stages of your environment by using the following command:
qovery environment stage list
Add a stage
You can add a new stage by using the following command:
qovery environment stage create -n <name> -d <description>
Note that the stage will be added at the end of the pipeline (the highest number)
Modify a stage
You can modify a stage by using the following command:
qovery environment stage edit -n <original name> --new-name <new name> --new-description <new description>
Delete a stage
You can modify a stage by using the following command:
qovery environment stage delete -n <name>
Change stage for a service
You can modify the stage associated to a service by using the following command:
qovery environment stage move -n <service name> --stage <stage name>
Support
Do you have any issues with Qovery CLI? Open an issue.