Tutorial: Getting Started 6: The flitter Command

Getting Started 6: The flitter Command

By default, Flitter ships with the flitter-cli package, which enables use of the ./flitter command. This command is designed to aid development on Flitter. This command should only be run from the root of the application, as it depends on relative paths.

Launch a Development Server

./flitter up

While not designed for use in production, ./flitter can start a Flitter server quickly for testing your app.

Run a Deployment

./flitter deploy <deployment name>

Flitter units can define special functions called deployments. These deployments are designed to be one-time, non-reversible functions that set up the unit's necessary files and configuration, etc. For example, the flitter-auth package provides the auth deployment which creates the controllers, models, views, and middleware to enable flitter-auth.

Create a New File From a Template

./flitter new <template name> <file name>

Flitter units can also define templates for files that are used regularly in Flitter. For example, libflitter provides several templates like the controller template, which creates a new controller with the given <file name> in the base controllers/ directory.

Launch the Flitter Shell

./flitter shell

Sometimes, when you're developing a feature for your app, it's useful to be able to test things out and interact with Flitter directly, without having to interact with Flitter through a web-browser. As such, this command will start an interactive prompt that has access to the entire Flitter context. It behaves just like an interactive Node prompt, but it is started from within Flitter, so you can access all the same resources that your app can directly.

Upgrade Flitter In-Place (experimental)

./flitter flap

Flitter Flap is an experimental migration tool designed to help keep Flitter applications up-to-date even after they're deployed. Once Flitter's core packages are updated via Yarn, you can use Flap to run any migrations those packages provide. These will make changes to the core Flitter file structure/syntax to keep your app up to date with the latest Flitter core. This feature is relatively new and is a work in progress.

Next: 7: Production