Skip to content

Comments

feat(cli): add --output option for custom preview directory#11487

Merged
fern-support merged 12 commits intomainfrom
devin/1767990722-preview-output-dir
Jan 23, 2026
Merged

feat(cli): add --output option for custom preview directory#11487
fern-support merged 12 commits intomainfrom
devin/1767990722-preview-output-dir

Conversation

@jsklan
Copy link
Contributor

@jsklan jsklan commented Jan 9, 2026

Description

Refs: Request from user
Link to Devin run: https://app.devin.ai/sessions/c1bdd2db348e49cd91bed142537ee757
Requested by: @jsklan

Adds a new --output CLI option to the fern generate command that allows users to specify a custom output directory for preview generation when using the --preview flag for SDK generation, instead of the default .preview directory.

Changes Made

  • CLI Option: Added --output string option to the generate command in cli.ts
  • Validation Logic: Added validation to ensure the option is only used with --preview flag and not with --docs
  • Core Integration: Updated generateAPIWorkspaces function to accept and use the custom output directory
  • Path Resolution: Uses resolve(cwd(), outputDir) to support both relative and absolute paths (consistent with --lfs-override)
  • Version Bump: Added version 3.50.0 entry in versions.yml

Updates Since Last Revision

  • Fixed path handling to support relative paths using resolve(cwd(), outputDir), matching the pattern used by --lfs-override

Testing

  • Unit tests added/updated
  • Manual testing completed (lint checks pass)
  • Verified --help shows the new option
  • Verified validation errors when using --output without --preview
  • Verified validation errors when using --output with --docs

Human Review Checklist

  • Path handling: The implementation uses AbsoluteFilePath.of(previewOutputDir) directly. Now uses resolve(cwd(), outputDir) to support both relative and absolute paths, consistent with --lfs-override.
  • No unit tests: Consider whether unit tests should be added for the new option and validation logic.

Co-Authored-By: judah@buildwithfern.com <jsklan.development@gmail.com>
@devin-ai-integration
Copy link
Contributor

devin-ai-integration bot commented Jan 9, 2026

🤖 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

@jsklan jsklan changed the title feat(cli): add --preview-output-dir option to fern generate command feat(cli): add --output option to fern generate command Jan 23, 2026
@fern-support fern-support enabled auto-merge (squash) January 23, 2026 20:34
@fern-support fern-support disabled auto-merge January 23, 2026 20:37
@fern-support fern-support changed the title feat(cli): add --output option to fern generate command feat(cli): add --output option for custom preview directory Jan 23, 2026
@fern-support fern-support merged commit 90391ef into main Jan 23, 2026
102 checks passed
@fern-support fern-support deleted the devin/1767990722-preview-output-dir branch January 23, 2026 20:39
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