env
当用户想管理环境变量、创建 .env 文件、配置 API Key 时使用 — 扫描项目生成 .env 模板和文档
by lightpointventures★ 37 GitHub stars
Install env in Claude Code & Claude Desktop
Sign up to install this skill
Create a free account to reveal the install command and save the skill to your library.
- Reveal the one-line install command
- Save skills to your synced library
- Get notified when skills update
About this skill
配置环境变量
帮用户规范地管理项目的环境变量,防止密钥泄露。
步骤
1. 扫描项目
自动扫描项目中所有代码文件,找出使用的环境变量:
- Python:
os.environ、os.getenv - Node.js:
process.env - 其他:
.env文件引用
列出所有发现的环境变量。
2. 生成 .env.example
创建 .env.example 文件,包含所有环境变量的模板:
# 数据库
DATABASE_URL=postgresql://user:password@localhost:5432/mydb
# API 密钥
STRIPE_SECRET_KEY=sk_test_xxx
STRIPE_PUBLISHABLE_KEY=pk_test_xxx
# 邮件
RESEND_API_KEY=re_xxx
每个变量都有注释说明用途,值使用示例格式(不是真实密钥)。
3. 检查 .gitignore
确保 .gitignore 包含:
.env.env.local.env.production
如果不包含,自动添加。
4. 生成说明
在终端输出环境变量列表和获取方式:
项目需要以下环境变量: (列出每个变量、用途、在哪里获取)
已生成 .env.example 模板。复制为 .env 并填入你的值:
cp .env.example .env
Allowed tools
Tools this skill is permitted to call.
No restriction — this skill can use any tool.
FAQ
What does the env skill do?
当用户想管理环境变量、创建 .env 文件、配置 API Key 时使用 — 扫描项目生成 .env 模板和文档
How do I install the env skill?
Copy the skill folder into ~/.claude/skills (the Claude Code tab above does this in one command), or install it as a plugin.
Does the env skill run scripts?
No, this skill is instructions only (SKILL.md) with no executable scripts.
Related skills
mcp-builder
AnthropicGuide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
claude-api
AnthropicReference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
algorithmic-art
AnthropicCreating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
mcp-integration
AnthropicThis skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…