Installation

Install the SecretStash CLI package for secure variable management in Laravel or any PHP application.

The SecretStash CLI works with any PHP project. Choose the installation path that matches your framework:

  • Laravel: Install as an Artisan package with full service-provider integration.
  • Standalone (any PHP project): Install via Composer and use the vendor/bin/secret-stash binary.

Requirements

  • PHP 8.2+
  • Composer
  • A SecretStash API token and Application ID

Laravel Installation

Install the CLI package

Install the Composer package in your Laravel app:

composer require dniccum/secret-stash-cli

Run the installer. It will optionally publish a config file and generate an encryption key stored locally for securing your variables.

php artisan secret-stash:install

Configure environment variables

Add the following to your app's .env:

SECRET_STASH_API_TOKEN=your_token_here
SECRET_STASH_APPLICATION_ID=your_application_id_here
  • Create an API token in SecretStash (Profile → Tokens).
  • Create or select an Application in SecretStash and copy its ID.

Optional: Publish config

If you want to customize behavior, publish the config file:

php artisan vendor:publish --tag=secret-stash-config

This creates config/secret-stash.php where you can set ignored variables, override the API URL, and more. See Configuration for details.

Standalone Installation (Non-Laravel)

Install the CLI package

Install the Composer package in your PHP project:

composer require dniccum/secret-stash-cli

Run the installer using the standalone binary:

vendor/bin/secret-stash secret-stash:install

Configure environment variables

Add the following to your project's .env file:

SECRET_STASH_API_TOKEN=your_token_here
SECRET_STASH_APPLICATION_ID=your_application_id_here
  • Create an API token in SecretStash (Profile → Tokens).
  • Create or select an Application in SecretStash and copy its ID.

Next steps