flutterflow_cli 0.0.32-beta.1
flutterflow_cli: ^0.0.32-beta.1 copied to clipboard
Command-line client for FlutterFlow. Export code, deploy Firebase, and work with FlutterFlow AI workspaces.
FlutterFlow CLI #
The FlutterFlow CLI helps you work with FlutterFlow projects from your terminal.
You can use it to:
- Set up a FlutterFlow AI workspace for Codex, Claude, Gemini, or another coding agent.
- Create a new FlutterFlow app from a local workspace.
- Edit an existing FlutterFlow app with inspectable, repeatable changes.
- Export generated Flutter code from a FlutterFlow project.
- Deploy Firebase rules and indexes for a project.
Install #
dart pub global activate flutterflow_cli
Then check that the command is available:
flutterflow --help
API Access #
Most commands need a FlutterFlow API key. You can create one from your FlutterFlow account page:
https://app.flutterflow.io/account
For regular CLI commands, pass --token <token> or set:
export FLUTTERFLOW_API_TOKEN="<token>"
For FlutterFlow AI workspaces, flutterflow ai init asks for your API key and stores it locally in .flutterflow/.env. That file is gitignored.
FlutterFlow AI #
FlutterFlow AI is the agent workspace flow built into the CLI. It gives an AI coding agent a local workspace with:
dsl/create.dartfor creating a new FlutterFlow app.dsl/edit.dartfor editing an existing FlutterFlow app.references/with working examples.patterns/with reusable edit patterns.AGENTS.mdandCLAUDE.mdwith agent instructions..flutterflow/config.yamlwith the pinned SDK build for the workspace..flutterflow/sdk/flutterflow_ai/with the local SDK snapshot used by the workspace.
You do not need to install a separate SDK package. The CLI downloads the correct FlutterFlow AI SDK snapshot for the environment you choose.
Create a New App #
flutterflow ai init my-app --env beta
cd my-app
The CLI will ask for your API key, validate it, download the matching SDK snapshot, and create the workspace.
Ask your agent to read AGENTS.md, then describe the app you want. The agent should edit dsl/create.dart, run tests and validation, then push the app:
flutterflow ai validate dsl/create.dart
flutterflow ai run dsl/create.dart --project-name "My App" --commit-message "Create starter app"
After the first successful push, use the project ID from .flutterflow/workspace.json for future edits.
Edit an Existing App #
flutterflow ai init my-edits --env beta --project <project-id>
cd my-edits
The workspace is bound to the existing project. Ask your agent to inspect the app, make the change in dsl/edit.dart, validate it, and push it:
flutterflow ai inspect <project-id>
flutterflow ai validate dsl/edit.dart --project-id <project-id>
flutterflow ai run dsl/edit.dart --project-id <project-id> --commit-message "Update home page"
For precise edits, agents can inspect a page or component before changing it:
flutterflow ai inspect <project-id> --page HomePage --dsl-json
flutterflow ai resources <project-id>
flutterflow ai docs ui
Keep a Workspace Fresh #
Restore missing local SDK files or refresh generated agent instructions:
flutterflow ai refresh-workspace --yes
Update the workspace to the latest SDK snapshot for its environment:
flutterflow ai upgrade
If a teammate clones the workspace and .flutterflow/sdk/flutterflow_ai/ is missing, any flutterflow ai ... command will restore it from the pinned build.
Connect an Agent Through MCP #
FlutterFlow AI workspaces can expose MCP tools for agents that support MCP.
flutterflow ai mcp --workspace "$(pwd)"
The workspace refresh flow writes MCP registrations that point back to this command, so agents run against the workspace's pinned SDK build.
Export Code #
Use export-code to download generated Flutter code from an existing FlutterFlow project.
flutterflow export-code \
--project <project-id> \
--dest <output-folder> \
--token <token>
You can also set:
export FLUTTERFLOW_PROJECT="<project-id>"
export FLUTTERFLOW_API_TOKEN="<token>"
Useful flags:
| Flag | Usage |
|---|---|
--project, -p |
Project ID. Can also come from FLUTTERFLOW_PROJECT. |
--token, -t |
API token. Can also come from FLUTTERFLOW_API_TOKEN. |
--dest, -d |
Output folder. Defaults to the current directory. |
--branch-name, -b |
Branch to export. Defaults to main. |
--[no-]include-assets |
Include media assets. Defaults to false. |
--[no-]include-export-manifest |
Include .flutterflow/export_manifest.json. Defaults to false. |
--[no-]fix |
Run dart fix on downloaded code. Defaults to false. |
--[no-]parent-folder |
Put files under a project-named folder. Defaults to true. |
--[no-]as-module |
Export as a Flutter module. Defaults to false. |
--[no-]as-debug |
Include debug logging for FlutterFlow Debug Panel. Defaults to false. |
--project-environment |
Export a specific project environment. |
To protect local files during repeated exports, add a .flutterflowignore file to the output folder. It supports glob syntax.
Deploy Firebase #
Deploy Firestore rules and indexes for a FlutterFlow project.
Prerequisites: npm and firebase-tools must be installed.
flutterflow deploy-firebase \
--project <project-id> \
--token <token>
Useful flags:
| Flag | Usage |
|---|---|
--project, -p |
Project ID. Can also come from FLUTTERFLOW_PROJECT. |
--token, -t |
API token. Can also come from FLUTTERFLOW_API_TOKEN. |
--append-rules, -a |
Append to existing Firestore rules instead of overwriting them. |
Issues #
Please file issues at:
https://github.com/flutterflow/flutterflow-issues