Libxa Installer
One command to start.
- Version
- 1.0.0
- Category
- Developer tools
- Requires
- Nothing. PHP 8.3 and Composer for what it creates.
irm https://raw.githubusercontent.com/libxa-framework/libxa-installer/main/scripts/install.ps1 | iex
One command to create an application.
libxa new my-app
It asks which database you want, runs composer create-project libxa/libxa,
then does the parts everyone does by hand afterwards: .env configured for the
driver you chose, the application key generated, front-end dependencies
installed if you want them, a git repository with a first commit, and a list of
what to run next.
Installing
Windows
irm https://raw.githubusercontent.com/libxa-framework/libxa-installer/main/scripts/install.ps1 | iex
macOS and Linux
curl -fsSL https://raw.githubusercontent.com/libxa-framework/libxa-installer/main/scripts/install.sh | sh
Both install for the current user and add the command to your PATH. Neither needs administrator rights or sudo. Open a new terminal afterwards.
The installer is a self-contained executable, so it needs nothing installed to run. What it creates needs PHP 8.3 and Composer.
Options
| Option | What it does |
|---|---|
--database=DRIVER |
sqlite, mysql, mariadb or pgsql. Asked for when omitted. |
--dev |
Install the development branch. |
--force, -f |
Replace the directory if it exists. |
--git |
Initialise a repository and make the first commit. |
--branch=NAME |
Branch for that commit. Defaults to your init.defaultBranch. |
--github[=VISIBILITY] |
Create a GitHub repository and push. Private unless told otherwise. |
--organization=NAME |
Create it in an organization. |
--npm |
Install front-end dependencies and build the assets. |
libxa new my-app --database=mysql --git --npm
libxa new my-app --github=public --organization=my-team
libxa new .
Only three lines of .env change
Worth explaining, because getting it wrong is invisible until it matters.
create-project runs the skeleton's post-install scripts, one of which is
php libxa key:generate, writing APP_KEY into the .env it has just copied.
If the installer then wrote a fresh .env for your chosen database, that key
would be gone. Nothing would complain. The application would boot, serve pages,
and fail the first time it touched an encrypted cookie.
So only DB_DRIVER, DB_PORT and DB_DATABASE are rewritten, in place. There
is a test whose only job is to assert the generated key is still there
afterwards.
No dependencies
The installer has none at all. It is the first thing someone runs, on a machine nobody has tested, and every dependency is another way for that first step to fail. It also means the whole tool freezes cleanly into one executable with nothing to resolve at install time.