Repository navigation
Fix CLI app discovery across organizations - #821
Merged
Merged
Conversation
roncohen
added a commit
that referenced
this pull request
Nov 25, 2026
## What changed The stable CLI currently loads apps from one default organization after a personal sign-in. This backports [the app-discovery fix](#821) so users in multiple organizations can find their apps without moving to CLI v2. - `reflag apps list` shows apps across accessible organizations, with the organization name and ID. - `reflag init` asks users with multiple organizations to pick an organization before picking an app. - `--org-id` and optional `orgId` in `reflag.config.json` pin the organization. Invalid or mismatched selections fail rather than falling back. Existing `appId`-only configs and app-scoped API keys still work. This keeps the v1 flag API and generated types, including remote config payloads, and does not change MCP connections. ## Release and verification - Targets `maintenance/cli-v1`, where the Changesets plan contains only `@reflag/cli` `1.0.5`. The maintenance branch does not publish automatically. Nothing has been published from this PR. - All 44 CLI tests passed, along with the CLI build, lint, and formatting checks. - Ran the built v1 CLI against a mock API with three organizations. Verified app discovery, defaults and overrides, rejected mismatches, app-scoped API keys, and flag creation and type generation using the existing v1 endpoints and remote config shape.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
The CLI used to load apps from one default organization after a personal sign-in. If your project used an app in another organization, the CLI couldn't find it, even with the correct
appId.reflag apps listnow shows apps across accessible organizations, including the organization name and ID for each app.reflag initasks which organization to use when there is more than one, then shows only that organization's apps. An explicit--appIdskips both pickers.--org-idoverrides the optionalorgIdinreflag.config.json. An inaccessible organization or an app outside the selected organization produces an error instead of falling back.Existing configs that only specify
appIdneed no changes, and existing personal sign-ins can be reused. API keys still discover only their own app. This changes CLI app selection, not remote MCP connection scope.Verification
--org-idprecedence, flag creation and type generation in the selected app, and single-app API key discovery.