flet create command creates a new Flet project from a predefined template, setting up the initial directory structure, metadata, and required files to help you get started quickly.
Basic Usage
Examples
Create in Current Directory
Create in New Directory
my-app directory with a new Flet project.
Create with Custom Name
Create Extension Project
Create with Description
Arguments
Directory where the new Flet project will be created. If omitted, the project is created in the current directory.The directory will be created if it doesn’t exist.
Options
Name of the new Flet project. This will be used in metadata files such as If not specified, the output directory name is used.The name is automatically converted to a valid Python package name (lowercase, hyphens replaced with underscores).
pyproject.toml.Short description of the new Flet project. This will appear in generated metadata.This appears in:
pyproject.toml- Generated README
- App metadata
The template (or type of project) to create.Options:
app- Standard Flet application (default)extension- Flet extension project for custom controls
Git reference (branch, tag, or commit ID) of the Flet template repository to use.By default, uses the template version matching your installed Flet version.Useful for:
- Using development templates
- Testing new template features
- Using a specific template version
Project Structure
Theapp template creates the following structure:
main.py
The entry point for your application:pyproject.toml
Project metadata and build configuration:requirements.txt
Python dependencies:Template Types
App Template (Default)
The standard template for creating Flet applications.- Basic Flet app structure
- Sample code
pyproject.tomlconfiguration- Assets directory
- README with instructions
- Regular Flet applications
- Desktop apps
- Web apps
- Mobile apps
Extension Template
Template for creating custom Flet controls.- Extension package structure
- Example custom control
- Build configuration
- Documentation template
- Creating reusable controls
- Wrapping third-party libraries
- Extending Flet functionality
After Creation
Once your project is created, the CLI displays next steps:Install Dependencies
If you created the project in a new directory:pyproject.toml:
Run Your App
Start Development
Enable hot reload for development:Customizing the Template
After creation, you can customize the generated files:Update Project Metadata
Editpyproject.toml:
Add Dependencies
Editrequirements.txt:
pyproject.toml:
Customize App Structure
Create additional modules:Using Custom Templates
You can use templates from different sources:Specific Template Version
Development Branch
Specific Commit
Template Repository
Templates are pulled from the flet-dev/flet-app-templates repository. The repository contains:- Multiple template types
- Platform-specific configurations
- Example code
- Documentation
Integration with Package Managers
Using Poetry
After creating the project:Using pip with Virtual Environment
Using uv
Examples
Create Production-Ready Project
pyproject.toml:
Create Extension Project
Create Multiple Apps
Troubleshooting
Directory Already Exists
The command overwrites existing files if the directory exists:Template Download Fails
If you have network issues:Import Errors After Creation
Make sure to install dependencies:Best Practices
1. Use Descriptive Names
2. Add Metadata Immediately
Editpyproject.toml right after creation to avoid forgetting later.
3. Use Version Control
4. Set Up Virtual Environment
Always use a virtual environment:Next Steps
Run Command
Run your app with hot reload
Build Command
Build production executables
Getting Started
Learn Flet basics
Project Structure
Organize your Flet app