Frontastic CLI is the central entry point for frontend development with Frontastic without the need for a Development Machine or a Virtual Machine. It's possible to run webpack, which prepares all frontend code, directly on the Developer machine and everything else in the Cloud (in the proof-of-concept that's a Docker container on the local machine).
You'll have problems if you run Frontastic CLI in the same checkout as a container/VM. You need to do a clean Git checkout of your project. Also, Frontastic CLI requires that there's no container/VM with Frontastic running on your machine when using it.
To get Frontastic CLI running on your system, you'll need the latest version of Yarn. Then follow the steps below:
chmod +x ./frontastic). On macOS, you'll also have to allow executing it.
./frontastic initin the root directory of your code repository checkout. This will generate a
frontastic.tomlfile which looks like this:
hosts = ["<project>-<customer>.frontastic.io.local"] remoteserveraddress = "<staging-host>" remoteservertls = true yarndir = "<customer>_<project>"
The init step will ask you these variables as questions. Your
remoteserveraddress is usually your staging server (without
yarndir correspond to your daily work environment.
If you're using a Frontastic Machine along with Frontastic CLI, the
.toml file will automatically be available to download in the Editor. See this article for more info.
yarn installin the root directory of your code repository checkout
sudo ./frontastic start
When you're done for the day, you can stop the development service by hitting
<Ctrl>-<C> and then stop the router as superuser doing
sudo ./frontastic stop.
Since you're not running a local backend server, any changes to the PHP code or configuration files like
project.yml won't have immediate effect. These changes need to be deployed to Staging first.
To be able to change PHP code without deploying, you can enable file synchronization to the remote server. To do this:
frontastic.tomlspecifying your Frontastic Machine hostname:
frontasticMachineHostname = "your-awesome-machine.frontastic.dev"
sudo ./frontastic startand
./frontastic runto do frontend development and have changes synced to the remote machine or use
./frontastic filesyncto only start the syncing to the remote machine and doing PHP development. See this article for the full steps.
#before the line).
Unfortunately, Frontastic CLI doesn't work on Windows. If you're using Windows, you can use a Frontastic Machine instead.
macOS refuses to start Frontastic CLI
If you get a message saying that the application can't be started because the developer can't be verified, you have to allow the application in the General tab of the Security & Privacy settings in your System Preferences. See here for more info.
Yarn has errors on installation
Are you sure you did a fresh checkout after using a container/VM? If not, please do so. Or you can remove all
node_modules folders (even those in
paas/...) and try again.
Frontastic CLI claims ports are in use
You might have a Frontastic container/VM running in another directory. Make sure this is shut down properly using
vagrant halt in the directory in question. Another reason might be that you have a webserver running locally on port
80 please shut this down before starting the Frontastic CLI.
‹ Back to Article List