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.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/get-convex/convex-backend/llms.txt
Use this file to discover all available pages before exploring further.
Installation
The Convex CLI is available through theconvex npm package:
npx:
Available commands
Development
convex dev- Develop against a deployment, watching for changesconvex deploy- Deploy to your production deploymentconvex run- Run a Convex function from the command line
Data management
convex import- Import data from a file to your deploymentconvex export- Export data from your deployment to a ZIP fileconvex data- List tables and print data from your database
Environment variables
convex env set- Set environment variables on your deploymentconvex env get- Print an environment variable’s valueconvex env list- List all environment variablesconvex env remove- Unset an environment variable
Utilities
convex dashboard- Open the Convex dashboard in your browserconvex logs- Stream logs from your Convex functionsconvex docs- Open Convex documentationconvex login- Log in to your Convex accountconvex 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:Target this project’s production deployment instead of the dev deployment.
Target the preview deployment with the given name.
Target the deployment at the given URL. Use with self-hosted deployments or to specify a deployment directly.
Admin key for authentication when using
--url.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 useCONVEX_DEPLOY_KEY- Deploy key for CI/CD deploymentsCONVEX_URL- Self-hosted deployment URLCONVEX_ADMIN_KEY- Self-hosted admin keyHTTPS_PROXY/HTTP_PROXY- HTTP proxy for requests
Global options
Most commands support these global options:Show full listing of changes and detailed output.
Display help information for the command.
Display the CLI version.