Skip to content

Commit e084711

Browse files
committed
Refactor: Replace --stage with --env throughout codebase
- Changed all command options from --stage to --env for consistency - Updated Settings class to use 'envs' property instead of 'stages' - Renamed all stage-related methods and properties to use env terminology - Updated Vue components and API endpoints to use env instead of stage - Refactored shell commands and tab completion for env terminology - Updated all documentation to reflect the new --env option - Renamed component files (VaultStageSelector -> VaultEnvSelector, etc.) - All 653 tests passing with zero failures
1 parent d6eaaf2 commit e084711

150 files changed

Lines changed: 2123 additions & 2115 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
- **🔐 Multi-Vault Support** - AWS SSM Parameter Store and AWS Secrets Manager
1212
- **🖥️ Web UI** - Modern browser-based interface for visual secret management
1313
- **🚀 Interactive Shell** - Context-aware shell with tab completion for rapid secret management
14-
- **🌍 Environment Isolation** - Separate secrets by stage (local, staging, production)
14+
- **🌍 Environment Isolation** - Separate secrets by environment (local, staging, production)
1515
- **📝 Template Management** - Create, validate, and process templates with placeholders
1616
- **🔄 Bulk Operations** - Import, export, copy, and diff secrets across environments
1717
- **🤝 Team Collaboration** - Share secret management with proper access controls
@@ -31,19 +31,19 @@ composer require stechstudio/keep
3131
./vendor/bin/keep shell
3232

3333
# Set a secret
34-
./vendor/bin/keep set DB_PASSWORD "secret" --stage=production
34+
./vendor/bin/keep set DB_PASSWORD "secret" --env=production
3535

3636
# Export to .env
37-
./vendor/bin/keep export --stage=production --file=.env
37+
./vendor/bin/keep export --env=production --file=.env
3838

3939
# Create template from existing secrets
40-
./vendor/bin/keep template:add .env.template --stage=production
40+
./vendor/bin/keep template:add .env.template --env=production
4141

4242
# Use template with placeholders to generate .env file
43-
./vendor/bin/keep export --stage=production --template=env/production.env --file=.env
43+
./vendor/bin/keep export --env=production --template=env/production.env --file=.env
4444

4545
# Runtime injection - execute with secrets, no .env file created
46-
./vendor/bin/keep run --vault=ssm --stage=production -- npm start
46+
./vendor/bin/keep run --vault=ssm --env=production -- npm start
4747
```
4848

4949
## Interactive Shell
@@ -86,10 +86,10 @@ Keep includes a modern web interface for visual secret management:
8686

8787
The Web UI provides:
8888
- **Visual secret management** with search and filtering
89-
- **Diff matrix view** comparing secrets across stages/vaults
89+
- **Diff matrix view** comparing secrets across environments/vaults
9090
- **Export functionality** with live preview
9191
- **Import wizard** for .env files with conflict resolution
92-
- **Settings management** for vaults and stages
92+
- **Settings management** for vaults and environments
9393
- **Real-time validation** and error handling
9494

9595
## Documentation

docs/TROUBLESHOOTING.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ location.reload()
6868
**Debug**:
6969
```bash
7070
# Test vault access via CLI
71-
keep list --vault=aws --stage=production
71+
keep list --vault=aws --env=production
7272

7373
# Check AWS credentials
7474
aws sts get-caller-identity
@@ -90,13 +90,13 @@ aws sts get-caller-identity
9090
#### Values Not Updating
9191
**Check**:
9292
- Changes saved successfully (check for errors)
93-
- Correct vault/stage selected
93+
- Correct vault/env selected
9494
- No caching (refresh page)
9595

9696
**Debug**:
9797
```bash
9898
# Verify via CLI
99-
keep get MY_SECRET --vault=aws --stage=prod
99+
keep get MY_SECRET --vault=aws --env=prod
100100
```
101101

102102
#### Masked Values Won't Unmask
@@ -169,15 +169,15 @@ DEBUG=1 keep server
169169
```bash
170170
# Test API directly
171171
curl -H "X-Auth-Token: <token>" \
172-
http://localhost:4000/api/secrets?vault=aws&stage=local
172+
http://localhost:4000/api/secrets?vault=aws&env=local
173173
```
174174

175175
## Performance Issues
176176

177177
### Slow Response Times
178178
**Optimize**:
179179
- Reduce number of secrets per vault
180-
- Use specific vault/stage combinations
180+
- Use specific vault/env combinations
181181
- Close unused browser tabs
182182

183183
### High Memory Usage
@@ -200,7 +200,7 @@ top -p $(pgrep -f "php.*server.php")
200200
- Test with `keep verify`
201201

202202
### "Secret not found"
203-
- Verify correct vault/stage
203+
- Verify correct vault/env
204204
- Check key exists
205205
- Ensure proper permissions
206206

docs/WEB_UI.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -32,22 +32,22 @@ The main Secrets view provides:
3232
- **Quick actions** menu for each secret:
3333
- Edit value
3434
- Rename key
35-
- Copy to different stage
35+
- Copy to different env
3636
- View history
3737
- Delete with confirmation
38-
- **Vault/Stage selector** to switch contexts
38+
- **Vault/Environment selector** to switch contexts
3939
- **Import wizard** for bulk importing from .env files
4040

4141
### Diff View
4242

43-
Compare secrets across stages and vaults:
43+
Compare secrets across envs and vaults:
4444
- **Matrix view** showing all secrets across selected environments
4545
- **Visual indicators**:
4646
- ✓ Present and matching
4747
- ⚠️ Present but different
4848
- ✗ Missing
4949
- **Inline editing** directly from diff cells
50-
- **Multi-select** for comparing specific vault/stage combinations
50+
- **Multi-select** for comparing specific vault/env combinations
5151
- **Export diff** to CSV for reporting
5252

5353
### Export
@@ -80,18 +80,18 @@ Manage Keep configuration:
8080
#### General Settings
8181
- Application name
8282
- Secret namespace prefix
83-
- Default vault and stage
83+
- Default vault and env
8484

8585
#### Vaults Management
8686
- Add new vault configurations
8787
- Edit existing vault settings
8888
- Test vault permissions
8989
- Delete unused vaults
9090

91-
#### Stages Management
92-
- Add custom stages
93-
- Remove stages (except system defaults)
94-
- Reorder stage priority
91+
#### Environment Management
92+
- Add custom envs
93+
- Remove envs (except system defaults)
94+
- Reorder env priority
9595

9696
## Navigation
9797

@@ -173,7 +173,7 @@ composer build
173173

174174
### Optimization Tips
175175
- Use search to filter large secret lists
176-
- Select specific vault/stage combinations in diff view
176+
- Select specific vault/env combinations in diff view
177177
- Export filtered results instead of all secrets
178178
- Close unused browser tabs (each maintains connection)
179179

docs/guide/aws-authentication.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ aws configure sso
8989
aws sso login --profile myproject
9090

9191
# Keep uses the SSO session automatically
92-
keep show --stage=local
92+
keep show --env=local
9393
```
9494

9595
### Production Environment
@@ -103,7 +103,7 @@ When running on EC2, ECS, or Lambda, use IAM roles:
103103
# The AWS SDK automatically uses the instance role
104104

105105
# In your deployment script:
106-
keep export --stage=production --output=.env
106+
keep export --env=production --output=.env
107107
php artisan config:cache
108108
```
109109

@@ -155,7 +155,7 @@ jobs:
155155
aws-region: us-east-1
156156

157157
- run: |
158-
vendor/bin/keep export --stage=production --output=.env
158+
vendor/bin/keep export --env=production --output=.env
159159
# Deploy your application
160160
```
161161
@@ -166,7 +166,7 @@ jobs:
166166
deploy:
167167
script:
168168
# Using GitLab's AWS integration
169-
- vendor/bin/keep export --stage=production --output=.env
169+
- vendor/bin/keep export --env=production --output=.env
170170
id_tokens:
171171
AWS_TOKEN:
172172
aud: https://gitlab.com

docs/guide/cli/index.md

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@ Keep's CLI is primarily designed for scripting, CI/CD pipelines, and automated d
2525
# GitHub Actions example
2626
- name: Deploy with secrets
2727
run: |
28-
keep run --vault=ssm --stage=production -- npm run deploy
28+
keep run --vault=ssm --env=production -- npm run deploy
2929

3030
# Jenkins example
31-
sh 'keep export --stage=production --file=.env --overwrite'
31+
sh 'keep export --env=production --file=.env --overwrite'
3232
sh 'docker build --secret id=env,src=.env .'
3333
sh 'rm -f .env' # Clean up
3434
```
@@ -40,10 +40,10 @@ sh 'rm -f .env' # Clean up
4040
keep copy --only="API_*" --from=staging --to=production
4141

4242
# Import from backup
43-
keep import backup.env --stage=disaster-recovery --overwrite
43+
keep import backup.env --env=disaster-recovery --overwrite
4444

4545
# Export filtered secrets
46-
keep export --stage=production --only="PUBLIC_*" --file=public.env
46+
keep export --env=production --only="PUBLIC_*" --file=public.env
4747
```
4848

4949
### Environment Provisioning
@@ -52,21 +52,21 @@ keep export --stage=production --only="PUBLIC_*" --file=public.env
5252
#!/bin/bash
5353
# Setup new environment with secrets
5454

55-
STAGE=$1
56-
if [ -z "$STAGE" ]; then
57-
echo "Usage: $0 <stage>"
55+
ENV=$1
56+
if [ -z "$ENV" ]; then
57+
echo "Usage: $0 <env>"
5858
exit 1
5959
fi
6060

6161
# Copy base configuration
62-
keep copy --only="*" --from=template --to=$STAGE
62+
keep copy --only="*" --from=template --to=$ENV
6363

6464
# Set environment-specific values
65-
keep set DATABASE_URL "postgres://db-$STAGE.internal/app" --stage=$STAGE --force
66-
keep set API_URL "https://api-$STAGE.example.com" --stage=$STAGE --force
65+
keep set DATABASE_URL "postgres://db-$ENV.internal/app" --env=$ENV --force
66+
keep set API_URL "https://api-$ENV.example.com" --env=$ENV --force
6767

6868
# Validate
69-
keep show --stage=$STAGE
69+
keep show --env=$ENV
7070
```
7171

7272
## Scripting Best Practices
@@ -76,16 +76,16 @@ keep show --stage=$STAGE
7676
#!/bin/bash
7777
set -euo pipefail
7878

79-
keep set API_KEY "$NEW_KEY" --stage=production --force
80-
keep run --stage=production -- npm run deploy
79+
keep set API_KEY "$NEW_KEY" --env=production --force
80+
keep run --env=production -- npm run deploy
8181
```
8282

8383
### Use Force Flags for Automation
8484
```bash
8585
# Avoid interactive prompts in scripts
86-
keep set KEY "value" --stage=production --force
87-
keep delete OLD_KEY --stage=staging --force
88-
keep export --stage=production --file=.env --overwrite
86+
keep set KEY "value" --env=production --force
87+
keep delete OLD_KEY --env=staging --force
88+
keep export --env=production --file=.env --overwrite
8989
```
9090

9191
### Validate Before Production Changes
@@ -100,10 +100,10 @@ keep copy --only="*" --from=staging --to=production --overwrite
100100
### Handle Secrets Securely
101101
```bash
102102
# Never log secret values
103-
keep show --stage=production # Masked by default
103+
keep show --env=production # Masked by default
104104

105105
# Clean up exported files
106-
keep export --stage=production --file=.env
106+
keep export --env=production --file=.env
107107
trap "rm -f .env" EXIT
108108
# ... use .env file ...
109109
```
@@ -114,13 +114,13 @@ For production deployments, use `keep run` to inject secrets without writing to
114114

115115
```bash
116116
# Laravel deployment
117-
keep run --vault=ssm --stage=production -- php artisan config:cache
117+
keep run --vault=ssm --env=production -- php artisan config:cache
118118

119119
# Node.js application
120-
keep run --vault=ssm --stage=production --template -- npm start
120+
keep run --vault=ssm --env=production --template -- npm start
121121

122122
# Docker compose
123-
keep run --vault=ssm --stage=production -- docker-compose up -d
123+
keep run --vault=ssm --env=production -- docker-compose up -d
124124
```
125125

126126
See [Deployment & Runtime](/guide/deployment/) for comprehensive deployment strategies.
@@ -136,7 +136,7 @@ For detailed command syntax and options, see the [CLI Command Reference](./refer
136136
| `keep set` | Create/update secrets | Initial setup |
137137
| `keep get` | Retrieve single secret | Debugging |
138138
| `keep show` | List all secrets | Verification |
139-
| `keep copy` | Copy between stages/vaults | Promotion |
139+
| `keep copy` | Copy between environments/vaults | Promotion |
140140
| `keep diff` | Compare environments | Pre-deployment check |
141141
| `keep import` | Import from files | Migration |
142142
| `keep export` | Export to files | Legacy apps |
@@ -151,29 +151,29 @@ For detailed command syntax and options, see the [CLI Command Reference](./refer
151151
```yaml
152152
- name: Deploy with Keep
153153
run: |
154-
keep run --vault=ssm --stage=${{ github.ref_name }} -- ./deploy.sh
154+
keep run --vault=ssm --env=${{ github.ref_name }} -- ./deploy.sh
155155
```
156156
157157
### GitLab CI
158158
```yaml
159159
deploy:
160160
script:
161-
- keep export --stage=production --file=.env --overwrite
161+
- keep export --env=production --file=.env --overwrite
162162
- docker build -t myapp .
163163
- rm -f .env
164164
```
165165
166166
### Jenkins Pipeline
167167
```groovy
168168
stage('Deploy') {
169-
sh 'keep run --vault=ssm --stage=production -- npm run deploy'
169+
sh 'keep run --vault=ssm --env=production -- npm run deploy'
170170
}
171171
```
172172

173173
### Kubernetes Secrets
174174
```bash
175175
# Generate secret manifest
176-
keep export --stage=production --format=json | \
176+
keep export --env=production --format=json | \
177177
kubectl create secret generic app-secrets --from-file=secrets.json=/dev/stdin
178178
```
179179

0 commit comments

Comments
 (0)