Skip to content

npx convex dev --local flag is ignored if not first time #70

@thomasballinger

Description

@thomasballinger

We need to decide whether --local is

  1. a flag you can use with convex dev and some other commands to conveniently switch without needing to run a separate --config command. In the extreme, convex import --local, convex run --local, etc. all work and immediately provision you a local deployment if you don't have one.
  2. a flag only used with --config
  3. a flag only used with --config or when --config is implied for initial setup as a synonym for --dev-deployment=local. This makes npx convex dev --local work if it's the first time running, but not work the second time.
  4. nothing, it's deprecated, it says "use --dev-deployment=local"

3 is what works today, but --local is not disallowed in other situations: it just silently doesn't work.

The way to switch to a local deployment today is convex --configure which starts you all over choosing your team again, or typing out npx convex dev --configure=existing --team thomasballinger --project just-a-counter-app --dev-deployment local. This sucks! This is what --local and --cloud were for: quickly saying "yeah I'm obv not changing the project, I just want a local deployment!" Changing between prod and preview and local and dev should be easier than changing which project a repo is associated with.

The interactive convex dev --configure doesn't tell you if you have an existing cloud or locally-available local deployment, that or a convex deployments command might be a good start. We can also use a way to specify which deployment to do things other than dev with: only dev modifies the .env.local file to permanently point to a different deployment, but convex export --local would not be expected to do this. Today things like export just work on the current dev deployment by default.

It's reasonable to have multiple local deployments, importing data from this local deployment and exporting it to this other one. This isn't doable at all, you can't do it with a quick --local=this-one flag and you can't even permanently switching from one to the other; only a single local deployment is addressable.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions