CLI Reference#
Global options#
flet-pkg --version # Show version and exit
flet-pkg --help # Show help
flet-pkg create --help # Show help
flet-pkg create#
Create a new Flet extension package.
Package Options#
| Option | Short | Type | Default | Description |
|---|---|---|---|---|
--type |
-t |
TEXT |
(interactive) | Extension type: auto, service or ui_control |
--flutter-package |
-f |
TEXT |
(interactive) | Flutter package name from pub.dev |
--output |
-o |
PATH |
Current dir | Output directory |
--local-package |
-l |
PATH |
Path to a local Flutter package (skip download) |
Code Generation Options#
| Option | Type | Default | Description |
|---|---|---|---|
--analyze/--no-analyze |
BOOL |
True |
Analyze Flutter package and generate rich code |
--console/--no-console |
BOOL |
(interactive) | Include a debug console module for development logging |
AI Refinement Options#
| Option | Type | Default | Description |
|---|---|---|---|
--ai-refine/--no-ai-refine |
BOOL |
(interactive) | Run AI-powered refinement on generated code |
--ai-provider |
TEXT |
ollama |
AI provider: ollama, anthropic, openai, or google |
--ai-model |
TEXT |
(auto) | Override the default model for the selected provider |
Default models per provider:
| Provider | Default Model |
|---|---|
ollama |
qwen2.5-coder:14b |
anthropic |
claude-sonnet-4-6 |
openai |
gpt-4.1-mini |
google |
gemini-2.5-flash |
Output Options#
| Option | Short | Type | Default | Description |
|---|---|---|---|---|
--verbose |
-v |
BOOL |
False |
Show detailed analysis output and coverage breakdown table |
--type values#
| Value | Description |
|---|---|
auto |
Downloads the Flutter package and auto-detects the type (recommended) |
service |
Non-visual extension (ft.Service) |
ui_control |
Visual widget (ft.LayoutControl) |
Interactive mode#
When options are omitted, flet-pkg prompts you interactively using Rich:
The interactive prompt presents three choices for extension type:
? Extension type:
1 - Auto-detect (recommended)
2 - Service (no visual interface)
3 - UI Control (visual widget)
After you enter the extension name, flet-pkg checks PyPI, GitHub, and the Flet SDK monorepo for existing packages. If matches are found, you'll see a warning with links before a confirmation prompt.
If pydantic-ai is installed (via flet-pkg[ai]), you'll also be prompted for AI refinement options.
Non-interactive mode#
Pass all required options via flags:
Examples#
Auto-detect extension type:
Create a service extension:
Create a UI control extension in a specific directory:
Use a local Flutter package (skip download):
With AI refinement (Ollama, local):
With AI refinement (Anthropic):
Verbose output with coverage breakdown:
Validation rules#
| Field | Rule |
|---|---|
| Flutter package | Lowercase, underscores, starts with letter ([a-z][a-z0-9_]*) |
| Project name | Lowercase, hyphens, starts with letter ([a-z][a-z0-9-]*) |
| Package name | Valid Python identifier ([a-z][a-z0-9_]*) |
| Control class name | PascalCase ([A-Z][a-zA-Z0-9]*) |