Skip to content

feat(cli): add fern replay commands to CLI v2#15081

Merged
iamnamananand996 merged 7 commits intomainfrom
devin/1776349704-add-replay-commands-cli-v2
Apr 17, 2026
Merged

feat(cli): add fern replay commands to CLI v2#15081
iamnamananand996 merged 7 commits intomainfrom
devin/1776349704-add-replay-commands-cli-v2

Conversation

@iamnamananand996
Copy link
Copy Markdown
Contributor

@iamnamananand996 iamnamananand996 commented Apr 16, 2026

Description

Linear ticket: Closes FER-8791

Ports the existing fern replay commands from CLI v1 into CLI v2, following the class-based command architecture.

Changes Made

  • Added fern replay init — Initialize Replay for an SDK repository (clones repo, bootstraps lockfile, creates PR via Fiddle)
  • Added fern replay resolve — Apply and resolve Replay patches with conflict marker checking
  • Added fern replay status — Show Replay status and tracked customizations
  • Added fern replay forget — Remove tracked patches by ID, pattern, or --all with interactive confirmation
  • Added replay command group wired into the CLI v2 entry point
  • Added @fern-api/generator-cli as a workspace dependency for cli-v2
  • Extracted submitReplayInit and parseOwnerRepo into @fern-api/generator-cli as a shared reusable library (per review feedback)
  • Added unreleased changelog entry

The commands are fully visible in --help (unlike CLI v1 where they were hidden with describe: false).

Testing

  • Compilation passes (pnpm turbo run compile --filter @fern-api/cli-v2)
  • Biome formatting/lint passes (pnpm check:fix)
  • Manual testing completed

Link to Devin session: https://app.devin.ai/sessions/ea5aef13f37e4a2285d97c46406ec9c7
Requested by: @iamnamananand996


Open with Devin

@devin-ai-integration
Copy link
Copy Markdown
Contributor

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

Adds comprehensive unit tests for replay forget, init, resolve, and status commands (mocks generator-cli and core helpers).

Implements validation in ForgetCommand to reject multiple positional non-patch arguments (throws CliError for ambiguous input). Enhances InitCommand by importing and using replaceEnvVariables to resolve self-hosted git env vars, validating the Fern response contains a prUrl (isPrUrlResponse helper), and improving error handling for unexpected responses. These changes tighten input validation and make init behavior more robust while the new tests cover key scenarios (dry-run, missing data, network errors, and confirmation flows).
@iamnamananand996 iamnamananand996 marked this pull request as ready for review April 16, 2026 18:26
Copy link
Copy Markdown

@claude claude bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude Code Review

This repository is configured for manual code reviews. Comment @claude review to trigger a review and subscribe this PR to future pushes, or @claude review once for a one-time review.

Tip: disable this comment in your organization's Code Review settings.

Comment thread packages/cli/cli-v2/src/commands/replay/init/command.ts Outdated
Move the Fiddle API submission logic and parseOwnerRepo into a shared
submitReplayInit function in @fern-api/generator-cli so both CLI v1
and CLI v2 can reuse the same library code.
devin-ai-integration[bot]

This comment was marked as resolved.

devin-ai-integration[bot]

This comment was marked as resolved.

devin-ai-integration[bot]

This comment was marked as resolved.

Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 1 new potential issue.

View 7 additional findings in Devin Review.

Open in Devin Review

Comment thread packages/generator-cli/src/replay/replay-submit-init.ts
@iamnamananand996 iamnamananand996 merged commit cea5748 into main Apr 17, 2026
59 checks passed
@iamnamananand996 iamnamananand996 deleted the devin/1776349704-add-replay-commands-cli-v2 branch April 17, 2026 16:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants