
Setup
Video Tutorial 🎬
Video Tutorial 🎬
- Install the CLI globally (enables the
frontstack
command) - Use
npx
to run the CLI (recommended)
Which option should I choose?
Which option should I choose?
- Global Installation: Choose this if you want to run the CLI commands frequently and pin them to a specific version. That way you need to update the CLI manually.
- npx: Choose this if you only need to run the CLI commands occasionally. You will always run the latest version of the CLI (or the one cached by your package manager - so be aware of that).
Commands
login
Login to your Frontstack account. In most cases, you want to login from your current project directory (wherever you have yourpackage.json
file), so the CLI can place the generated files correctly.
This command will open a browser window to complete the login process. It will create a new token and store it in your
.frontstack-local/
directory.
This directory should be added to your .gitignore
file to prevent sensitive information from being committed to your repository.logout
Logout from your Frontstack account.project
Select the current working project which will be used for schema and client updates.-p
, --project-id
: The id of the project to select.
The project will also be stored in your
.frontstack-local/
directory.generate
Generate a JavaScript client for the current project.Advanced Usage (environments)
Advanced Usage (environments)
If you are working with multiple environments, you can pass the or select it interactively.
--env
option to generate a client for a specific environmentfrontstack
frontstack
Option | Description |
---|---|
-s , --persist-oas | Persist OpenAPI specification file after generation |
-e , --env | Pass an environment alias like “develop” or “preview” |
-o , --output | Output path for generated files(default: “.frontstack”) |
-v , --verbose | Enable verbose output and error messages |