-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathggcode.example.yaml
More file actions
632 lines (609 loc) · 21 KB
/
ggcode.example.yaml
File metadata and controls
632 lines (609 loc) · 21 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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
# ggcode.example.yaml
# Full configuration example for ggcode
# Copy to ~/.ggcode/ggcode.yaml, or pass it explicitly with --config ./ggcode.yaml
# Active vendor / endpoint / model
vendor: zai
endpoint: cn-coding-openai
model: glm-5-turbo
# TUI language: en or zh-CN
language: en
# Runtime mode: supervised, plan, auto, bypass, or autopilot
default_mode: supervised
# System prompt injected at the start of every conversation
# system_prompt: "You are a helpful coding assistant."
# Vendor-specific settings
vendors:
zai:
display_name: Z.ai
api_key: ${ZAI_API_KEY}
endpoints:
cn-coding-openai:
display_name: 国内 Coding Plan
protocol: openai
base_url: https://open.bigmodel.cn/api/coding/paas/v4
default_model: glm-5-turbo
selected_model: glm-5-turbo
context_window: 200000
max_tokens: 128000
models: [glm-5, glm-5-turbo, glm-5.1, glm-4.7, glm-4.7-flashx, glm-4.6, glm-4.5-air]
tags: [coding, cn]
cn-coding-anthropic:
display_name: 国内 Coding Plan (Anthropic)
protocol: anthropic
base_url: https://open.bigmodel.cn/api/anthropic
default_model: glm-5-turbo
selected_model: glm-5-turbo
context_window: 200000
max_tokens: 128000
models: [glm-5, glm-5-turbo, glm-5.1, glm-4.7, glm-4.7-flashx, glm-4.6, glm-4.5-air]
tags: [coding, cn, anthropic]
global-coding-openai:
display_name: 国外 Coding Plan
protocol: openai
base_url: https://api.z.ai/api/coding/paas/v4
default_model: glm-5-turbo
selected_model: glm-5-turbo
context_window: 200000
max_tokens: 128000
models: [glm-5, glm-5-turbo, glm-5.1, glm-4.7, glm-4.7-flashx, glm-4.6, glm-4.5-air]
tags: [coding, global]
global-coding-anthropic:
display_name: 国外 Coding Plan (Anthropic)
protocol: anthropic
base_url: https://api.z.ai/api/anthropic
default_model: glm-5-turbo
selected_model: glm-5-turbo
context_window: 200000
max_tokens: 128000
models: [glm-5, glm-5-turbo, glm-5.1, glm-4.7, glm-4.7-flashx, glm-4.6, glm-4.5-air]
tags: [coding, global, anthropic]
global-api-openai:
display_name: 国外普通 API
protocol: openai
base_url: https://api.z.ai/api/paas/v4
default_model: glm-4.5-air
selected_model: glm-4.5-air
max_tokens: 8192
models: [glm-5, glm-5-turbo, glm-5.1, glm-4.7, glm-4.7-flashx, glm-4.6, glm-4.5-air]
tags: [api, global]
anthropic:
display_name: Anthropic
api_key: ${ANTHROPIC_API_KEY}
endpoints:
api:
display_name: Anthropic API
protocol: anthropic
base_url: https://api.anthropic.com
default_model: claude-3-5-sonnet-latest
selected_model: claude-3-5-sonnet-latest
max_tokens: 8192
models: [claude-3-5-sonnet-latest, claude-3-5-haiku-latest]
tags: [official, anthropic]
openai:
display_name: OpenAI
api_key: ${OPENAI_API_KEY}
endpoints:
api:
display_name: OpenAI API
protocol: openai
base_url: https://api.openai.com/v1
default_model: gpt-4o-mini
selected_model: gpt-4o-mini
max_tokens: 8192
models: [gpt-4o-mini, gpt-4o]
tags: [official, openai]
google:
display_name: Google Gemini
api_key: ${GEMINI_API_KEY}
endpoints:
api:
display_name: Gemini API
protocol: gemini
base_url: https://generativelanguage.googleapis.com
default_model: gemini-1.5-flash
selected_model: gemini-1.5-flash
max_tokens: 8192
models: [gemini-1.5-flash, gemini-1.5-pro]
tags: [official, gemini]
openrouter:
display_name: OpenRouter
api_key: ${OPENROUTER_API_KEY}
endpoints:
api:
display_name: OpenRouter API
protocol: openai
base_url: https://openrouter.ai/api/v1
default_model: openai/gpt-4o-mini
selected_model: openai/gpt-4o-mini
max_tokens: 8192
models: [openai/gpt-4o-mini, anthropic/claude-3.5-sonnet, google/gemini-flash-1.5]
tags: [router, openai-compatible]
aihubmix:
display_name: AIHubMix
api_key: ${AIHUBMIX_API_KEY}
endpoints:
api:
display_name: AIHubMix API
protocol: openai
base_url: https://aihubmix.com/v1
default_model: gpt-4o-mini
selected_model: gpt-4o-mini
max_tokens: 8192
models: [gpt-4o-mini]
tags: [official, openai-compatible, router]
getgoapi:
display_name: GetGoAPI
api_key: ${GETGOAPI_API_KEY}
endpoints:
api:
display_name: GetGoAPI API
protocol: openai
base_url: https://api.getgoapi.com/v1
default_model: gpt-4o-mini
selected_model: gpt-4o-mini
max_tokens: 8192
models: [gpt-4o-mini]
tags: [official, openai-compatible, router]
groq:
display_name: Groq
api_key: ${GROQ_API_KEY}
endpoints:
api:
display_name: Groq API
protocol: openai
base_url: https://api.groq.com/openai/v1
default_model: llama-3.1-8b-instant
selected_model: llama-3.1-8b-instant
max_tokens: 8192
models: [llama-3.1-8b-instant, llama-3.1-70b-versatile]
tags: [official, openai-compatible, fast]
mistral:
display_name: Mistral
api_key: ${MISTRAL_API_KEY}
endpoints:
api:
display_name: Mistral API
protocol: openai
base_url: https://api.mistral.ai/v1
default_model: mistral-small-latest
selected_model: mistral-small-latest
max_tokens: 8192
models: [mistral-small-latest, mistral-large-latest]
tags: [official, openai-compatible]
deepseek:
display_name: DeepSeek
api_key: ${DEEPSEEK_API_KEY}
endpoints:
api:
display_name: DeepSeek API
protocol: openai
base_url: https://api.deepseek.com/v1
default_model: deepseek-chat
selected_model: deepseek-chat
max_tokens: 8192
models: [deepseek-chat, deepseek-reasoner]
tags: [official, openai-compatible, reasoning]
moonshot:
display_name: Moonshot AI
api_key: ${MOONSHOT_API_KEY}
endpoints:
api:
display_name: Moonshot API
protocol: openai
base_url: https://api.moonshot.cn/v1
default_model: moonshot-v1-8k
selected_model: moonshot-v1-8k
max_tokens: 8192
models: [moonshot-v1-8k, moonshot-v1-32k]
tags: [official, openai-compatible, cn]
novita:
display_name: Novita AI
api_key: ${NOVITA_API_KEY}
endpoints:
api:
display_name: Novita AI API
protocol: openai
base_url: https://api.novita.ai/openai/v1
default_model: gpt-4o-mini
selected_model: gpt-4o-mini
max_tokens: 8192
models: [gpt-4o-mini]
tags: [official, openai-compatible, router]
aliyun:
display_name: Aliyun Bailian Coding Plan
api_key: ${DASHSCOPE_API_KEY}
endpoints:
coding-openai:
display_name: Aliyun Bailian Coding Plan
protocol: openai
base_url: https://coding.dashscope.aliyuncs.com/v1
default_model: qwen3-coder-plus
selected_model: qwen3-coder-plus
max_tokens: 8192
models: [qwen3-coder-plus]
tags: [official, coding, cn, openai-compatible]
coding-anthropic:
display_name: Aliyun Bailian Coding Plan (Anthropic)
protocol: anthropic
base_url: https://coding.dashscope.aliyuncs.com/apps/anthropic
default_model: qwen3-coder-plus
selected_model: qwen3-coder-plus
max_tokens: 8192
models: [qwen3-coder-plus]
tags: [official, coding, cn, anthropic]
poe:
display_name: Poe
api_key: ${POE_API_KEY}
endpoints:
api:
display_name: Poe API
protocol: openai
base_url: https://api.poe.com/v1
default_model: gpt-4o-mini
selected_model: gpt-4o-mini
max_tokens: 8192
models: [gpt-4o-mini]
tags: [official, openai-compatible, router]
requesty:
display_name: Requesty
api_key: ${REQUESTY_API_KEY}
endpoints:
api:
display_name: Requesty API
protocol: openai
base_url: https://router.requesty.ai/v1
default_model: gpt-4o-mini
selected_model: gpt-4o-mini
max_tokens: 8192
models: [gpt-4o-mini]
tags: [official, openai-compatible, router]
vercel:
display_name: Vercel AI Gateway
api_key: ${VERCEL_AI_GATEWAY_API_KEY}
endpoints:
api:
display_name: Vercel AI Gateway
protocol: openai
base_url: https://ai-gateway.vercel.sh/v1
default_model: gpt-4o-mini
selected_model: gpt-4o-mini
max_tokens: 8192
models: [gpt-4o-mini]
tags: [official, openai-compatible, gateway]
kimi:
display_name: Kimi Coding Plan
api_key: ${KIMI_API_KEY}
endpoints:
coding-openai:
display_name: Kimi Coding Plan
protocol: openai
base_url: https://api.kimi.com/coding/v1
default_model: kimi-for-coding
selected_model: kimi-for-coding
context_window: 262144
max_tokens: 32768
models: [kimi-for-coding]
tags: [official, coding, openai-compatible]
coding-anthropic:
display_name: Kimi Coding Plan (Anthropic)
protocol: anthropic
base_url: https://api.kimi.com/coding/
default_model: kimi-for-coding
selected_model: kimi-for-coding
context_window: 262144
max_tokens: 32768
models: [kimi-for-coding]
tags: [official, coding, anthropic]
minimax:
display_name: MiniMax Token Plan
api_key: ${MINIMAX_API_KEY}
endpoints:
token-plan-openai:
display_name: MiniMax Token Plan
protocol: openai
base_url: https://api.minimaxi.com/v1
default_model: MiniMax-M2.7
selected_model: MiniMax-M2.7
context_window: 204800
max_tokens: 2048
models: [MiniMax-M2.7]
tags: [official, coding, openai-compatible]
token-plan-anthropic:
display_name: MiniMax Token Plan (Anthropic)
protocol: anthropic
base_url: https://api.minimaxi.com/anthropic
default_model: MiniMax-M2.7
selected_model: MiniMax-M2.7
context_window: 204800
max_tokens: 2048
models: [MiniMax-M2.7]
tags: [official, coding, anthropic]
global-openai:
display_name: MiniMax Global
protocol: openai
base_url: https://api.minimax.io/v1
default_model: MiniMax-M2.7
selected_model: MiniMax-M2.7
context_window: 204800
max_tokens: 2048
models: [MiniMax-M2.7]
tags: [official, coding, openai-compatible, global]
global-anthropic:
display_name: MiniMax Global (Anthropic)
protocol: anthropic
base_url: https://api.minimax.io/anthropic
default_model: MiniMax-M2.7
selected_model: MiniMax-M2.7
context_window: 204800
max_tokens: 2048
models: [MiniMax-M2.7]
tags: [official, coding, anthropic, global]
ark:
display_name: Volcengine Ark Coding Plan
api_key: ${ARK_API_KEY}
endpoints:
coding-openai:
display_name: Ark Coding Plan
protocol: openai
base_url: https://ark.cn-beijing.volces.com/api/coding/v3
default_model: ark-code-latest
selected_model: ark-code-latest
context_window: 200000
max_tokens: 8192
models: [ark-code-latest]
tags: [official, coding, cn, openai-compatible]
coding-anthropic:
display_name: Ark Coding Plan (Anthropic)
protocol: anthropic
base_url: https://ark.cn-beijing.volces.com/api/coding
default_model: ark-code-latest
selected_model: ark-code-latest
context_window: 200000
max_tokens: 8192
models: [ark-code-latest]
tags: [official, coding, cn, anthropic]
together:
display_name: Together AI
api_key: ${TOGETHER_API_KEY}
endpoints:
api:
display_name: Together API
protocol: openai
base_url: https://api.together.xyz/v1
default_model: meta-llama/Meta-Llama-3.1-8B-Instruct-Turbo
selected_model: meta-llama/Meta-Llama-3.1-8B-Instruct-Turbo
max_tokens: 8192
models:
- meta-llama/Meta-Llama-3.1-8B-Instruct-Turbo
- meta-llama/Meta-Llama-3.1-70B-Instruct-Turbo
tags: [official, openai-compatible, open-models]
perplexity:
display_name: Perplexity
api_key: ${PERPLEXITY_API_KEY}
endpoints:
api:
display_name: Perplexity API
protocol: openai
base_url: https://api.perplexity.ai
default_model: llama-3.1-sonar-small-128k-online
selected_model: llama-3.1-sonar-small-128k-online
max_tokens: 8192
models:
- llama-3.1-sonar-small-128k-online
- llama-3.1-sonar-large-128k-online
tags: [official, openai-compatible, search]
# Directories the agent is allowed to access (relative to config file or absolute)
allowed_dirs:
- .
# ------------------------------------------------------------------
# IM (Instant Messaging) integration
# Connect ggcode to chat platforms for remote coding via IM.
# Use /im in the TUI to manage bindings, or configure adapters here.
# ------------------------------------------------------------------
im:
enabled: true
# Streaming: deliver agent output to IM channels in real-time
streaming:
enabled: true
transport: message # "message" (edit updates) or "reaction" (emoji ticker)
edit_interval_sec: 2.0 # seconds between edit updates
buffer_threshold: 500 # characters before flushing
# Output mode: controls how tool results are delivered to IM channels.
# Can also be changed at runtime via IM panel (v/q/s keys) or daemon follow (v/q/s hotkeys).
# verbose — every tool result sent individually (default)
# quiet — aggregated tool summary at round end; errors sent immediately
# summary — only final LLM response text + tool count summary
output_mode: verbose
# Speech-to-text for voice messages (optional)
# stt:
# provider: openai
# base_url: https://api.openai.com/v1
# api_key: ${OPENAI_API_KEY}
# model: whisper-1
adapters:
# QQ — requires a running QQ bot gateway
qq:
enabled: true
platform: qq
transport: ws
extra:
app_id: "your-qq-app-id"
token: "your-qq-bot-token"
# Telegram — uses long-polling or webhook
telegram:
enabled: true
platform: telegram
transport: polling
extra:
bot_token: ${TELEGRAM_BOT_TOKEN}
# Discord — uses Discord Gateway
discord:
enabled: true
platform: discord
extra:
bot_token: ${DISCORD_BOT_TOKEN}
# Feishu / Lark — uses Feishu SDK WebSocket long connection.
#
# Prerequisites in Feishu Developer Console (开发者后台):
# 1. Under "Events & Callbacks" (事件与回调), ensure the connection mode
# is set to "Long Connection / WebSocket" (长连接).
# 2. Under "Events & Callbacks" → "Callback Configuration" (回调配置),
# add the callback: card.action.trigger (卡片回传交互回调).
# NOTE: This is in "Callback Configuration" (回调配置), NOT in
# "Event Subscription" (事件订阅). The card callback and event
# subscription are separate sections.
# Without this step, card buttons will render but clicking them
# will produce error 200340 (card callback not configured).
feishu:
enabled: true
platform: feishu
extra:
app_id: "your-feishu-app-id"
app_secret: ${FEISHU_APP_SECRET}
# DingTalk — uses DingTalk Stream mode
dingtalk:
enabled: true
platform: dingtalk
extra:
client_id: "your-dingtalk-client-id"
client_secret: ${DINGTALK_CLIENT_SECRET}
# Slack — uses Slack Socket Mode
slack:
enabled: true
platform: slack
extra:
bot_token: ${SLACK_BOT_TOKEN}
app_token: ${SLACK_APP_TOKEN}
# Maximum agentic loop iterations per user turn (0 = unlimited)
max_iterations: 0
# Per-tool permission rules: ask (prompt user), allow (auto-approve), deny (block)
tool_permissions:
read_file: allow
multi_file_read: allow
write_file: ask
edit_file: ask
multi_edit_file: ask
multi_file_edit: ask
list_directory: allow
search_files: allow
glob: allow
run_command: ask
git_status: allow
git_diff: allow
git_log: allow
# Knight — background auto-evolution agent
# Knight analyzes sessions, creates/validates skills, generates tests,
# and maintains project health during idle time.
# Enabled by default; set enabled: false to disable.
knight:
# Knight is disabled by default. Enable with /knight on or set to true.
enabled: false
# Trust level: readonly (analyze only), staged (write, user approves), auto (auto-promote)
# trust_level: staged
# Daily token budget (default 5M tokens; set to 0 for unlimited)
# daily_token_budget: 5000000
# Idle delay before Knight starts tasks (default 300 seconds)
# idle_delay_sec: 300
# Quiet hours — no tasks or notifications during these ranges
# quiet_hours:
# - "23:00-07:00"
# Capabilities — which tasks Knight is allowed to perform
# capabilities:
# - skill_creation
# - skill_validation
# - test_generation
# - regression_testing
# - doc_sync
# Optional: use a different LLM for Knight tasks
# vendor: openai
# endpoint: gpt-4o
# model: gpt-4o-mini
# MCP servers for extended tool sets
mcp_servers:
- name: filesystem
command: npx
args:
- -y
- "@anthropic/mcp-filesystem"
- /path/to/allowed/dir
env:
NODE_ENV: production
- name: github
command: npx
args:
- -y
- "@anthropic/mcp-github"
env:
GITHUB_TOKEN: ${GITHUB_TOKEN}
# External tool plugins
plugins:
- name: my-tools
type: command
commands:
- name: deploy
description: Deploy the application to staging
execute: ./scripts/deploy.sh
args: ["--env", "staging"]
- name: lint_check
description: Run custom linter
execute: npm
args: ["run", "lint"]
# A2A protocol server — expose this ggcode instance as an A2A agent
# so other ggcode instances (or any A2A client) can discover and collaborate.
# Enabled by default on port 0 (auto-assign). Set disabled: true to opt out.
#
# a2a:
# enabled: true
# port: 0 # 0 = auto-assign (recommended for multi-instance)
# host: "" # auto: 0.0.0.0 when auth configured, 127.0.0.1 otherwise
# max_tasks: 5 # concurrent task limit
# task_timeout: "5m" # per-task timeout
# lan_discovery: true # enable mDNS broadcast for LAN discovery (requires auth)
#
# # Authentication — multiple schemes can be enabled simultaneously.
# # Server advertises enabled schemes in the agent card; clients auto-negotiate.
# # When at least one auth method is configured, host defaults to 0.0.0.0 (LAN accessible).
# # Without auth, host defaults to 127.0.0.1 (localhost only) for safety.
# auth:
# # --- API Key (simplest) ---
# api_key: "my-secret-key" # shared secret (supports ${ENV_VAR} expansion)
#
# # --- Additional API Keys (multi-key support) ---
# api_keys: # list of additional keys; any match authenticates
# - "team-alpha-key"
# - "team-beta-key"
# - "${TEAM_GAMMA_KEY}" # env var expansion supported
#
# # --- OAuth2 + PKCE / Device Flow ---
# # Use "provider" for built-in presets (github, google, auth0, azure)
# # or "issuer_url" for any custom OIDC-compliant IdP.
# oauth2:
# provider: "github" # built-in preset — zero config
# # client_id: "my-app" # override preset (optional)
# # client_secret: "xxx" # required for confidential clients
# # flow: "pkce" # "pkce" (default) or "device"
# # scopes: "read:org" # custom scopes (preset provides defaults)
# # issuer_url: "https://idp.example.com" # custom IdP
#
# # --- OpenID Connect (layer on OAuth2, adds ID token + userinfo) ---
# # oidc:
# # provider: "google"
# # client_id: "xxx"
# # client_secret: "xxx"
#
# # --- mTLS (mutual TLS — no tokens, strongest transport auth) ---
# # mtls:
# # cert_file: ".ggcode/certs/server.pem"
# # key_file: ".ggcode/certs/server.key"
# # ca_file: ".ggcode/certs/ca.pem"
#
# # Legacy top-level api_key still works (auth.api_key takes priority)
# # api_key: "legacy-key"
#
# Instance-level override: place .ggcode/a2a.yaml in the workspace root.
# It merges into the global a2a config, allowing per-project auth settings.
#
# Token cache: OAuth2/OIDC tokens are cached per-client at
# ~/.ggcode/oauth-tokens/{provider}-{clientID}.json
# with 0600 permissions. Cache is checked before prompting for re-auth.
# Same client_id = shared token (intentional). Different client_id = isolated.