Commands
flux init
Initialize a new Flux project with a basic configuration and structure.
Overview
The flux init
command initializes a new project with a predefined structure, configuration file, and optionally a default package.json.
It’s the fastest way to get started with Flux in any JavaScript/TypeScript project.
Usage
flux init <project-name>
Arguments
<project-name>
(optional): Name of the project directory to create. If not provided, the current directory is used.
Example
flux init my-app
This will create a new directory my-app
with the following structure:
index.js
app.js
flux.config.js
package.json
README.md
What it Does
Creates a Project Directory
If a <project-name>
is specified, a new folder is created with that name.
Generates Default Files
Generates flux.config.js
and a starter package.json
with basic config.
Adds Starter Code
A simple src/index.js
file is included to help you start quickly.
Related Commands
flux install
– Install packages after initializingflux run
– Run your project scripts
Tip
You can run flux init
in an existing project directory to just generate flux.config.js
without overwriting existing files.