Skip to main content
The Flet CLI provides a comprehensive set of commands for developing, building, and deploying Flet applications across multiple platforms.

Installation

The Flet CLI is installed automatically when you install Flet:
pip install flet
Verify the installation:
flet --version
This displays the versions of Flet, Flutter, and Pyodide:
Flet: 0.24.0
Flutter: 3.24.0
Pyodide: 0.26.2

Available Commands

The Flet CLI provides the following commands:

Development Commands

flet run

Run a Flet application in hot reload mode for rapid development

flet create

Create a new Flet project from a template

Build Commands

flet build

Build platform-specific executables and packages

flet pack

Package desktop apps using PyInstaller

Deployment Commands

flet publish

Publish your app as a static web application

flet serve

Serve a static web app locally

Utility Commands

flet doctor

Check your development environment

flet devices

List available devices for testing

flet emulators

Manage mobile emulators

Global Options

All Flet CLI commands support these global options:
--version
flag
Display version information for Flet, Flutter, and Pyodide
--help
flag
Display help information for any command
--verbose
flag
Enable verbose output for debugging

Quick Start

Here’s a typical workflow using the Flet CLI:

1. Create a New Project

flet create my-app
cd my-app

2. Run in Development Mode

flet run
This starts your app with hot reload enabled. Any changes to your Python code will automatically refresh the app.

3. Build for Production

Build for different platforms:
# Desktop
flet build macos
flet build windows
flet build linux

# Web
flet build web

# Mobile
flet build apk
flet build ipa

4. Publish to Web

flet publish
flet serve

Configuration

Many CLI options can be configured in your project’s pyproject.toml file:
[tool.flet]
product = "My Awesome App"
org_name = "com.mycompany"

[tool.flet.web]
renderer = "canvaskit"
route_url_strategy = "path"

[tool.flet.android]
permissions = ["camera", "location"]

[tool.flet.ios]
team_id = "XXXXXXXXXX"
Command-line arguments take precedence over pyproject.toml settings.

Environment Variables

Several environment variables can control CLI behavior:
  • FLET_ASSETS_DIR - Default assets directory
  • FLET_WEB_RENDERER - Web renderer (auto, canvaskit, skwasm)
  • FLET_WEB_ROUTE_URL_STRATEGY - URL routing strategy (path, hash)
  • FLET_WEB_NO_CDN - Disable CDN usage for offline builds
  • FLET_ANDROID_SIGNING_KEY_STORE - Path to Android keystore
  • FLET_ANDROID_SIGNING_KEY_STORE_PASSWORD - Keystore password
  • FLET_ANDROID_SIGNING_KEY_PASSWORD - Key password
  • FLET_ANDROID_SIGNING_KEY_ALIAS - Key alias

Getting Help

For detailed help on any command:
flet <command> --help
For example:
flet build --help
flet run --help
flet publish --help

Next Steps

Run Command

Learn about hot reload and development mode

Build Command

Build apps for all platforms

Create Command

Scaffold new Flet projects

Publish Command

Deploy static web applications

Build docs developers (and LLMs) love