Skip to content
Merged
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
46 changes: 46 additions & 0 deletions fern/products/cli-generator/configuration.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,52 @@ config:
```
</ParamField>

<ParamField path="packageIdentity" type="object" toc={true} required={false}>
Sets the Cargo `[package]` metadata of the generated crate. Use `packageIdentity` to publish the crate under your own name, license, repository, and authors instead of Fern's.

```yaml title="generators.yml"
config:
binaryName: plant
packageIdentity:
name: plant-cli
description: Command-line interface for the Plant API.
license: MIT
repository: https://github.com/garden/plant-cli
homepage: https://example.com
authors: ["Plants <support@garden-plants.com>"]
keywords: ["plants", "cli"]
```
</ParamField>
<Indent>
<ParamField path="packageIdentity.name" type="string" required={false}>
Crate 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.
</ParamField>

<ParamField path="packageIdentity.description" type="string" required={false}>
Short crate description shown on crates.io.
</ParamField>

<ParamField path="packageIdentity.license" type="string" required={false}>
SPDX license expression, such as `Apache-2.0`.
</ParamField>

<ParamField path="packageIdentity.repository" type="string" required={false}>
URL of the crate's source repository.
</ParamField>

<ParamField path="packageIdentity.homepage" type="string" required={false}>
URL of the project homepage.
</ParamField>

<ParamField path="packageIdentity.authors" type="array of strings" required={false}>
Crate authors, in Cargo's `Name <email>` form.
</ParamField>

<ParamField path="packageIdentity.keywords" type="array of strings" required={false}>
Keywords for crates.io search.
</ParamField>
</Indent>

## Publishing & delivery

### `output`
Expand Down
4 changes: 3 additions & 1 deletion fern/products/cli-generator/publishing.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,9 @@ groups:
config:
binaryName: my-cli
```

<Info>
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, set [`packageIdentity`](/learn/cli-generator/get-started/configuration#config-options) in the generator's `config`.
</Info>
</Step>

</Steps>
Expand Down
Loading