https://github.com/dniccum/secret-stash-cli
A PHP-based Composer package to interact with the SecretStash environment variable service
https://github.com/dniccum/secret-stash-cli
composer environment laravel secretstash variable
Last synced: 26 days ago
JSON representation
A PHP-based Composer package to interact with the SecretStash environment variable service
- Host: GitHub
- URL: https://github.com/dniccum/secret-stash-cli
- Owner: dniccum
- License: mit
- Created: 2025-11-21T03:13:20.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2026-03-24T02:50:15.000Z (about 1 month ago)
- Last Synced: 2026-03-24T11:14:14.804Z (about 1 month ago)
- Topics: composer, environment, laravel, secretstash, variable
- Language: PHP
- Homepage: https://docs.secretstash.cloud/command-line-interface
- Size: 324 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE.md
Awesome Lists containing this project
README
[](https://packagist.org/packages/dniccum/secret-stash-cli)
[](https://github.com/dniccum/secret-stash-cli/actions?query=workflow%3Arun-tests+branch%3Amain)
[](https://github.com/dniccum/secret-stash-cli/actions?query=workflow%3A"Fix+PHP+code+style+issues"+branch%3Amain)
[](https://packagist.org/packages/dniccum/secret-stash-cli)

# SecretStash CLI
A Laravel Composer package that provides Artisan commands for interacting with the [SecretStash](https://secretstash.cloud) 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:
```bash
composer require dniccum/secret-stash-cli
```
Run the installer to publish the configuration file and generate the encryption keys used to secure your variables:
```bash
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:
```dotenv
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:
```bash
php artisan secret-stash:variables pull
```
Push your local `.env` variables to SecretStash:
```bash
php artisan secret-stash:variables push
```
For the full list of available commands and options, visit the [SecretStash CLI documentation](https://docs.secretstash.cloud/command-line-interface/commands).
## Testing
```bash
composer test
```
or:
```bash
./vendor/bin/pest
```
## Changelog
Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.
## Contributing
Please see [CONTRIBUTING](CONTRIBUTING.md) for details.
## Credits
- [Doug Niccum](https://github.com/dniccum)
- [All Contributors](../../contributors)
## License
The MIT License (MIT). Please see [License File](LICENSE.md) for more information.