Overview

The Assegai CLI is a command-line tool that can help you create, develop, and maintain Assegai applications. It provides assistance in various ways, including generating the initial project structure, serving the app in development mode, and creating a production-ready build of the application. It follows best practices in application architecture to encourage the development of well-structured apps.

Requirements

Installing the Assegai CLI is easy and straightforward, but there are a few requirements that need to be met before you can get started. Below, you'll find all the information you need to get up and running with the Assegai CLI.

First and foremost, you'll need to have Composer installed on your system. Composer is a dependency manager for PHP, and it is used to install the Assegai CLI and all its dependencies. If you don't have Composer installed already, you can download it from the official website.

In addition to Composer, you'll also need to have the following PHP extensions enabled on your system: curl, pdo, and json. These extensions are required for the Assegai CLI to function properly, and they must be enabled before you can proceed with the installation. If you're not sure if these extensions are enabled, you can check by running the following command:

$ php -m

This will display a list of all the extensions that are currently loaded in your PHP environment. Look for curl, pdo, and json in the list, and make sure they are marked as 'enabled'. If they are not, you'll need to enable them before you can proceed with the installation.

Once you have met these requirements, you're ready to proceed with the installation of the Assegai CLI.

Installation

Command line installation

  1. Download the installer by running the following command:

    $ php -r "copy('https://get.assegaiphp.com/installer', 'assegai-setup.php');"
  2. Verify the installer by running the following command:

    $ php -r "if (hash_file('sha384', 'assegai-setup.php') === '1f32221902245b796bb975e2e7768f3d0c4f2dac8b4eab2ef58d1591c063b5529b9eecf6ba4cc489c9f87b9af4a2a959') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('assegai-setup.php'); } echo PHP_EOL;"
  3. Run the installer by running the following command:

    $ php assegai-setup.php
  4. Remove the installer by running the following command:

    $ php -r "unlink('assegai-setup.php');"
  5. Make the installer executable

    $ sudo chmod +x assegai.phar

To make the Assegai CLI available globally, you can move the assegai.phar file to a directory on your PATH by running the following command:

$ sudo mv assegai.phar /usr/local/bin/assegai

Coming soon.

Coming soon.

Basic workflow

After installing the Assegai CLI, you can use it to run commands directly from your operating system's terminal using the assegai executable. To see a list of available assegai commands, enter the following in your terminal:

$ assegai --help

To get help on a specific command, use the following structure. Replace "generate" in the example below with the command you want to learn more about (e.g. new, add, etc.) to get detailed help for that command:

$ assegai generate --help

To create, build, and run a new basic Assegai project in development mode, navigate to the folder where you want to create the project and run the following commands:

$ assegai new my-assegai-project
$ cd my-assegai-project
$ assegai serve

To see the new application running, open your web browser and go to http://localhost:5000.

Tip You can change the default port by editing the port property in the assegai.json file.

Project structure

When you run assegai new, the Assegai CLI creates a new folder and generates a starter set of files for a new project. You can then build upon this default structure by adding additional components as needed. This default project structure is referred to as "standard mode." You can find more information about this structure and how to work with it throughout the documentation.

CLI command syntax

All Assegai commands have the same general structure:

$ assegai <command-or-alias> <required-arg> [optional-arg] [options]

For example:

$ assegai new my-assegai-project --dry-run

Command overview

To view command-specific options for any of the following commands, run assegai <command> --help:

For detailed descriptions of each command, refer to the usage instructions.

Command Alias Description
new n Generates a new standard mode application with all the necessary starter files to run the app.
generate g Creates or modifies files based on a predefined template.
serve Starts the HTTP development server.
add Installs a library that has been packaged as an assegai library and runs its installation schematic.
info i Shows information about installed Assegai packages and other useful system information.