forked from khezen/codespy
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.env.example
More file actions
194 lines (165 loc) · 8.1 KB
/
Copy path.env.example
File metadata and controls
194 lines (165 loc) · 8.1 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
# codespy Configuration
# Copy this file to .env and fill in your values
#
# NOTE: For advanced configuration (per-signature settings, model overrides),
# use codespy.yaml instead. See codespy.yaml for full options.
# Priority: Environment Variables > YAML Config > Defaults
# =============================================================================
# Git Platform Tokens
# =============================================================================
# GitHub Token
# Create a token at: https://github.com/settings/tokens
# Required scopes: repo (for private repos) or public_repo (for public repos only)
# Auto-discovered from: gh CLI, git credential helper, ~/.netrc, $GITHUB_TOKEN, $GH_TOKEN
GITHUB_TOKEN=ghp_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
# Disable GitHub token auto-discovery (default: true)
# GITHUB_AUTO_DISCOVER_TOKEN=false
# GitLab Token (for GitLab MRs)
# Create a token at: https://gitlab.com/-/profile/personal_access_tokens
# Required scopes: api (for full access) or read_api + write_repository
# Auto-discovered from: glab CLI, git credential helper, ~/.netrc, ~/.python-gitlab.cfg
# GITLAB_TOKEN=glpat-xxxxxxxxxxxxxxxxxxxx
# GITLAB_URL=https://gitlab.com
# Disable GitLab token auto-discovery (default: true)
# GITLAB_AUTO_DISCOVER_TOKEN=false
# =============================================================================
# LLM Configuration (choose one provider)
# =============================================================================
# Default model identifier (LiteLLM format)
# Examples:
# - claude-opus-4-6 (Anthropic direct)
# - claude-sonnet-4-5-20250929 (Anthropic direct)
# - bedrock/us.anthropic.claude-opus-4-6-v1 (AWS Bedrock)
# - bedrock/us.anthropic.claude-sonnet-4-5-20250929-v1:0 (AWS Bedrock)
# - bedrock/us.anthropic.claude-haiku-4-5-20251001-v1:0 (AWS Bedrock)
# - gpt-5 (OpenAI)
# - gpt-4-turbo (OpenAI)
# - gemini/gemini-2.5-pro (Google Gemini)
# - gemini/gemini-2.5-flash (Google Gemini)
# - ollama/llama-4-70b (Local Ollama)
DEFAULT_MODEL=claude-opus-4-6
# -----------------------------------------------------------------------------
# Option 1: Anthropic (direct)
# -----------------------------------------------------------------------------
# Auto-discovered from: $ANTHROPIC_API_KEY, ~/.config/anthropic/, ~/.anthropic/
# ANTHROPIC_API_KEY=sk-ant-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
# -----------------------------------------------------------------------------
# Option 2: AWS Bedrock
# -----------------------------------------------------------------------------
# Auto-discovered from: ~/.aws/credentials, AWS CLI, $AWS_ACCESS_KEY_ID
# AWS_REGION=us-east-1
# AWS_ACCESS_KEY_ID=AKIAIOSFODNN7EXAMPLE
# AWS_SECRET_ACCESS_KEY=wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
# AWS_PROFILE=default
# -----------------------------------------------------------------------------
# Option 3: OpenAI
# -----------------------------------------------------------------------------
# Auto-discovered from: $OPENAI_API_KEY, ~/.config/openai/, ~/.openai/
# OPENAI_API_KEY=sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
# -----------------------------------------------------------------------------
# Option 4: Google Gemini
# -----------------------------------------------------------------------------
# Auto-discovered from: $GEMINI_API_KEY, $GOOGLE_API_KEY, gcloud ADC
# GEMINI_API_KEY=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
# -----------------------------------------------------------------------------
# Option 5: Azure OpenAI
# -----------------------------------------------------------------------------
# AZURE_API_KEY=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
# AZURE_API_BASE=https://your-resource.openai.azure.com/
# AZURE_API_VERSION=2024-02-15-preview
# =============================================================================
# Auto-Discovery Settings
# =============================================================================
# Disable auto-discovery for specific providers (all default to true)
# AUTO_DISCOVER_OPENAI=false
# AUTO_DISCOVER_ANTHROPIC=false
# AUTO_DISCOVER_GEMINI=false
# AUTO_DISCOVER_AWS=false
# =============================================================================
# Recommended Model Strategy
# =============================================================================
# codespy uses a tiered model approach to balance review quality and cost:
#
# Smart (DEFAULT_MODEL): Core analysis — defect detection, supply chain,
# scope identification, doc review. Requires strong reasoning.
# Recommended: claude-opus-4-6 or equivalent.
#
# Mid-tier (EXTRACTION_MODEL + DEDUPLICATION_MODEL): Structured field
# extraction and issue deduplication. Needs accuracy but not deep
# reasoning. Recommended: claude-sonnet-4-5-20250929 or equivalent.
#
# Cheap (SUMMARIZATION_MODEL): PR summary generation. Simple synthesis.
# Recommended: claude-haiku-4-5-20251001 or equivalent.
#
# By default, all models fall back to DEFAULT_MODEL. To optimize costs:
# EXTRACTION_MODEL=claude-sonnet-4-5-20250929
# DEDUPLICATION_MODEL=claude-sonnet-4-5-20250929
# SUMMARIZATION_MODEL=claude-haiku-4-5-20251001
# =============================================================================
# Default Settings
# =============================================================================
# These apply to all signatures unless overridden per-signature
# Extraction model for TwoStepAdapter (extracts structured fields from free-form LLM responses)
# Falls back to DEFAULT_MODEL if not set
# EXTRACTION_MODEL=claude-sonnet-4-5-20250929
# DEFAULT_MAX_ITERS=3
# DEFAULT_MAX_CONTEXT_SIZE=50000
# Limits LLM reasoning verbosity (helps prevent JSONAdapter failures)
# DEFAULT_MAX_REASONING_TOKENS=1024
# Lower = more deterministic JSON output
# DEFAULT_TEMPERATURE=0.1
# Global LLM reliability settings
# Number of retries for LLM API calls
# LLM_RETRIES=3
# Timeout in seconds for LLM calls
# LLM_TIMEOUT=240
# Enable provider-side prompt caching (reduces latency and costs)
# ENABLE_PROMPT_CACHING=true
# =============================================================================
# Output Settings
# =============================================================================
# Output format: markdown or json (default: markdown)
# OUTPUT_FORMAT=markdown
# Enable stdout output (default: true)
# OUTPUT_STDOUT=true
# Post review to Git platform (GitHub PR or GitLab MR) (default: false)
# OUTPUT_GIT=false
# Cache directory for cloned repositories (default: ~/.cache/codespy)
# CACHE_DIR=/path/to/cache
# =============================================================================
# Per-Signature Configuration (override via env vars)
# =============================================================================
# Use underscore (_) between signature name and setting
# Format: SIGNATURE_NAME_SETTING=value
#
# Available signatures:
# - DEFECT_DETECTION (bugs, logic errors, security vulnerabilities)
# - SUPPLY_CHAIN (supply chain security analysis)
# - DOC_REVIEW (documentation review)
# - SCOPE_IDENTIFICATION (code scope detection)
# - DEDUPLICATION (issue deduplication)
# - SUMMARIZATION (PR summary generation)
#
# Available settings per signature:
# - ENABLED (true/false)
# - MAX_ITERS (integer)
# - MODEL (LiteLLM model string)
# - MAX_CONTEXT_SIZE (integer)
# - MAX_REASONING_TOKENS (integer) - Limits reasoning verbosity
# - TEMPERATURE (float) - Lower = more deterministic output
# Examples:
# DEFECT_DETECTION_ENABLED=true
# DEFECT_DETECTION_MAX_ITERS=10
# DEFECT_DETECTION_MODEL=claude-sonnet-4-5-20250929
# DEFECT_DETECTION_MAX_REASONING_TOKENS=512
# DEFECT_DETECTION_TEMPERATURE=0.1
# SUPPLY_CHAIN_ENABLED=true
# DOC_REVIEW_ENABLED=true
# DOC_REVIEW_MODEL=claude-sonnet-4-5-20250929
# SCOPE_IDENTIFICATION_ENABLED=true
# SCOPE_IDENTIFICATION_MAX_ITERS=10
# SCOPE_IDENTIFICATION_MAX_REASONING_TOKENS=1024
# DEDUPLICATION_ENABLED=true
# DEDUPLICATION_MODEL=claude-sonnet-4-5-20250929
# SUMMARIZATION_ENABLED=true
# SUMMARIZATION_MODEL=claude-haiku-4-5-20251001