Convex CLI
$ convex Official Med RiskConvex CLI drives local and production workflows for Convex's reactive TypeScript database/backend. Supports convex dev --once for single-shot Agent codegen/typecheck loops, convex deploy --dry-run, convex data, and convex run.
npm install convex npx convex dev --once and convex deploy --dry-run are indispensable in coding loops for TypeScript typecheck/codegen; Convex MCP assists with live table/log inspection.
Agent-Readiness Checklist
Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.
FCRS-1.0 6-Dimension Breakdown
dev --once, --typecheck enable, deploy --dry-run, and JSON arguments in convex run fit coding-agent loops well.
- Supports
dev --once,deploy --dry-run, andCONVEX_DEPLOY_KEY
Separates dev and --prod deployments explicitly and supports deploy --dry-run pre-flight validation.
--dry-runpreview on deploy and explicit--prodtargeting
Bundled directly with the convex npm package (npx convex) across macOS, Linux, and Windows.
- Zero extra install beyond project
convexnpm dependency
Handles schema sync, TypeScript codegen (convex/_generated), env vars, and function execution in one CLI.
- Single tool manages schema push, codegen, data inspection, and deployments
Maintained officially by Convex (get-convex/convex-backend) with active releases.
- Official
convexnpm package andget-convex/convex-backend
Clear CLI reference at docs.convex.dev/cli covering dev, deploy, and env workflows.
- Official CLI documentation at docs.convex.dev/cli
Security, Auth & Guardrails
Deploy keys passed via CONVEX_DEPLOY_KEY env var; local dev auth stored in ~/.convex/config.json and .env.local.
CLI (convex npm package) is Apache-2.0 open-source; Convex Cloud has a free tier and Pro plans.
# Convex CLI Agent Rules - Always pass `--once` to `npx convex dev` so it exits instead of blocking in watch mode. - Run `npx convex deploy --dry-run` before any production deployment. - Never pass `--prod` to `convex run` or `convex env set` without explicit user approval.
Agent-Ready Command Recipes
Safe Read-Only Queries
npx convex dev --once --typecheck enable
Pushes to dev deployment, runs TypeScript checks, and exits cleanly without staying in watch mode.
--dry-run npx convex deploy --dry-run
Checks TypeScript compilation and prints the deployment profile without applying cloud changes.
Controlled Writes & Previews
npx convex run tasks:list '{"limit": 10}' Runs a single backend function with JSON arguments and exits.
Strengths for Agents
- +
npx convex dev --oncelets agents validate schemas and regenerate TypeScript types without hanging in a file watcher. - +
npx convex deploy --dry-runverifies production builds safely before release. - + Clean separation between dev deployments and
--prodflags.
Caveats & Pitfalls
- ! Running
npx convex devwithout--oncestarts a persistent watch loop that will block agents. - ! First-time project initialization prompts interactively unless
.env.localorCONVEX_DEPLOY_KEYis configured.