Splendid CLI is a comprehensive command-line toolkit for Flutter developers that streamlines development workflows and enforces best practices. While it started as a project scaffolding tool, it has evolved into a full-featured development assistant that helps with project creation, code generation, testing, and project management.
Key Features:
- Project Scaffolding: Create Flutter projects with MVC architecture, strong typing, and localization setup
- Code Generation: Generate screens, widgets, and test templates following best practices
- Code Formatting: Format Dartdoc comments, regular comments, and Dart code to consistent line lengths
- Localization Tools: Sort and organize ARB localization files and Dart enum values alphabetically
- GUI Dashboard: Visual interface for project management and code generation
- Brick Management: Efficient caching system for Mason bricks with offline support
- Test Automation: Intelligent test template generation for widgets and classes
- Development Workflow: Automated setup and deep cleaning commands for faster project maintenance
To install Splendid CLI globally, run:
dart pub global activate splendid_cliMake sure to add Dart's pub cache bin directory to your PATH:
export PATH="$PATH":"$HOME/.pub-cache/bin"Splendid CLI enforces a strict MVC (Model-View-Controller) pattern:
- Route: StatefulWidget entry point for each screen
- Controller: Extends State, handles business logic and state management
- View: StatelessWidget for pure UI presentation
This separation ensures maintainable, testable code with clear responsibilities.
All generated code uses explicit typing:
- No
varordynamicunless absolutely necessary - Full type annotations for collections and function signatures
- Nullable types (
String?) over dynamic when null values are expected
Every project includes l10n setup:
- ARB files for string management
- Automatic generation with
flutter gen-l10n - No hard-coded strings in UI code
The CLI uses Mason bricks for code generation with intelligent loading:
- Development Mode: Uses local
bricks/directory when available - Global Installation: Downloads from GitHub and caches locally
- Offline Support: Cached bricks work offline after first download
- Automatic Fallback: Seamlessly falls back: local → cached → remote
Bricks are cached in ~/.splendid_cli/bricks/ for fast offline access.
Create new Flutter projects with opinionated architecture and best practices built-in:
splendid_cli create my_awesome_appWhat you get:
- MVC architecture pattern (Route → Controller → View)
- Strong typing enforcement throughout the codebase
- Localization (l10n) setup with ARB files
- Proper project structure with organized directories
- Platform-specific configurations
- Best practice coding standards pre-configured
Options:
--output-directory(-o): Specify where to create the project--platforms: Choose platforms (android,ios,web,windows,macos,linux)--force: Overwrite existing directories
cd my_awesome_app
splendid_cli setupAutomates the tedious post-creation setup steps:
flutter pub get- Downloads and installs dependenciesflutter gen-l10n- Generates localization filesflutter run- Launches the application (optional)
Options:
--project(-p): Specify the Flutter project directory--no-run: Skip running the app after setup--verbose(-v): Enable verbose output
# Setup any Flutter project
splendid_cli setup --project path/to/flutter/project --no-runsplendid_cli screen gameGenerate complete screens following MVC architecture patterns. Creates three files:
- Route:
lib/screens/game/game_route.dart- StatefulWidget entry point - Controller:
lib/screens/game/game_controller.dart- Business logic and state management - View:
lib/screens/game/game_view.dart- UI presentation layer
Features:
- Automatic name conversion (PascalCase → snake_case)
- Placeholder content demonstrating MVC separation
- Ready-to-customize templates
- Proper imports and structure
Options:
--force: Overwrite existing screen files
# Create screen with PascalCase name
splendid_cli screen UserProfile
# Overwrite existing screen
splendid_cli screen settings --forcesplendid_cli generate-test lib/services/api_service.dart
# or use the shorter alias:
splendid_cli gen-test lib/services/api_service.dartIntelligent test template generation that adapts to your code:
Auto-Detection:
- Analyzes file content to determine if it's a widget or class
- Generates appropriate test structure automatically
- Creates comprehensive test categories and examples
Widget Tests:
- Uses
testWidgetswith Flutter testing utilities - Includes widget tree building and interaction tests
- Finder patterns and gesture simulation examples
Class Tests:
- Uses standard
test()functions - Organized test groups for different functionality
- Mock setup and teardown examples
Options:
--output(-o): Custom output directory--type(-t): Specify test type (auto, widget, class)--force: Overwrite existing test files
# Auto-detect test type
splendid_cli gen-test lib/services/auth_service.dart
# Explicit widget test
splendid_cli gen-test lib/widgets/my_widget.dart --type=widget
# Custom output location
splendid_cli gen-test lib/models/user.dart --output=test/unit/modelsSplendid CLI provides comprehensive code formatting tools to maintain consistent comment and code style across your project.
splendid_cli format .The unified format command applies all formatters in sequence:
- Dartdoc comments (/// and /** */)
- Regular comments (//)
- Dart code (via dart format)
Options:
--line-length(-l): Maximum line length for comments (default: 120, range: 40-200)--dry-run: Preview changes without modifying files--verbose(-v): Show detailed progress
# Format entire project with 80-character comments
splendid_cli format . 80
# Preview changes without applying
splendid_cli format lib/ --dry-run
# Format with custom line length using flag
splendid_cli format . --line-length 100splendid_cli format-dartdoc lib/Reformats Dartdoc comments (/// and /** */) to specified line length while preserving:
- Code blocks (
dart ...) - Markdown formatting
- List items and headers
- Documentation tags (@param, @returns, etc.)
Syntax:
# Positional argument (convenient)
splendid_cli format-dartdoc <target> <line-length>
# Flag syntax (explicit)
splendid_cli format-dartdoc <target> --line-length <length>Examples:
# Format to 80 characters
splendid_cli format-dartdoc lib/services/api_service.dart 80
# Format entire directory
splendid_cli format-dartdoc . --line-length 120
# Preview changes
splendid_cli format-dartdoc lib/ --dry-run --verbosesplendid_cli format-comments lib/Reformats regular // comments to specified line length. Leaves Dartdoc comments (/// and /** */) unchanged.
Syntax:
# Positional argument (convenient)
splendid_cli format-comments <target> <line-length>
# Flag syntax (explicit)
splendid_cli format-comments <target> --line-length <length>Examples:
# Format to 80 characters
splendid_cli format-comments lib/services/api_service.dart 80
# Format entire directory
splendid_cli format-comments . --line-length 120
# Preview changes
splendid_cli format-comments lib/ --dry-runsplendid_cli sort-l10n lib/l10nSorts Flutter localization (.arb) files alphabetically by key while maintaining the relationship between value entries and their metadata (@key entries).
Features:
- Alphabetical sorting by key
- Preserves value-metadata pairs
- Maintains JSON formatting
- Handles multiple files in directory
Options:
--dry-run: Preview changes without modifying files--verbose(-v): Show detailed file lists
Examples:
# Sort all ARB files in directory
splendid_cli sort-l10n lib/l10n
# Sort specific file
splendid_cli sort-l10n lib/l10n/app_en.arb
# Preview changes
splendid_cli sort-l10n lib/l10n --dry-run --verbosesplendid_cli sort-enum lib/models/status.dartSorts Dart enum values alphabetically by name within a source file. Handles both simple enums (plain value lists) and enhanced enums with fields, constructors, and methods.
Features:
- Alphabetical sorting of enum values by name
- Preserves documentation comments on individual values
- Handles enhanced enums with constructor arguments and members
- Processes all enum declarations in a file independently
- Already-sorted enums are left unchanged
Options:
--dry-run: Preview changes without modifying the file--verbose(-v): Show detailed progress
Examples:
# Sort all enums in a file
splendid_cli sort-enum lib/models/status.dart
# Preview which enums would be reordered
splendid_cli sort-enum lib/models/priority.dart --dry-run
# Sort with verbose output using the alias
splendid_cli enum-sort lib/models/color.dart --verbosesplendid_cli deep_cleanPerforms comprehensive cleaning beyond standard flutter clean:
flutter clean- Remove build artifactsflutter pub get- Refresh dependenciesflutter gen-l10n- Regenerate localization files
When to use:
- Build errors after normal flutter clean
- Dependency conflicts or corruption
- After major Flutter SDK updates
- Switching between Flutter channels
Options:
--verbose(-v): Show detailed Flutter command output
Examples:
# Deep clean current directory
splendid_cli deep_clean
# Deep clean specific project
splendid_cli dc /path/to/flutter/project
# With verbose output
splendid_cli deep_clean --verbose# Launch the GUI dashboard
splendid_cli gui
# Launch for specific project
splendid_cli gui --project-path /path/to/projectA full-featured desktop application for visual project management:
Features:
- Visual project creation wizard with platform selection
- Screen generation interface with live preview
- Test file generation with file browser
- Real-time command output and progress feedback
- Cross-platform desktop support (Windows, macOS, Linux)
- Integrated terminal output viewer
Options:
--project-path(-p): Initial project directory--debug: Launch with additional logging
Requirements:
- Flutter SDK installed and available in PATH
- Desktop platform support enabled for Flutter
See example/gui_dashboard/README.md for detailed documentation.
# List cached bricks
splendid_cli cache list
# Show cache information
splendid_cli cache info
# Clear all cached bricks
splendid_cli cache clear
# Clear cache without confirmation
splendid_cli cache clear --forceEfficient management of locally cached Mason bricks:
Features:
- View all cached bricks and their sizes
- Check cache location and total size
- Clear cache to free up disk space
- Automatic re-download when needed
How It Works:
- Development Mode: Uses local
bricks/directory when available - Global Installation: Downloads from GitHub and caches locally
- Offline Support: Cached bricks work offline after first download
- Automatic Fallback: Seamlessly falls back: local → cached → remote
Bricks are cached in ~/.splendid_cli/bricks/ for fast offline access.
| Command | Description | Aliases |
|---|---|---|
create <name> |
Create new Flutter project with MVC architecture | - |
setup |
Run post-creation setup (pub get, gen-l10n, run) | - |
screen <name> |
Generate new screen with MVC pattern | - |
deep_clean |
Deep clean project (clean, pub get, gen-l10n) | dc |
| Command | Description | Aliases |
|---|---|---|
generate-test <file> |
Generate test template for Dart file | gen-test |
| Command | Description | Aliases |
|---|---|---|
format <target> [length] |
Format Dartdoc, regular comments, and code | fmt |
format-dartdoc <target> [length] |
Format Dartdoc comments to line length | fmt-doc, format-docs |
format-comments <target> [length] |
Format regular comments to line length | fmt-comments, format-comment |
| Command | Description | Aliases |
|---|---|---|
sort-l10n <target> |
Sort ARB localization files alphabetically | sort-arb, l10n-sort |
| Command | Description | Aliases |
|---|---|---|
sort-enum <dart_file> |
Sort Dart enum values alphabetically by name | enum-sort |
| Command | Description | Aliases |
|---|---|---|
gui |
Launch GUI dashboard | dashboard |
cache list |
List all cached bricks | - |
cache info |
Show cache information | - |
cache clear |
Clear brick cache | - |
help [command] |
Display help information | - |
Most commands support these common options:
--help(-h): Show command-specific help--verbose(-v): Enable verbose output--force: Overwrite existing files without confirmation
-
Create a new Flutter project:
splendid_cli create my_app
-
Set up the project:
cd my_app splendid_cli setup -
Add screens as you develop:
splendid_cli screen home splendid_cli screen user_profile splendid_cli screen settings
-
Generate tests for your code:
splendid_cli gen-test lib/services/auth_service.dart splendid_cli gen-test lib/widgets/custom_button.dart
-
Format your code for consistency:
# Format everything (Dartdoc, comments, and code) splendid_cli format . 80 # Or format specific aspects splendid_cli format-dartdoc lib/ 120 splendid_cli format-comments lib/ 120
-
Organize localization files:
splendid_cli sort-l10n lib/l10n
-
Sort enum values alphabetically:
splendid_cli sort-enum lib/models/status.dart
-
Deep clean when needed:
splendid_cli deep_clean
Prefer a visual interface? Launch the GUI dashboard:
splendid_cli guiThe GUI provides the same functionality with a user-friendly interface, file browsers, and real-time feedback.
Splendid CLI can be integrated directly into your IDE for seamless access to its features:
Consistency: Enforces MVC architecture and coding standards across your entire project with automated formatting tools
Speed: Automates repetitive tasks like project setup, screen generation, test creation, and code formatting
Best Practices: Built-in support for strong typing, localization, proper file organization, and consistent comment formatting
Flexibility: Works via command line or GUI, online or offline with cached bricks
IDE Integration: Available as plugins for popular IDEs with context menu actions
Comprehensive: Not just scaffolding—includes testing tools, code formatting, localization management, project maintenance, and workflow automation
Developer-Friendly: Supports both flag syntax and convenient positional arguments for faster command execution
Contributions are welcome! Please follow these steps:
- Fork the repository.
- Create a new branch for your feature or bugfix.
- Make your changes and ensure tests pass.
- Submit a pull request with a clear description of your changes.
Please adhere to the project's coding style and include tests for new features.
This project is licensed under the MIT License. See the LICENSE file for details.
In the creation of this application, artificial intelligence (AI) tools have been utilized. These tools have assisted in various stages of the tools's development, from initial code generation to the optimization of algorithms.
It is emphasized that the AI's contributions have been thoroughly overseen. Each segment of AI-assisted code has undergone meticulous scrutiny to ensure adherence to high standards of quality, reliability, and performance. This scrutiny was conducted by the sole developer responsible for the app's creation.
Rigorous testing has been applied to all AI-suggested outputs, encompassing a wide array of conditions and use cases. Modifications have been implemented where necessary, ensuring that the AI's contributions are well-suited to the specific requirements and limitations inherent in the technologies related to this app's functionality.
Commitment to the apps's accuracy and functionality is paramount, and feedback or issue reports from users are invited to facilitate continuous improvement.
It is to be understood that this tool, like all software, is subject to evolution over time. The developer is dedicated to its progressive refinement and is actively working to surpass the expectations of the community.