Skip to content

Fern CLI: Add fern list-generators command to CLI #8602

@iamnamananand996

Description

@iamnamananand996

Which Fern component?

SDK Generator

How important is this?

P1 - High (Strongly needed)

What's the feature?

Currently, users have no easy way to discover what SDK generators are available in the Fern ecosystem. They have to look in the github ReadMe.

  • Browse documentation to find generator names
  • Guess generator names when configuring generators.yml
  • Rely on trial and error when setting up new projects

This makes it difficult for new users to discover available options and for existing users to explore new generators.


Proposed Solution

Add a fern list-generators command that fetches and displays all available generators from the Fern registry.

Command

fern list-generators

Options

  • --language <lang> – Filter by programming language (e.g., python, typescript, java, etc.)
  • --type <type> – Filter by generator type (sdk, model, server, other)
  • --format <format> – Output format: table (default), json, yaml
  • --output <file> – Write output to a file instead of stdout

Example Usage

# List all generators
fern list-generators

# List Python SDK generators
fern list-generators --language python --type sdk

# Export to JSON
fern list-generators --format json --output generators.json

Expected Output (Table Format)

ID Name Type Language Version Docker Image
python-sdk Python SDK sdk python 1.4.2 fernapi/fern-python-sdk
typescript-sdk TypeScript SDK sdk typescript 2.1.0 fernapi/fern-typescript-sdk
java-sdk Java SDK sdk java 1.3.7 fernapi/fern-java-sdk
... ... ... ... ... ...

Benefits

  • Discoverability – Users can easily explore available generators
  • Developer Experience – Simplifies generator selection and configuration
  • Documentation – Provides real-time, accurate list of available options
  • Integration – Helps users understand the full Fern ecosystem

Technical Implementation

  • Use existing @fern-fern/generators-sdk to fetch generators from registry
  • Follow existing CLI patterns and structure
  • Support multiple output formats for different use cases
  • Include proper error handling and filtering capabilities

Acceptance Criteria

  • Command fern list-generators lists all available generators
  • Support filtering by --language and --type
  • Support --format option (table, json, yaml)
  • Support --output option to write to file
  • Display relevant generator information (ID, name, type, language, Docker image)
  • Handle errors gracefully (e.g., network issues, empty results)
  • Include help text and examples
  • Follow existing CLI patterns and code style

Let me know if you want it as a docstring, release note, or changelog format.

Any alternatives?

No response

Are you interested in contributing this feature?

Yes

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions