Skip to main content
The Convex CLI provides a complete set of tools for developing, deploying, and managing your Convex backend. Use it to develop locally, push code to production, manage environment variables, and inspect your database.

Installation

The Convex CLI is available through the convex npm package:
npm install convex
Run commands using npx:
npx convex dev

Available commands

Development

  • convex dev - Develop against a deployment, watching for changes
  • convex deploy - Deploy to your production deployment
  • convex run - Run a Convex function from the command line

Data management

  • convex import - Import data from a file to your deployment
  • convex export - Export data from your deployment to a ZIP file
  • convex data - List tables and print data from your database

Environment variables

  • convex env set - Set environment variables on your deployment
  • convex env get - Print an environment variable’s value
  • convex env list - List all environment variables
  • convex env remove - Unset an environment variable

Utilities

  • convex dashboard - Open the Convex dashboard in your browser
  • convex logs - Stream logs from your Convex functions
  • convex docs - Open Convex documentation
  • convex login - Log in to your Convex account
  • convex logout - Log out from your Convex account

Requirements

  • Node.js version 18.0.0 or higher (recommended: Node.js 20.x or newer)
  • npm version 7.0.0 or higher

Deployment selection

Many commands support options to select which deployment to target:
--prod
boolean
Target this project’s production deployment instead of the dev deployment.
--preview-name
string
Target the preview deployment with the given name.
--url
string
Target the deployment at the given URL. Use with self-hosted deployments or to specify a deployment directly.
--admin-key
string
Admin key for authentication when using --url.
--env-file
string
Path to a custom file of environment variables for choosing the deployment (e.g., CONVEX_DEPLOYMENT or CONVEX_URL).

Environment variables

The CLI reads several environment variables to configure its behavior:
  • CONVEX_DEPLOYMENT - Deployment name to use
  • CONVEX_DEPLOY_KEY - Deploy key for CI/CD deployments
  • CONVEX_URL - Self-hosted deployment URL
  • CONVEX_ADMIN_KEY - Self-hosted admin key
  • HTTPS_PROXY / HTTP_PROXY - HTTP proxy for requests

Global options

Most commands support these global options:
-v, --verbose
boolean
Show full listing of changes and detailed output.
-h, --help
boolean
Display help information for the command.
--version
boolean
Display the CLI version.

Build docs developers (and LLMs) love