# request-secret Examples

## Database credentials

```bash
request-secret --name "Database credentials" \
  --description "PostgreSQL credentials for the analytics DB. You can find these in 1Password under 'Analytics Prod DB'." \
  --field "DB_HOST" --field "DB_PORT" --field "DB_NAME" \
  --field "DB_USER" --field "DB_PASSWORD:secret" \
  --output .env --format env
```

## API key

```bash
request-secret --name "OpenAI API key" \
  --description "API key for the GPT-4 integration. Find it at https://platform.openai.com/api-keys." \
  --field "OPENAI_API_KEY:secret" \
  --output .env --format env
```

## Multiple credentials as JSON

```bash
request-secret --name "SMTP credentials" \
  --description "Mail server credentials for transactional emails. Check the infrastructure wiki or 1Password." \
  --field "SMTP_HOST" --field "SMTP_PORT" \
  --field "SMTP_USER" --field "SMTP_PASS:secret" \
  --output smtp-config.json --format json
```
