From 1daea4df4403cd7354fbab95b67c6d7d7c50dbd7 Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Thu, 30 Jul 2026 17:07:03 +0000 Subject: [PATCH] docs: document packageIdentity config for the CLI generator Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> --- fern/products/cli-generator/configuration.mdx | 33 +++++++++++++++++++ fern/products/cli-generator/publishing.mdx | 2 ++ 2 files changed, 35 insertions(+) diff --git a/fern/products/cli-generator/configuration.mdx b/fern/products/cli-generator/configuration.mdx index 71c60b9409..52a6758ed1 100644 --- a/fern/products/cli-generator/configuration.mdx +++ b/fern/products/cli-generator/configuration.mdx @@ -85,6 +85,39 @@ config: ``` + +Overrides the Cargo `[package]` metadata of the generated crate. Without it, the crate keeps the SDK template's Fern-owned identity (`name = "fern-cli-sdk"`, Fern's repository and authors), which is wrong for a CLI you publish under your own name. + +Every field is optional, and omitting `packageIdentity` leaves generated output unchanged. + +```yaml title="generators.yml" +config: + binaryName: contoso + packageIdentity: + name: contoso-cli + description: Command-line interface for the Contoso API. + license: MIT + repository: https://github.com/contoso/contoso-cli + homepage: https://contoso.com + authors: ["Contoso "] + keywords: ["plants", "cli"] +``` + +| Field | Type | Cargo `[package]` key | +| --- | --- | --- | +| `name` | string | `name` | +| `description` | string | `description` | +| `license` | string | `license` | +| `repository` | string | `repository` | +| `homepage` | string | `homepage` | +| `authors` | array of strings | `authors` | +| `keywords` | array of strings | `keywords` | + +`name` must be a valid cargo crate name: it starts with a letter and contains only letters, digits, `-`, and `_`. Invalid values fail at generation time with a config error instead of surfacing later as a manifest error during `cargo build`. The generator renames the matching `Cargo.lock` entry in the same pass, so `cargo build --locked` still resolves the workspace member. + +The override applies only to the `[package]` section. The internal library name (`[lib] name = "fern_cli_sdk"`) isn't configurable, because the vendored source tree imports through it. + + ## Publishing & delivery ### `output` diff --git a/fern/products/cli-generator/publishing.mdx b/fern/products/cli-generator/publishing.mdx index 91e64ba134..9da2fc9bdd 100644 --- a/fern/products/cli-generator/publishing.mdx +++ b/fern/products/cli-generator/publishing.mdx @@ -60,6 +60,8 @@ groups: +The npm package name is independent of the generated Rust crate's identity. To publish the crate under your own name, license, repository, and authors instead of Fern's, set [`packageIdentity`](/learn/cli-generator/get-started/configuration#config-options) in the generator's `config`. + ## Configure GitHub publishing Fern publishes your CLI via GitHub Actions. Configure your GitHub repository and publishing mode: