Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Usage:
# make staging # channel = current git branch, expires in 7d
# make staging CHANNEL=my-channel # custom channel name
# make staging CHANNEL=my-channel EXPIRES=14d
# make build # just build the site
# make deploy-staging # deploy without rebuilding

SHELL := /usr/bin/env bash
.SHELLFLAGS := -eu -o pipefail -c

BRANCH := $(shell git rev-parse --abbrev-ref HEAD)
CHANNEL ?= $(BRANCH)
EXPIRES ?= 7d

# Firebase channel IDs must match [a-zA-Z0-9_-]
SAFE_CHANNEL := $(shell echo "$(CHANNEL)" | tr '/' '-' | tr -c 'a-zA-Z0-9_-' '-' | sed 's/-\+/-/g; s/^-//; s/-$$//')

.PHONY: staging build deploy-staging check-firebase

staging: build deploy-staging

build:
npm run build

deploy-staging: check-firebase
@echo "Branch: $(BRANCH)"
@echo "Channel: $(SAFE_CHANNEL)"
@echo "Expires: $(EXPIRES)"
firebase hosting:channel:deploy "$(SAFE_CHANNEL)" --expires "$(EXPIRES)"

check-firebase:
@command -v firebase >/dev/null 2>&1 || { \
echo "firebase CLI not found. Install with: npm install -g firebase-tools" >&2; \
exit 1; \
}
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,21 @@ You may want to run the docs site locally to test and visualize changes you are
1. **Install Dependencies:** Run **`npm install`** in your terminal to install the necessary dependencies.
2. **Preview Changes:** To see your changes in real-time as you edit the files, you can run a local development server. This server will host your website and reflect the latest changes. Use the command **`npm run start`**.

## Deploying a Staging Preview
To share your branch with reviewers before merging, deploy it to a Firebase Hosting preview channel. This builds the site and publishes it to a temporary URL (defaults to a 7-day expiry).

```bash
make staging # channel name = current git branch
make staging CHANNEL=my-channel # custom channel name
make staging CHANNEL=my-channel EXPIRES=14d
```

Other targets:
- `make build` — build the site only
- `make deploy-staging` — deploy without rebuilding

Requires the Firebase CLI (`npm install -g firebase-tools`) and access to the `flutterflow-docs-82026` Firebase project.

## Ready to Contribute?
Your contributions are vital to keeping FlutterFlow's documentation clear, up-to-date, and helpful. We look forward to seeing your pull requests and are excited to welcome you into our community of contributors!

Expand Down
2 changes: 1 addition & 1 deletion docs/accounts-billing/account-management.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ Now, you are ready to log in with your new email address and password.
![update-email.png](imgs/update-email.png)

### How do I generate an API Token?
An API token is required to use the [CLI](../testing-deployment-publishing/exporting-code/ff-cli.md) and the [Visual Studio Code Extension](../ff-concepts/adding-customization/vscode-extension.md)
An API token is required to use the [CLI](../ff-concepts/advanced/flutterflow-cli/overview.md) and the [Visual Studio Code Extension](../ff-concepts/adding-customization/vscode-extension.md)
.

To create an API token tied to your account:
Expand Down
4 changes: 4 additions & 0 deletions docs/ff-concepts/advanced/flutterflow-cli/_category_.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"label": "FlutterFlow CLI",
"position": 1
}
Original file line number Diff line number Diff line change
@@ -1,27 +1,14 @@
---
slug: /exporting/ff-cli
title: FlutterFlow CLI
slug: /flutterflow-cli/exporting
title: Exporting Projects
description: Learn how to download and manage your FlutterFlow projects locally using the FlutterFlow CLI.
tags: [CLI, Collaboration, FlutterFlow]
sidebar_position: 1
sidebar_position: 2
keywords: [CLI, Collaboration, FlutterFlow, Projects, Local Management]
---


# FlutterFlow CLI

The [FlutterFlow CLI](https://pub.dev/packages/flutterflow_cli) tool allows you to quickly and easily download your project files directly from FlutterFlow to your local machine.

## Installation

To use the FlutterFlow CLI, you first need to install it globally using Dart's package manager with the following command:

```
dart pub global activate flutterflow_cli
```

## Usage

# Exporting Projects
Follow the steps below to export your project.

<div style={{
Expand Down Expand Up @@ -51,10 +38,8 @@ Follow the steps below to export your project.
</div>
<p></p>

### API Token
To use the CLI, you'll need to create an API token and use it in your requests. See the documentation [here on how to generate an API token.](/accounts-billing/account-management)

### CLI command details
### Command Details

- If you wish to exclude assets from the download, use `-no-include-assets` in your command. This will download the project code without the assets. For example: `flutterflow export-code --project your_project_id --dest path_to_output_folde --no-include-assets --token your_token`

Expand All @@ -71,13 +56,13 @@ To use the CLI, you'll need to create an API token and use it in your requests.
| --[no]-parent-folder | Option to download the code into a subfolder instead of directly into the directory. | False |
| --[no]-as-module | Whether to generate the project as a Flutter module. | False |
| --[no]-as-debug | Whether to generate the project with debug logging to be able to use FlutterFlow Debug Panel inside the DevTools. | False |
| --project-environment | Which [development environment](../development-environments/development-environments.md) to be used. If empty, the current environment in the project will be downloaded. | Current environment |
| --project-environment | Which [development environment](../../../testing-deployment-publishing/development-environments/development-environments.md) to be used. If empty, the current environment in the project will be downloaded. | Current environment |

## Filtered exports
### Filtered exports

If you are updating an existing project and do not want certain files to be overwritten during a code export, you can create a `.flutterflowignore` file in the root of your project directory. This file should contain a list of files to be ignored using globbing syntax.

### Example:
#### Example:
If your project is located at:
```
/Users/yourname/projects/my_flutterflow_app/
Expand All @@ -87,7 +72,7 @@ Then, place the `.flutterflowignore` file in:
/Users/yourname/projects/.flutterflowignore
```

### Example `.flutterflowignore` contents:
#### Example `.flutterflowignore` contents:
```
my_flutterflow_app/android/app/build.gradle # Prevents FlutterFlow from overwriting native Android build configuration
my_flutterflow_app/ios/Runner/Info.plist # Keeps iOS app metadata unchanged
Expand Down
Loading
Loading