Mikael Lirbank
Mikael Lirbank16mo ago

Is there a way to run `npx convex

Is there a way to run npx convex deploy but for dev? I want to sync my local code (schema) with my Convex dev env, and then run some npx convex run xyz which deplends on the schema change. Alternatively can I somehow run convex dev but exit once the schemas have been synced? Eg. since convex dev is kept alive, it won't work for scripting. 1. CLI: Sync schema.ts 2. CLI: Run function which depends on the new schema 3. Exit
6 Replies
Mikael Lirbank
Mikael LirbankOP16mo ago
Oh, I think I know! npx convex run --push 🤘
Mikael Lirbank
Mikael LirbankOP16mo ago
@Indy @ian FYI The changes in https://news.convex.dev/announcing-convex-1-4/ are not reflected in the main docs https://docs.convex.dev/cli#run-convex-functions
Convex News
Announcing Convex 1.4
Convex 1.4 introduces a new option to install packages used in your Node action environment on the server, a variety of logging improvements, a new option to pause deployments, a new npm create convex command and more! External packages in Node.js Before 1.4, several NPM dependencies were
CLI | Convex Developer Hub
The Convex command-line interface (CLI) is your interface for managing Convex
No description
sshader
sshader16mo ago
I think npx convex dev --once / npx convex dev --once --run xyz might also work
Michal Srb
Michal Srb16mo ago
Fixing the docs, thanks!
Mikael Lirbank
Mikael LirbankOP16mo ago
That's great! Got it working now 🙏
ian
ian16mo ago
npx convex run used to sync by default, now you need to pass --push. Thanks for pointing out the docs discrpency 🙏

Did you find this page helpful?