Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions fern/products/cli-generator/configuration.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,39 @@ config:
```
</ParamField>

<ParamField path="packageIdentity" type="object" toc={true}>
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 <support@contoso.com>"]
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.
</ParamField>

## Publishing & delivery

### `output`
Expand Down
2 changes: 2 additions & 0 deletions fern/products/cli-generator/publishing.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ groups:

</Steps>

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:
Expand Down
Loading