Small bash utility for Laravel + Docker workflows (works locally or in Codespaces). Designed for bash/zsh; avoids PowerShell.
- Install the
nfutilsCLI into$HOME/binwith bash/zsh auto-completion - Laravel helpers:
laravel createto bootstrap a project in Docker,laravel initto install Sail and configure database - Composer passthrough that runs inside Docker
- Cleanup commands:
destroyerwipes the current directory;nukestops Docker, removes containers/images/volumes/networks, then wipes the current directory (double confirmation) - Self-manage:
nfutils updateandnfutils uninstall
- Docker CLI and daemon running; Docker Compose plugin available
bashorzshif you want completionspython3available (used to update.envand compose files duringlaravel init)
Download and run the installer:
curl -fsSL https://raw.githubusercontent.com/neflalabs/nfutils/main/nfutils.sh | bashThen reload your shell:
source ~/.zshrc # for zsh
source ~/.bashrc # for bashnfutils laravel create <dir|.> Create new Laravel project inside Docker
nfutils laravel init [-p PORT] [-db|--database DRIVER] Install Laravel Sail + alias `sail`
nfutils composer <args> Run Composer in Docker
nfutils destroyer Delete all files in current dir ⚠️
nfutils nuke ☢️ Full cleanup (2x confirm)
nfutils update Update nfutils from GitHub
nfutils uninstall Remove nfutils from your system
nfutils version | -v Show version + author/repo
nfutils help Show help message
| Option | Description |
|---|---|
-p, --port PORT |
Set APP_PORT in .env (e.g., -p 8080) |
-db, --database DRIVER |
Set database driver: mysql, pgsql, or sqlite |
What it does:
- Updates
.envwith correct DB_* values - Toggles DB services in compose file (
compose.yamlpreferred) - Selected DB service is enabled; others are commented out
- Sail alias
sailis added to your shell profile automatically
Example:
# Create new Laravel project
nfutils laravel create myapp
cd myapp
# Initialize with PostgreSQL on port 8080
nfutils laravel init -p 8080 -db pgsql
# Start containers
sail up -dRun nfutils update to pull the latest script from GitHub.
Versioning uses timestamp + git commit format:
v2025-12-08T15:22:24Z-gc9dfbaf-local
Installer automatically sets up completions:
| Shell | Location |
|---|---|
| Bash | ~/.bash_completion.d/nfutils |
| Zsh | ~/.zsh/completions/_nfutils |
Reload your shell or source your rc file to activate completions.
Note: The
sailalias is managed within the nfutils completion block, sonfutils uninstallcleans it up automatically.
If you want to contribute or modify nfutils:
-
Clone the repo:
git clone https://github.com/neflalabs/nfutils.git cd nfutils -
Source structure (not included in releases):
src/- Source modules (installer, CLI components, completions)scripts/- Build scripts
-
Build the distribution script:
bash scripts/build.sh
This concatenates all source modules into
nfutils.shwith proper version stamping. -
Test locally:
./nfutils.sh # Run installer nfutils help # Test installed CLI
MIT License - see LICENSE
Author: NeflaLabs
Repository: https://github.com/neflalabs/nfutils