Option for a module to use locally configured default org (as defined in .sf/config.json's target-org)

Issue #2490 open
Jonny Power (he/him) created an issue

With a project that houses many modules, we commonly rely on the sf cli's default org in tooling / scripts (e.g. org setup)

When creating an org, we often set as default within the context of the working directory with the --set-default cli option, and then have to modify the configuration in IC2 for the module afterwards.

Would be a great QoL upgrade if we could specify a special connection "DEFAULT" that would redirect to the cli's default configured target org for the current working directory (maybe most reliably obtained via sf config get target-org) - current process is to wait for scripts to complete, open the config.json file to see username, and manually update IC2's module config using the switcher in the IDE.

Comments (10)

  1. Scott Wells repo owner
    • changed status to open

    Hi, Jonny. I apologize but I'm not sure that I follow the request. IC2 already has an option to set the project's CLI default org to the one selected in IC2 for the project, but it sounds like you're asking for an option to use some other org as the default perhaps? Can you please elaborate a bit more on the request? Again, sorry if I'm not following properly.

  2. Jonny Power (he/him) reporter

    hmm maybe I'm not seeing that option - are you referring to this one? (screenshot attached) Screenshot 2024-01-17 at 11.09.17.png

    My understanding of that setting is that when you set a project connection in IC2 it will also set as the default in sf cli - I'm talking about the other direction, where IC2 uses whatever is configured as default in the cli - but I could totally be missing something very obvious

  3. Scott Wells repo owner

    Ah, I see. So basically when you create a new IC2 project against an existing SFDX project directory, instead of prompting you for a connection, have IC2 (optionally) use the project’s existing default username/alias if present. Is that a correct understanding of the enhancement request?

  4. Jonny Power (he/him) reporter

    that's right, but not just on creation of an IC2 project, but during development and lifecycle of the project as well. (e.g. new org created from tooling, set as default in cli, IC2 automatically detects and swaps as well)

  5. Scott Wells repo owner

    Got it. I’ll chew on it a bit. It’s obviously a very specific request and not likely applicable to many users of IC2. Having said that, it also probably wouldn’t be hard to implement at all, so I’ll see if it might fit with other (semi-)related work I’m doing in the next few weeks/months.

  6. Log in to comment