Agent Skillsdtyq/magic › env-manager

env-manager

GitHub

管理个人与工作区的环境变量,支持设置、查询、列出和删除操作。默认持久化至个人配置,优先级高于工作区配置,确保跨会话复用且不泄露明文。

backend/super-magic/agents/skills/env-manager/SKILL.md dtyq/magic

Trigger Scenarios

用户提供API密钥或Token需要保存 用户要求查询或列出已保存的环境变量 用户要求删除特定的环境变量

Install

npx skills add dtyq/magic --skill env-manager -g -y
More Options

Non-standard path

npx skills add https://github.com/dtyq/magic/tree/master/backend/super-magic/agents/skills/env-manager -g -y

Use without installing

npx skills use dtyq/magic@env-manager

指定 Agent (Claude Code)

npx skills add dtyq/magic --skill env-manager -a claude-code -g -y

安装 repo 全部 skill

npx skills add dtyq/magic --all -g -y

预览 repo 内 skill

npx skills add dtyq/magic --list

SKILL.md

Frontmatter
{
    "name": "env-manager",
    "description": "Use when the user provides API keys, tokens, or other configuration values that should persist across sessions, or when the user asks to query, list, or delete saved environment variables. Manages personal env by default and workspace env only when explicitly requested."
}

Environment Variable Manager

Use this skill by calling set_env, get_env, unset_env, and list_env through sdk.tool.call(...) inside run_sdk_snippet.

By default, save and delete personal environment variables stored in ~/.magic/super-magic.env for reuse across workspaces. Pass "scope": "workspace" only when the user explicitly asks to save or delete values for the current workspace/project.

The runtime effective environment merges workspace env and personal env. Personal env has the highest priority and overrides workspace values with the same key. Tool display and results never echo plaintext values.

Get One Env

When you only need to check whether one key is configured, prefer get_env. get_env queries the final effective env by default (scope=all). Do not call list_env just to inspect one key, because that exposes unrelated environment variable names and masked values to the model context.

run_sdk_snippet(python_code="""
from sdk.tool import tool

result = tool.call("get_env", {
    "key": "KEY_NAME",
})
if not result.ok:
    raise SystemExit(result.content)
print(result.content)
""")

Only pass "scope": "personal" or "scope": "workspace" when you need to check whether a key exists in a specific storage scope.

run_sdk_snippet(python_code="""
from sdk.tool import tool

result = tool.call("get_env", {
    "key": "KEY_NAME",
    "scope": "workspace",
})
if not result.ok:
    raise SystemExit(result.content)
print(result.content)
""")

Set Personal Env

run_sdk_snippet(python_code="""
from sdk.tool import tool

result = tool.call("set_env", {
    "key": "KEY_NAME",
    "value": "value",
})
if not result.ok:
    raise SystemExit(result.content)
print(result.content)
""")

Set Workspace Env

run_sdk_snippet(python_code="""
from sdk.tool import tool

result = tool.call("set_env", {
    "key": "KEY_NAME",
    "value": "value",
    "scope": "workspace",
})
if not result.ok:
    raise SystemExit(result.content)
print(result.content)
""")

List Personal Env

run_sdk_snippet(python_code="""
from sdk.tool import tool

result = tool.call("list_env", {})
if not result.ok:
    raise SystemExit(result.content)
print(result.content)
""")

List Workspace Env

run_sdk_snippet(python_code="""
from sdk.tool import tool

result = tool.call("list_env", {
    "scope": "workspace",
})
if not result.ok:
    raise SystemExit(result.content)
print(result.content)
""")

List Effective Env

"scope": "all" means the final effective merge of workspace and personal env. Personal env overrides workspace env with the same key.

run_sdk_snippet(python_code="""
from sdk.tool import tool

result = tool.call("list_env", {
    "scope": "all",
})
if not result.ok:
    raise SystemExit(result.content)
print(result.content)
""")

Unset Personal Env

run_sdk_snippet(python_code="""
from sdk.tool import tool

result = tool.call("unset_env", {
    "key": "KEY_NAME",
})
if not result.ok:
    raise SystemExit(result.content)
print(result.content)
""")

Unset Workspace Env

run_sdk_snippet(python_code="""
from sdk.tool import tool

result = tool.call("unset_env", {
    "key": "KEY_NAME",
    "scope": "workspace",
})
if not result.ok:
    raise SystemExit(result.content)
print(result.content)
""")

Version History

  • f9973c5 Current 2026-08-20 03:37
  • 41d7ef4 2026-07-25 09:29

Same Skill Collection

backend/super-magic/agents/skills/agent-info/SKILL.md
backend/super-magic/agents/skills/canvas-designer/SKILL.md
backend/super-magic/agents/skills/chat-history/SKILL.md
backend/super-magic/agents/skills/cli-manager/SKILL.md
backend/super-magic/agents/skills/compact-chat-history/SKILL.md
backend/super-magic/agents/skills/creating-slides/SKILL.md
backend/super-magic/agents/skills/develop-data-analysis-dashboard/SKILL.md
backend/super-magic/agents/skills/document-converter/SKILL.md
backend/super-magic/agents/skills/download/SKILL.md
backend/super-magic/agents/skills/im-channels/SKILL.md
backend/super-magic/agents/skills/magic-calendar/SKILL.md
backend/super-magic/agents/skills/magicbase/SKILL.md
backend/super-magic/agents/skills/sandbox-manager/SKILL.md
backend/super-magic/agents/skills/self-media-pre-publish-analyzer/SKILL.md
backend/super-magic/agents/skills/share/SKILL.md
backend/super-magic/agents/skills/skill-vetter/SKILL.md
backend/super-magic/agents/skills/slide-template/SKILL.md
backend/super-magic/agents/skills/subagents/SKILL.md
backend/super-magic/agents/skills/teamshare-cli/SKILL.md
backend/super-magic/agents/skills/user-info/SKILL.md
backend/super-magic/agents/skills/using-cron/SKILL.md
backend/super-magic/agents/skills/using-llm/SKILL.md
backend/super-magic/agents/skills/using-mcp/SKILL.md
frontend/magic-web/.agents/skills/antd-style-to-tailwind/SKILL.md
frontend/magic-web/.agents/skills/code-review-expert/SKILL.md
frontend/magic-web/.agents/skills/dual-edition-module-migration/SKILL.md
frontend/magic-web/.agents/skills/magic-web-error-logging/SKILL.md
frontend/magic-web/.agents/skills/sw-best-practices/SKILL.md
frontend/magic-web/.agents/skills/ui-data-testid/SKILL.md
frontend/magic-web/.agents/skills/vercel-composition-patterns/SKILL.md
frontend/magic-web/.agents/skills/vercel-react-best-practices/SKILL.md
backend/super-magic/agents/skills/ai-card-generator/SKILL.md
backend/super-magic/agents/skills/crew-creator/SKILL.md
backend/super-magic/agents/skills/deep-research/SKILL.md
backend/super-magic/agents/skills/dingtalk-cli/SKILL.md
backend/super-magic/agents/skills/html-api-sdk/SKILL.md
backend/super-magic/agents/skills/lark-cli/SKILL.md
backend/super-magic/agents/skills/micro-app-architect/SKILL.md
backend/super-magic/agents/skills/self-media-composer/SKILL.md
backend/super-magic/agents/skills/skill-creator/SKILL.md

Metadata

Files
0
Version
f9973c5
Hash
4ef86546
Indexed
2026-07-25 09:29

Home - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-09-17 07:20
浙ICP备14020137号-1