返回 Skills 目录
get-convex/agent-skills包含需要注意的行为

SKILL DETAIL

convex-env

get-convex/agent-skills/convex-env

此技能用于管理 Convex 部署的环境变量和密钥。通过 `npx convex env set` 命令将密钥存储为 Convex 部署环境变量,并在 actions 中通过 `process.env` 读取,切勿将其提交到代码库。 工作流程包括:使用 `npx convex env set KEY value` 为每个部署设置环境变量;在 actions 中通过 `process.env.KEY` 读取(而非 queries 或 mutations);切勿硬编码或提交密钥,仅本地开发时添加到 `.env.local`;使用 `npx convex env list` 确认设置。 规则:密钥应存储在 Convex 环境变量中,而非代码或 git 中;`process.env` 仅用于 actions(必要时使用 'use node'),不用于 queries 或 mutations;不同部署需要各自的值。

安装量 · 453查看来源

Installation

npx skills add https://github.com/get-convex/agent-skills --skill convex-env

技能文件

SKILL.md

最近同步 · 2026年10月15日

SKILL.md›
---
name: convex-env
description: "Set and wire Convex deployment env vars / secrets for the app."
---

<!-- GENERATED from convex-agents content/capabilities/env.json — do not edit by hand. -->

# Manage env vars + secrets

Store secrets as Convex deployment env vars (npx convex env set), read them with process.env in actions, never commit them.

## Workflow

1. `npx convex env set KEY value` (per deployment).
2. Read via process.env.KEY inside actions (not queries/mutations).
3. Never hardcode or commit secrets; add to .env.local only for local.
4. Confirm it's set with `npx convex env list --names-only`, which lists names without printing the secret values.

## Rules

- Secrets live in Convex env vars, never in code or git.
- process.env only in actions ('use node' if needed), not queries/mutations.
- Different deployments need their own values.
- Check what is set with `npx convex env list --names-only`; never print secret values into the conversation.