Studio and the command line
Every action in Studio runs a real php flo or composer command in the project, and Studio shows the command. Nothing Studio does needs Studio: you can type the same commands in a terminal, and a project made in Studio works without it.
How Studio runs commands
php flocommands run with the project's ownflolauncher (orvendor/bin/flo), in the project folder.- Studio adds
--no-interactionand--no-ansito every command, so none waits for an answer. Composer'screate-project,require,installandupdatealso get--no-progress. The commands on screen leave these options out. - The project's
.envdecides what the commands see: Studio removes the environment variables.envsets from the command's environment. - Studio runs only the commands in its own list. It never runs a Composer command on another folder (
--working-dir).
What Studio runs
| What you do in Studio | The command it runs | Framework docs |
|---|---|---|
| Create the project (new project) | composer create-project hostkurd/flocms <name> |
Installation |
| What you're building (new project) | php flo setup --as=site-admin (or admin, api-admin, api) |
Choose what you build |
| Also add the JSON API (new project) | composer require hostkurd/flocms-api, then php flo api:install |
Add an API later |
| Check the database (new project, MySQL) | php flo db:check |
Checking the connection |
| First admin (new project) | php flo user:create --name=… --email=… --role=super-admin --password-stdin |
Creating users |
| Start server | php flo serve --port=8000 --host=127.0.0.1 |
Start a local server |
| Clear cache | php flo cache:clear |
Cache |
| Optimize | php flo optimize |
Cache |
| Doctor tab | php flo doctor --format=json |
Check your installation |
| Admin panel checks | php flo admin:doctor |
Admin commands |
| Database tab: connection and tables | php flo db:show --format=json |
Database commands |
| Database tab: migrations | php flo migrate:status |
Running migrations |
| Open in admin links | php flo admin:list |
Admin commands |
| Run migrations | php flo migrate (production: --force) |
Running migrations |
| Roll back last batch | php flo migrate:rollback (production: --force) |
Running migrations |
| Seed… | php flo db:seed (production: --force) |
Running seeders |
| Drop all and migrate… | php flo migrate:fresh --force |
Database commands |
| Generate: admin resource | php flo make:admin-resource <Name> … |
Resources |
| Generate: admin page | php flo make:admin-page <Name> … |
Custom pages |
| Generate: block | php flo make:admin-block <Name> |
Builder |
| Generate: widget | php flo make:admin-widget <Name> … |
Dashboard widgets |
| Generate: controller | php flo make:controller <Name> … |
Generators |
| Generate: migration | php flo make:migration <name> … |
Creating a migration |
| Packages tab, Check for updates | composer outdated --direct --all --format=json |
Framework and packages |
| Update a package | composer require "<package>:^<version>" -W, then php flo admin:install or php flo api:install (when it is one of those), then php flo migrate --force |
Upgrade guide |
| Add the admin panel | composer require hostkurd/flocms-admin -W, php flo admin:install, php flo migrate --force |
Add the admin panel later |
| Add the API | composer require hostkurd/flocms-api -W, php flo api:install, php flo migrate --force |
Add an API later |
Two steps of a new project are not commands: Studio writes .env itself, and on its own MariaDB it makes the database and user with SQL. See Your first project.
Studio's own options
The Studio program takes a few options of its own:
flocms-studio --version # the version and build details
flocms-studio --help # every option
On Windows the program is Studio.exe; on macOS it is inside FloCMS Studio.app. The About page has Copy version info with the same details.