$ -weight: 500;">git clone https://github.com/clef-sh/quick--weight: 500;">start.-weight: 500;">git
cd quick--weight: 500;">start
-weight: 500;">npm -weight: 500;">install
-weight: 500;">git clone https://github.com/clef-sh/quick--weight: 500;">start.-weight: 500;">git
cd quick--weight: 500;">start
-weight: 500;">npm -weight: 500;">install
-weight: 500;">git clone https://github.com/clef-sh/quick--weight: 500;">start.-weight: 500;">git
cd quick--weight: 500;">start
-weight: 500;">npm -weight: 500;">install
npx clef doctor
npx clef doctor
npx clef doctor
npx clef init \ --namespaces database,payments \ --environments dev,production \ --backend age \ --non-interactive
npx clef init \ --namespaces database,payments \ --environments dev,production \ --backend age \ --non-interactive
npx clef init \ --namespaces database,payments \ --environments dev,production \ --backend age \ --non-interactive
cat clef.yaml
tree secrets
cat clef.yaml
tree secrets
cat clef.yaml
tree secrets
-weight: 500;">git add clef.yaml .clef .clefignore .gitattributes secrets
-weight: 500;">git commit -m "Initialise Clef"
-weight: 500;">git add clef.yaml .clef .clefignore .gitattributes secrets
-weight: 500;">git commit -m "Initialise Clef"
-weight: 500;">git add clef.yaml .clef .clefignore .gitattributes secrets
-weight: 500;">git commit -m "Initialise Clef"
npx clef set database/dev DB_HOST localhost
npx clef set database/dev DB_HOST localhost
npx clef set database/dev DB_HOST localhost
npx clef set database/dev DB_PASSWORD
# Value: ********
npx clef set database/dev DB_PASSWORD
# Value: ********
npx clef set database/dev DB_PASSWORD
# Value: ********
npx clef get database/dev DB_PASSWORD
npx clef get database/dev DB_PASSWORD
npx clef get database/dev DB_PASSWORD
npx clef set database/dev DB_USER dev_user
npx clef set database/production DB_HOST db.prod.internal
npx clef set database/production DB_USER app
npx clef set database/production DB_PASSWORD --random
npx clef set payments/dev STRIPE_KEY sk_test_demo
npx clef set payments/dev WEBHOOK_URL https://dev.example.com/webhooks/stripe
npx clef set payments/production STRIPE_KEY --random
npx clef set payments/production WEBHOOK_URL https://example.com/webhooks/stripe
npx clef set database/dev DB_USER dev_user
npx clef set database/production DB_HOST db.prod.internal
npx clef set database/production DB_USER app
npx clef set database/production DB_PASSWORD --random
npx clef set payments/dev STRIPE_KEY sk_test_demo
npx clef set payments/dev WEBHOOK_URL https://dev.example.com/webhooks/stripe
npx clef set payments/production STRIPE_KEY --random
npx clef set payments/production WEBHOOK_URL https://example.com/webhooks/stripe
npx clef set database/dev DB_USER dev_user
npx clef set database/production DB_HOST db.prod.internal
npx clef set database/production DB_USER app
npx clef set database/production DB_PASSWORD --random
npx clef set payments/dev STRIPE_KEY sk_test_demo
npx clef set payments/dev WEBHOOK_URL https://dev.example.com/webhooks/stripe
npx clef set payments/production STRIPE_KEY --random
npx clef set payments/production WEBHOOK_URL https://example.com/webhooks/stripe
npx clef diff database dev production
npx clef diff database dev production
npx clef diff database dev production
npx clef lint
npx clef lint
npx clef lint
npx clef ui
npx clef ui
npx clef ui
aws sts get-caller-identity
aws sts get-caller-identity
aws sts get-caller-identity
ACCOUNT=$(aws sts get-caller-identity --query Account --output text)
REGION=${AWS_REGION:-$(aws configure get region)}
KMS_ARN="arn:aws:kms:${REGION}:${ACCOUNT}:alias/clef-quick--weight: 500;">start"
ACCOUNT=$(aws sts get-caller-identity --query Account --output text)
REGION=${AWS_REGION:-$(aws configure get region)}
KMS_ARN="arn:aws:kms:${REGION}:${ACCOUNT}:alias/clef-quick--weight: 500;">start"
ACCOUNT=$(aws sts get-caller-identity --query Account --output text)
REGION=${AWS_REGION:-$(aws configure get region)}
KMS_ARN="arn:aws:kms:${REGION}:${ACCOUNT}:alias/clef-quick--weight: 500;">start"
$ACCOUNT = aws sts get-caller-identity --query Account --output text
$REGION = if ($env:AWS_REGION) { $env:AWS_REGION } else { aws configure get region }
$KMS_ARN = "arn:aws:kms:${REGION}:${ACCOUNT}:alias/clef-quick--weight: 500;">start"
$ACCOUNT = aws sts get-caller-identity --query Account --output text
$REGION = if ($env:AWS_REGION) { $env:AWS_REGION } else { aws configure get region }
$KMS_ARN = "arn:aws:kms:${REGION}:${ACCOUNT}:alias/clef-quick--weight: 500;">start"
$ACCOUNT = aws sts get-caller-identity --query Account --output text
$REGION = if ($env:AWS_REGION) { $env:AWS_REGION } else { aws configure get region }
$KMS_ARN = "arn:aws:kms:${REGION}:${ACCOUNT}:alias/clef-quick--weight: 500;">start"
npx clef -weight: 500;">service create app \ --runtime \ --namespaces database,payments \ --kms-env production=aws:$KMS_ARN
npx clef -weight: 500;">service create app \ --runtime \ --namespaces database,payments \ --kms-env production=aws:$KMS_ARN
npx clef -weight: 500;">service create app \ --runtime \ --namespaces database,payments \ --kms-env production=aws:$KMS_ARN
cd infra
npx cdk bootstrap
npx cdk deploy QuickStartKms --outputs-file ./kms-outputs.json
cd ..
cd infra
npx cdk bootstrap
npx cdk deploy QuickStartKms --outputs-file ./kms-outputs.json
cd ..
cd infra
npx cdk bootstrap
npx cdk deploy QuickStartKms --outputs-file ./kms-outputs.json
cd ..
npx clef migrate-backend \ --aws-kms-arn $KMS_ARN \ --environment production
npx clef migrate-backend \ --aws-kms-arn $KMS_ARN \ --environment production
npx clef migrate-backend \ --aws-kms-arn $KMS_ARN \ --environment production
cd infra
npx cdk deploy QuickStartApp -c app=true
cd ..
cd infra
npx cdk deploy QuickStartApp -c app=true
cd ..
cd infra
npx cdk deploy QuickStartApp -c app=true
cd ..
aws secretsmanager list-secrets \ --filters Key=tag-value,Values=clef-quick--weight: 500;">start \ --query 'SecretList[].Name'
aws secretsmanager list-secrets \ --filters Key=tag-value,Values=clef-quick--weight: 500;">start \ --query 'SecretList[].Name'
aws secretsmanager list-secrets \ --filters Key=tag-value,Values=clef-quick--weight: 500;">start \ --query 'SecretList[].Name'
aws secretsmanager get-secret-value \ --secret-id clef-quick--weight: 500;">start/database-url \ --query SecretString --output text
aws secretsmanager get-secret-value \ --secret-id clef-quick--weight: 500;">start/database-url \ --query SecretString --output text
aws secretsmanager get-secret-value \ --secret-id clef-quick--weight: 500;">start/database-url \ --query SecretString --output text
npx clef cloud init
npx clef cloud init
npx clef cloud init
-weight: 500;">git add .clef/policy.yaml .github/workflows/clef-compliance.yml
-weight: 500;">git commit -m "Enable Clef Cloud"
-weight: 500;">git push
-weight: 500;">git add .clef/policy.yaml .github/workflows/clef-compliance.yml
-weight: 500;">git commit -m "Enable Clef Cloud"
-weight: 500;">git push
-weight: 500;">git add .clef/policy.yaml .github/workflows/clef-compliance.yml
-weight: 500;">git commit -m "Enable Clef Cloud"
-weight: 500;">git push
cd infra
npx cdk destroy QuickStartApp QuickStartKms
cd infra
npx cdk destroy QuickStartApp QuickStartKms
cd infra
npx cdk destroy QuickStartApp QuickStartKms - A clef.yaml with two namespaces (database, payments) across two environments (dev, production)
- All four matrix cells populated with demo secrets, encrypted with SOPS
- A -weight: 500;">service identity (app) whose production envelope is protected by AWS KMS
- A CloudFormation stack with three ClefSecrets, each holding a Clef-managed value in AWS Secrets Manager — readable by your app via the standard ASM SDK, with no Clef agent at runtime - Node.js 20+
- AWS account + credentials for steps 4–5 only. Standard SDK resolution applies (AWS_PROFILE, env vars, SSO, etc.). The KMS key, an unwrap Lambda, and three Secrets Manager secrets will be created in the account/region your credentials resolve to. All resources are tagged clef-quick--weight: 500;">start so you can find and -weight: 500;">remove them.
- Git — Clef is -weight: 500;">git-native, and the tutorial commits the initial state after clef init so you can see exactly what each subsequent step adds. Cloning this repo (per the setup step below) gives you a -weight: 500;">git working tree already.
- Shell — commands below are written for a POSIX shell (macOS/Linux Terminal, WSL, or Git Bash on Windows). PowerShell works too; the only block that needs a different syntax is the variable derivation in step 4, where a PowerShell variant is shown alongside. - clef.yaml now declares your namespaces, environments, and the age recipient that owns this repo.
- .clef/config.yaml records the local age private key location (stored in your OS keychain by default).
- secrets/database/{dev,production}.enc.yaml and secrets/payments/{dev,production}.enc.yaml were created — each one is a valid SOPS file with no keys yet.
- .clefignore and .gitattributes were written so the SOPS merge driver picks up *.enc.yaml. - QuickStartKms — provisions the KMS key plus the alias alias/clef-quick--weight: 500;">start.
- QuickStartApp — deploys three ClefSecrets into AWS Secrets Manager. We deploy this in step 5. - .clef/policy.yaml — declares rotation cadence per namespace, schema requirements, allowed backends, and any custom policy rules.
- .github/workflows/clef-compliance.yml — a GitHub Actions workflow that runs clef policy check on each PR, writes compliance.json, and uploads it as the workflow artifact the bot reads. - post a -weight: 500;">status check on every PR summarising rotation overdue counts, schema violations, and pending placeholders,
- block merges that violate .clef/policy.yaml (configurable per rule), and
- populate the Cloud dashboard with the compliance history of the repo. - A central, version-controlled source of truth for secrets. Every value lives in secrets/<ns>/<env>.enc.yaml, encrypted with SOPS, diffable in -weight: 500;">git, reviewable in PRs.
- Per-environment encryption with a clean handoff to AWS. dev rides on age for friction-free local work; production is sealed with your own KMS key. The CDK constructs deliver those values into AWS Secrets Manager so applications keep using the standard aws-sdk — no Clef binary, no agent, no sidecar.
- Rotation and schema tracking with a path to enforcement. clef lint already flags pending placeholders and policy violations locally; once Clef Cloud is connected, the same checks run on every PR and the dashboard tracks rotation health across repositories. - @clef-sh/cdk reference — github.com/clef-sh/clef/tree/main/packages/cdk covers the other constructs (ClefArtifactBucket for S3 delivery, ClefParameter for SSM Parameter Store) and synth-time validation.
- Schemas — define required keys and value patterns per namespace; clef lint will then enforce them. See docs.clef.sh/guide/schemas.
- CI — for GitHub Actions, OIDC into KMS so CI never holds long-lived credentials. See docs.clef.sh/guide/ci. - Joined Mar 25, 2026