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

You can use the Frontstack CLI in two ways:

  1. Install the CLI globally (enables the frontstack command)
  2. Use npx to run the CLI (recommended)
# After installing, the `frontstack` command will be available globally
npm install -g @frontstackdev/cli

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 login
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.

frontstack logout

project

Select the current working project which will be used for schema and client updates.

frontstack project

-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.

frontstack generate

Options:

OptionDescription
-s, --persist-oasPersist OpenAPI specification file after generation
-e, --envPass an environment alias like “develop” or “preview”
-o, --outputOutput path for generated files(default: “.frontstack”)
-v, --verboseEnable verbose output and error messages

info

Display information about the current organization, project, and user.

frontstack info

help

Display help for a specific command.

frontstack help <command>