-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathenv.example
More file actions
137 lines (129 loc) · 10.8 KB
/
env.example
File metadata and controls
137 lines (129 loc) · 10.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
# ═══════════════════════════════════════════════════════════════════════════
# @file .env.example
# @description NvimEnterprise — Global AI API keys and secrets
# @author ca971
# @license MIT
# @version 1.0.0
# @since 2026-01
#
# @see lua/core/secrets.lua Dotenv parser and loader
# @see init.lua Phase 6 — two-phase secrets loading
# @see .gitignore Must contain `.env` (NEVER commit)
# @see lua/core/platform.lua config_dir resolution for .env path
#
# ╔══════════════════════════════════════════════════════════════════════════╗
# ║ .env — Global AI API Keys & Secrets ║
# ║ ║
# ║ ⚠ SECURITY: This file must NEVER be committed to version control ║
# ║ ║
# ║ Loading Pipeline: ║
# ║ ┌──────────────────────────────────────────────────────────────────┐ ║
# ║ │ │ ║
# ║ │ Phase 1 (sync, init.lua startup): │ ║
# ║ │ └─ core.secrets.load_dotenv("~/.config/nvim/.env") ← THIS │ ║
# ║ │ → Keys injected into vim.env.* BEFORE plugin setup() │ ║
# ║ │ │ ║
# ║ │ Phase 2 (async, deferred): │ ║
# ║ │ └─ core.secrets.load_dotenv(".env") │ ║
# ║ │ → Project-local .env may override these keys │ ║
# ║ │ │ ║
# ║ │ Consumers: │ ║
# ║ │ ├─ avante.nvim → ANTHROPIC_API_KEY, OPENAI_API_KEY │ ║
# ║ │ ├─ codecompanion.nvim → All provider keys │ ║
# ║ │ ├─ copilot.lua → (uses OAuth, not .env) │ ║
# ║ │ └─ :AIStatus → Displays loaded key status │ ║
# ║ │ │ ║
# ║ └──────────────────────────────────────────────────────────────────┘ ║
# ║ ║
# ║ File Permissions: ║
# ║ ┌──────────────────────────────────────────────────────────────────┐ ║
# ║ │ chmod 600 ~/.config/nvim/.env (owner read/write only) │ ║
# ║ │ chown $USER ~/.config/nvim/.env (ensure correct ownership) │ ║
# ║ └──────────────────────────────────────────────────────────────────┘ ║
# ║ ║
# ║ Verification: ║
# ║ ├─ :AIStatus Show which keys are loaded ║
# ║ ├─ :SecretsReload Reload .env without restarting Neovim ║
# ║ └─ :checkhealth secrets Validate key formats and permissions ║
# ║ ║
# ║ Format Rules: ║
# ║ • KEY=value (no spaces around `=`) ║
# ║ • Lines starting with `#` are comments ║
# ║ • Empty lines are ignored ║
# ║ • No export prefix (not a shell script) ║
# ║ • No quoting required (values are read as raw strings) ║
# ╚══════════════════════════════════════════════════════════════════════════╝
# ═══════════════════════════════════════════════════════════════════════════
# ANTHROPIC (Claude)
#
# Models: claude-sonnet-4-20250514, claude-3.5-haiku
# Dashboard: https://console.anthropic.com/
# Pricing: https://www.anthropic.com/pricing
# Used by: avante.nvim (primary), codecompanion.nvim
# ═══════════════════════════════════════════════════════════════════════════
ANTHROPIC_API_KEY=your-anthropic-api-key-here
# ═══════════════════════════════════════════════════════════════════════════
# OPENAI (GPT-5)
#
# Models: gpt-4o, gpt-4o-mini, o1, o1-mini
# Dashboard: https://platform.openai.com/api-keys
# Pricing: https://openai.com/pricing
# Used by: avante.nvim (fallback), codecompanion.nvim
# ═══════════════════════════════════════════════════════════════════════════
OPENAI_API_KEY=your-openai-api-key-here
# ═══════════════════════════════════════════════════════════════════════════
# GOOGLE (Gemini)
#
# Models: gemini-2.5-pro, gemini-2.0-flash
# Dashboard: https://aistudio.google.com/apikey
# Pricing: https://ai.google.dev/pricing
# Used by: codecompanion.nvim
# ═══════════════════════════════════════════════════════════════════════════
GEMINI_API_KEY=your-gemini-api-key-here
# ═══════════════════════════════════════════════════════════════════════════
# DEEPSEEK
#
# Models: deepseek-chat, deepseek-coder, deepseek-reasoner
# Dashboard: https://platform.deepseek.com/api_keys
# Pricing: https://platform.deepseek.com/api-docs/pricing
# Used by: codecompanion.nvim
# ═══════════════════════════════════════════════════════════════════════════
DEEPSEEK_API_KEY=your-deepseek-api-key-here
# ═══════════════════════════════════════════════════════════════════════════
# ALIBABA DASHSCOPE (Qwen)
#
# Models: qwen-max, qwen-plus, qwen-turbo, qwen-coder
# Dashboard: https://dashscope.console.aliyun.com/
# Pricing: https://help.aliyun.com/zh/model-studio/billing
# Used by: codecompanion.nvim
# ═══════════════════════════════════════════════════════════════════════════
DASHSCOPE_API_KEY=your-dashscope-api-key-here
# ═══════════════════════════════════════════════════════════════════════════
# ZHIPU AI (GLM-5)
#
# Models: glm-4-plus, glm-4-flash, glm-4-air
# Dashboard: https://open.bigmodel.cn/usercenter/apikeys
# Pricing: https://open.bigmodel.cn/pricing
# Used by: codecompanion.nvim
# ═══════════════════════════════════════════════════════════════════════════
GLM_API_KEY=your-glm-api-key-here
# ═══════════════════════════════════════════════════════════════════════════
# MOONSHOT AI (Kimi)
#
# Models: moonshot-v1-128k, moonshot-v1-32k, moonshot-v1-8k
# Dashboard: https://platform.moonshot.cn/console/api-keys
# Pricing: https://platform.moonshot.cn/docs/pricing
# Used by: codecompanion.nvim
# ═══════════════════════════════════════════════════════════════════════════
MOONSHOT_API_KEY=your-moonshot-api-key-here
# ═══════════════════════════════════════════════════════════════════════════
# GITHUB (Fine-grained Personal Access Token — for MCP server-github)
#
# Type: Fine-grained PAT (read-only, minimal permissions)
# Scopes: issues:read, pull_requests:read, contents:read, metadata:read
# Dashboard: https://github.com/settings/tokens?type=beta
# Used by: mcphub.nvim → @modelcontextprotocol/server-github
# Note: SSH keys (id_github_ed25519) are for git operations only,
# not for the GitHub REST/GraphQL API used by MCP.
# ═══════════════════════════════════════════════════════════════════════════
GITHUB_PERSONAL_ACCESS_TOKEN=your-github-pat-here