Skip to content

Add -d/--directory option to serverpod generate command #4095

Closed

Description

@coderabbitai

Description

The serverpod generate command should support a -d or --directory option to allow users to specify which directory to generate code for, rather than always operating on the current directory.

Affected Files

  • tools/serverpod_cli/lib/src/commands/generate.dart:50

Context

// TODO: add a -d option to select the directory
GeneratorConfig config;
try {
  config = await GeneratorConfig.load();

Suggested Implementation

  • Add a --directory or -d command-line option to the generate command
  • Update GeneratorConfig.load() to accept an optional directory parameter
  • Update command help text and documentation
  • Add tests for directory specification
  • Handle edge cases (non-existent directories, permission issues, etc.)

Impact

Improved CLI usability, especially for monorepo setups or CI/CD pipelines

Related

Activity

  1. added
    enhancement
    on Oct 27, 2025
  2. added
    area: cli
    on Oct 29, 2025
  3. moved this from Inbox 📫 to In Progress 🔥 in Serverpod Frameworkson Oct 30, 2025
  4. moved this from In Progress 🔥 to Done 🚀 in Serverpod Frameworkson Nov 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

area: clienhancement

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions