Frontastic CLI commands

Here, you'll find all the commands you need to work with the Frontastic CLI. We've listed them in the order you'll need them, followed by any other commands that may be helpful. We've also explained what each of them does.

See the Frontastic CLI article for full steps on how to work with the Frontastic CLI.

πŸ‘

Prerequisites

  • Homebrew installed locally for macOS or Linux
  • scoop installed locally for Windows
  • Node installed locally (version 14-16)
  • Yarn installed locally (version 1.22+)
  • Access to your company's GitHub customer repository
  • Access to your company's project in the Frontastic studio

Install

brew tap frontasticgmbh/tap && brew install frontastic-cli
scoop bucket add FrontasticGmbH_scoop-bucket https://github.com/FrontasticGmbH/scoop-bucket
scoop install frontastic-cli

We use Homebrew to install the Frontastic CLI so this command asks Homebrew to do that.

Create config

frontastic init

Once you've run this command, you'll be asked a series of questions about how you'll be developing with Frontastic. The answers give the CLI a config which it outputs as a TOML file in your project folder called frontastic.toml.

If you want to change your configuration at any time, you can run this command again.

If you're using a Frontastic sandbox, you can use the below flag to skip some of the questions as they'll automatically be done for you:

frontastic init --sandbox <your-sandbox-name>

Start CLI

frontastic run

When you use this command, the CLI starts all the necessary processes for development in your project.

It may ask you for your sudo password, this is needed as the CLI updates your /etc/hosts file and that needs superuser rights.

This will start a dashboard and give you the necessary information you need. See the Frontastic run dashboard section for more information.

Update version

brew upgrade frontastic-cli
scoop update frontastic-cli

If that doesn't work for any reason, you can use the below command instead

brew tap frontasticgmbh/tap && brew upgrade frontastic-cli

You can run this command at any time to make sure you're running the latest version of the Frontastic CLI. We're always making improvements so we recommend you run this command at least once a week. You can also visit our Frontastic CLI changelog to see the latest updates.

Other commands

frontastic ssh

You can SSH into the Frontastic sandbox you're using with this command.

frontastic generate

The generate command creates the main files needed when building Frontastic components. See the Frontastic CLI generate command article for steps on how to use it.

frontastic help

The help command gives you the list of the commands in this article.

frontastic pull

Manually trigger replication of changes made in the studio to the sandbox. This is the same as opening an SSH connection to the sandbox and calling paas/replicator/bin/pull there.

frontastic xdebug

If you're using a Frontastic sandbox for your development, the xdebug command can be used to open an SSH tunnel to the machine and you can then use it with Xdebug.

Flags

frontastic --version

The version flag outputs the version number of the Frontastic CLI that you're using.

frontastic [command] --help

Use the help flag on any command to get information on what that command does, it's the same as what's in this article.

Frontastic run dashboard

When you run frontastic run, you'll see our dashboard.

Here, you can see the current status of the processes it's running as you're using the CLI, so you can easily see when a process stops working or a connection is lost.

The error section will highlight the number of unread errors within the webpack, SSR compiler, and SSR server. To see the error, you can use the hotkeys to go to the window where the error is occurring to find out more information. When you go back to the dashboard, the unread errors will be reset.

The Startup checks section shows you the initial setup of the CLI processes.

The Test URL is where you can see the site you're working on.

Hotkeys
When you're on the dashboard, you can use the below hotkeys:
d – dashboard
t – opens your test URL in a browser
w – webpack log
c – SSR compiler log
s – SSR server log
f – filesync issue log
ctrl-c – Exits the CLI (if using Windows, you many need to type exit instead)

When you're in the logs, you can use the below hotkeys to navigate through the logs:
h or left arrow – move left
l or right arrow – move right
j or down arrow – move down
k or up arrow – move up
g or home – moves to the top of the page
G or end – moves to the bottom of the page
ctrl-f or page down – moves down 1 page
ctrl-b or page up – moves up 1 page
ctrl-l – saves the current log window to CSV file

In the sandbox log view (s), you can filter messages by a search term (press / and type the term) or by regular expression (press r and type the regular expression, an invalid or incomplete expression will turn red). Messages from our internal API hub are filtered out by default. To change that, press a. To see additional details for the selected log message, press Enter.