TopRank Skills

Home / Claw Skills / Git / GitHub / env-setup
Official OpenClaw rules 36%

env-setup

Scan codebase for environment variables, generate .env.example, validate .env, and ensure .gitignore safety

Stars

0

Installs

0

Status

ACTIVE

Visibility

PUBLIC

安装方式

直接复制以下提示词,发送给你的 AI 助手即可完成安装。

请先检查是否已安装 SkillHub 商店,若未安装,请根据 https://skillhub-1388575217.cos.ap-guangzhou.myqcloud.com/install/skillhub.md 安装 SkillHub 商店,然后安装 env-setup 技能。 若已安装,则直接安装 env-setup 技能。

Overview

Skill Key
fratua/env-setup
Author
Sovereign Skills
Source Repo
openclaw/skills
Version
1.0.0
Source Path
skills/fratua/env-setup
Latest Commit SHA
de952d7c8017485cca88709854dc85f876355920

Extracted Content

SKILL.md excerpt

# env-setup — Environment Variable Manager

Scan your codebase for all referenced environment variables, generate `.env.example`, validate your current `.env`, and ensure secrets aren't committed.

## Steps

### 1. Scan Codebase for Environment Variables

Search for env var references across all common patterns:

```bash
# Node.js / JavaScript / TypeScript
grep -rn "process\.env\.\w\+" --include="*.js" --include="*.ts" --include="*.jsx" --include="*.tsx" . | grep -v node_modules | grep -v dist

# Python
grep -rn "os\.environ\|os\.getenv\|environ\.get" --include="*.py" . | grep -v __pycache__ | grep -v .venv

# Rust
grep -rn "env::var\|env::var_os\|dotenv" --include="*.rs" . | grep -v target

# Go
grep -rn "os\.Getenv\|os\.LookupEnv\|viper\." --include="*.go" . | grep -v vendor

# Docker / docker-compose
grep -rn "\${.*}" --include="*.yml" --include="*.yaml" docker-compose* 2>/dev/null

# General .env references in config files
grep -rn "env\." --include="*.toml" --include="*.yaml" --include="*.yml" . 2>/dev/null
```

**Windows PowerShell alternative:**
```powershell
Get-ChildItem -Recurse -Include *.js,*.ts,*.jsx,*.tsx -Exclude node_modules,dist | Select-String "process\.env\.\w+"
Get-ChildItem -Recurse -Include *.py -Exclude __pycache__,.venv | Select-String "os\.environ|os\.getenv"
```

### 2. Extract Variable Names

Parse grep output to extract unique variable names:

- `process.env.DATABASE_URL` → `DATABASE_URL`
- `os.environ.get("SECRET_KEY", "default")` → `SECRET_KEY` (default: `default`)
- `os.getenv("API_KEY")` → `API_KEY`
- `env::var("RUST_LOG")` → `RUST_LOG`

Deduplicate and sort alphabetically. Note which file and line each var is referenced in.

### 3. Classify Variables

Categorize each variable:

| Category | Pattern | Examples |
|----------|---------|---------|
| 🔴 Secrets | `*KEY*`, `*SECRET*`, `*TOKEN*`, `*PASSWORD*`, `*CREDENTIAL*` | `API_KEY`, `JWT_SECRET` |
| 🟡 Service URLs | `*URL*`, `*HOST*`, `*ENDPOINT*`, `*URI*` | `DATABASE_URL`, `REDIS_HOS...

Related Claw Skills