Frontstack CLI
The Frontstack CLI is a command-line interface for interacting with your Frontstack Account and generating project-specific files, such as the Client SDK
Setup
Video Tutorial 🎬
Video Tutorial 🎬
You can use the Frontstack CLI in two ways:
- 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 your package.json
file), so the CLI can place the generated files correctly.
.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.
.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 --env
option to generate a client for a specific environment
or select it interactively.
Options:
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 |
info
Display information about the current organization, project, and user.
help
Display help for a specific command.