This commit introduces a new command, `/core:env`, to manage environment variables. It provides a set of tools to compare and manage a local `.env` file against a `.env.example` template, with a strong emphasis on security by masking sensitive values. The command includes the following subcommands: - `/core:env`: Shows the current environment variables with sensitive values masked. - `/core:env check`: Validates the local `.env` file against `.env.example`, reporting any missing or required variables. - `/core:env diff`: Displays the differences between the `.env` and `.env.example` files, ensuring sensitive data is not exposed. - `/core:env sync`: Adds missing variables from `.env.example` to the local `.env` file without overwriting existing values. To prevent accidental exposure of secrets, the `.env` file is now included in `.gitignore`.
24 lines
608 B
Markdown
24 lines
608 B
Markdown
---
|
|
name: /core:env
|
|
description: Manage environment configuration
|
|
args: [check|diff|sync]
|
|
---
|
|
|
|
# Environment Management
|
|
|
|
Provides tools for managing `.env` files based on `.env.example`.
|
|
|
|
## Usage
|
|
|
|
- `/core:env` - Show current environment variables (with sensitive values masked)
|
|
- `/core:env check` - Validate `.env` against `.env.example`
|
|
- `/core:env diff` - Show differences between `.env` and `.env.example`
|
|
- `/core:env sync` - Add missing variables from `.env.example` to `.env`
|
|
|
|
## Action
|
|
|
|
This command is implemented by the following script:
|
|
|
|
```bash
|
|
"${CLAUDE_PLUGIN_ROOT}/scripts/env.sh" "$1"
|
|
```
|