dniccum/secret-stash-cli

A PHP-based Composer package to interact with the SecretStash environment variable service.

Maintainers

Package info

github.com/dniccum/secret-stash-cli

pkg:composer/dniccum/secret-stash-cli

Fund package maintenance!

dniccum

Statistics

Installs: 56

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 2


README

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

SecretStash

SecretStash CLI

A Laravel Composer package that provides Artisan commands for interacting with the SecretStash REST API. Manage your environment variables directly from the command line with an intuitive, interactive interface.

Requirements

  • PHP 8.2 or higher
  • Laravel 11 or higher
  • A SecretStash API Key

Installation

Install the package via Composer:

composer require dniccum/secret-stash-cli

Run the installer to publish the configuration file and generate the encryption keys used to secure your variables:

php artisan secret-stash:install

Important

This package creates a ~/.secret-stash directory on your machine (or the path specified by the SECRET_STASH_KEY_DIR environment variable). Ensure this folder is secure as it contains the keys required to decrypt your environment variables.

Configuration

Add the following environment variables to your application's .env file:

SECRET_STASH_API_TOKEN=your_token_here
SECRET_STASH_APPLICATION_ID=your_application_id_here
  • API Key: Create a token in SecretStash by navigating to your profile settings and accessing the "Tokens" tab.
  • Application ID: Create or select an application in SecretStash and copy its ID from the dashboard.

Note

Both the API key and Application ID are required. The CLI will throw an error if either is missing.

Quick Example

Pull your environment's variables from SecretStash into your local .env file:

php artisan secret-stash:variables pull

Push your local .env variables to SecretStash:

php artisan secret-stash:variables push

For the full list of available commands and options, visit the SecretStash CLI documentation.

Testing

composer test

or:

./vendor/bin/pest

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Credits

License

The MIT License (MIT). Please see License File for more information.