Skip to content

Artisan Commands

netsons:install

Interactive setup wizard for configuring the deployment.

Usage

Terminal window
php artisan netsons:install [--strategy=ftp|git] [--force]

Options

OptionDescription
--strategy=ftp|gitSet the deployment strategy (skips interactive prompt)
--forceOverwrite existing config and workflow files without asking
--no-interactionRun non-interactively (defaults to FTP if no strategy given)

What it does

  1. Publishes config/netsons-deploy.php with the selected strategy
  2. Auto-detects env variables from .env.example:
    • Secret-backed (DB_DATABASE, DB_PASSWORD, MAIL_, REDIS_PASSWORD, AWS_) — presented via multiselect
    • Static (SESSION_DRIVER, LARAVEL_PDF_DRIVER, any project-specific key with a non-placeholder value) — presented via multiselect, then each value can be edited
  3. Prompts for build env vars, custom commands, Slack notifications, and envaudit
  4. Generates .github/workflows/deploy.yml with all placeholders replaced
  5. Displays required GitHub Secrets for the chosen strategy
  6. Displays required GitHub Variables
  7. Shows next steps

Workflow generation

The installer creates .github/workflows/deploy.yml from a stub template, replacing all placeholders with values derived from your config and netsons-deploy.json:

  • %%STRATEGY%% — the selected strategy (ftp or git)
  • %%PHP_VERSION%% — derived from the php_binary config (e.g., ea-php84 becomes 8.4)
  • %%NODE_VERSION%% — defaults to 22
  • %%PACKAGE_MANAGER%% — defaults to yarn
  • %%REMOTE_PHP%% — the remote PHP binary path from config
  • %%RELEASES_KEEP%% — number of releases to keep from config
  • %%FTP_SERVER_DIR%% — computed from ftp.root_path config
  • %%BUILD_ENV%% — build environment variables from netsons-deploy.json
  • %%ENV_MAPPING_ENV_BLOCK%% — secret references from netsons-deploy.json
  • %%ENV_MAPPING_SED_BLOCK%% — sed commands for env updates
  • %%SEEDERS%% — first-deploy seeder commands from config
  • %%CUSTOM_COMMANDS%% — custom artisan commands from netsons-deploy.json
  • %%NOTIFICATIONS%% — Slack notification steps from netsons-deploy.json
  • %%ENVAUDIT%% — envaudit validation step from netsons-deploy.json

If .github/workflows/deploy.yml already exists, it is preserved unless --force is used.

Switching strategies

To switch from FTP to Git:

Terminal window
php artisan netsons:install --strategy=git --force

This overwrites the config file, regenerates the workflow, and updates the strategy default.

Re-running safely

Without --force, the installer will:

  • Interactive mode — ask before overwriting an existing config
  • Non-interactive mode — skip the config overwrite but still generate the workflow if missing

When reconfiguring netsons-deploy.json, the file is reset to defaults before collecting new values — this prevents stale entries from a previous configuration.


netsons:check

Shows your local configuration and deployment readiness.

Usage

Terminal window
php artisan netsons:check

Output

The command displays:

  • Configuration — local settings (strategy, SSH port, PHP binary, deploy path, releases keep)
  • Workflow status — whether .github/workflows/deploy.yml exists
  • Required Secrets — GitHub secrets needed for the configured strategy
  • Required Variables — GitHub variables needed
  • Local validation — checks local config values (deploy path)
  • Credentials reminder — note that SSH, FTP, and Git credentials are configured via GitHub Secrets/Variables, not locally

What it does NOT check

The check command does not validate SSH, FTP, or Git credentials. These values are stored as GitHub Secrets/Variables and are only available at deploy time in GitHub Actions. See GitHub Secrets for setup instructions.


netsons:env

Manage custom environment variables for deployment without editing the workflow manually.

Usage

Terminal window
php artisan netsons:env [action]

Actions

ActionDescription
list (default)Show all configured variables
addAdd a new variable (interactive)
removeRemove a variable (interactive)

List variables

Terminal window
php artisan netsons:env
# or
php artisan netsons:env list

Shows all configured variables grouped by type: secret-backed, static, build, custom commands, and notifications.

Add a variable

Terminal window
php artisan netsons:env add

Interactive prompts guide you through:

  1. Variable type — Secret-backed (from GitHub Secrets), Static (fixed value), or Build (for asset build)
  2. Variable name — The .env key (e.g., DB_PASSWORD)
  3. Value or secret name — Depending on the type

If the variable already exists, you’ll be asked whether to update it.

Remove an item

Terminal window
php artisan netsons:env remove

Shows a list of all configured items — env variables (secret-backed, static, build), custom commands, and Slack notifications — and lets you pick which to remove. Select Cancel to abort.

After changes

After adding or removing variables, regenerate the workflow:

Terminal window
php artisan netsons:install --force

Examples

Terminal window
# Add a database password from GitHub Secrets
php artisan netsons:env add
# → Secret-backed → DB_PASSWORD → DB_PASSWORD
# Add a static config value
php artisan netsons:env add
# → Static → SESSION_DRIVER → database
# Add a Vite build variable
php artisan netsons:env add
# → Build → VITE_APP_NAME → My Application
# View all configured variables
php artisan netsons:env list
# Remove a variable
php artisan netsons:env remove