docs(cli-generator): document named profiles for multi-tenant CLIs - #7021
Open
devin-ai-integration[bot] wants to merge 1 commit into
Open
devin-ai-integration[bot] wants to merge 1 commit into
devin-ai-integration[bot] wants to merge 1 commit into
Conversation
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Contributor
Author
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
devin-ai-integration
Bot
requested review from
devalog,
jkonrath-postman and
nerminamiller-postman
as code owners
September 19, 2026 17:08
|
|
||
| ## Named profiles | ||
|
|
||
| For APIs where every call carries a tenant identifier (an account SID, an org slug, a workspace), a profile stores it once instead of it being typed on every command. A profile is a named bundle of request context resolved once per invocation: a credential, parameter defaults, [server URL variables](/learn/cli-generator/get-started/features#server-url-variables), an optional base URL, a [retry limit](/learn/cli-generator/get-started/features#retries-with-backoff), and a default output format. Nothing else is accepted; an unknown key is rejected at write time rather than stored and ignored. |
Contributor
There was a problem hiding this comment.
📝 [vale] <FernStyles.Acronyms> reported by reviewdog 🐶
'SID' has no definition.
|
|
||
| ### Select a profile | ||
|
|
||
| A profile is selected by, in order, `--profile` / `-p`, the `<PREFIX>_PROFILE` environment variable, then the profile marked active by `profiles use`, where `<PREFIX>` is the binary name uppercased with `-` replaced by `_`. With no profile selected, the CLI behaves as if the feature were absent. A named profile that doesn't exist is an error rather than a fallthrough to environment credentials, so a command never silently runs against the wrong tenant. The `profiles` group itself always runs unprofiled, so a stale active pointer can be repaired. |
Contributor
There was a problem hiding this comment.
📝 [vale] <FernStyles.Adverbs> reported by reviewdog 🐶
Remove 'silently' if it's not important to the meaning of the statement.
Suggested change
| A profile is selected by, in order, `--profile` / `-p`, the `<PREFIX>_PROFILE` environment variable, then the profile marked active by `profiles use`, where `<PREFIX>` is the binary name uppercased with `-` replaced by `_`. With no profile selected, the CLI behaves as if the feature were absent. A named profile that doesn't exist is an error rather than a fallthrough to environment credentials, so a command never silently runs against the wrong tenant. The `profiles` group itself always runs unprofiled, so a stale active pointer can be repaired. | |
| A profile is selected by, in order, `--profile` / `-p`, the `<PREFIX>_PROFILE` environment variable, then the profile marked active by `profiles use`, where `<PREFIX>` is the binary name uppercased with `-` replaced by `_`. With no profile selected, the CLI behaves as if the feature were absent. A named profile that doesn't exist is an error rather than a fallthrough to environment credentials, so a command never runs against the wrong tenant. The `profiles` group itself always runs unprofiled, so a stale active pointer can be repaired. |
Contributor
|
🌿 Preview your docs: https://fern-preview-devin-1789837675-cli-generator-profiles.docs.buildwithfern.com/learn Here are the markdown pages you've updated: |
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.
Summary
The CLI generator can now emit named profiles in generated CLIs: a
profilescommand group plus a global--profile/-pflag that stores a tenant's credential, parameter defaults, server URL variables, base URL, retry limit, and default output format under a name. This matters for users of multi-tenant APIs (account SIDs, org slugs, workspaces): they set the tenant context once instead of passing it on every command, secrets stay in the OS keychain rather than a config file, and CI environment variables still take precedence over a developer's stored profile. The feature is opt-in (profiles.enabled: true) and a CLI generated without it is unchanged.Implements docs for: feat(cli-generator): add named profiles for multi-tenant CLIs (fern-api/fern#17654)
Sources:
generators/cli/src/customConfig.ts(config schema:enabled,commandName,revokeOperation),generators/cli/sdk/docs/customize.md, and ADR-0011 on fern-api/fernmain.Pages changed
fern/products/cli-generator/configuration.mdx: newprofilesParamField withprofiles.enabled,profiles.commandName,profiles.revokeOperation(all three verified in the generator's config schema) and agenerators.ymlexample.fern/products/cli-generator/authentication.mdx: new canonical## Named profilessection (managing/selecting profiles,<PREFIX>_PROFILE, precedence incl. the explicit-pvs ambient-profile distinction from ADR-0011, keychain storage, single-level--parentinheritance).fern/products/cli-generator/features.mdx: cross-refs from retries (--retries <N>resolution order), server URL variables (<PREFIX>_<VARIABLE>env var naming), and--schema(builtinCommands).fern/products/cli-generator/state-of-the-world.mdx: added profiles to current capabilities and removed "Multiple credential profiles" from the roadmap's "Next" column.Validation:
fern check --warnings(0 errors; remaining warnings are preexisting) and pre-commit/vale on the changed files (0 errors/warnings).Link to Devin session: https://app.devin.ai/sessions/2825c85857d24cc991e2ccbc86bde189
Open in Devin Desktop: https://app.devin.ai/desktop/session/2825c85857d24cc991e2ccbc86bde189?variant=devin