Skip to content

Commit ba5021f

Browse files
shssoichiroRSO
andauthored
doc: instructions for local dev without Vercel access (#1697)
Co-authored-by: Remon Oldenbeuving <remon@kilocode.ai>
1 parent b1f01ca commit ba5021f

2 files changed

Lines changed: 172 additions & 1 deletion

File tree

.env.local.example

Lines changed: 155 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,155 @@
1+
# ============================================================================
2+
# REQUIRED - Application Core
3+
# ============================================================================
4+
# Node environment
5+
NODE_ENV=development
6+
# NextAuth configuration (generate a secure random string)
7+
# Run: openssl rand -base64 32
8+
NEXTAUTH_SECRET=changeme
9+
# NextAuth URL (will be auto-set by dev script, but can override)
10+
NEXTAUTH_URL=http://localhost:3000
11+
# Database connection
12+
POSTGRES_URL=postgresql://postgres:postgres@localhost:5432/postgres
13+
POSTGRES_CONNECT_TIMEOUT=10000
14+
POSTGRES_MAX_QUERY_TIME=20000
15+
# ============================================================================
16+
# REQUIRED - Security & Turnstile
17+
# ============================================================================
18+
# Turnstile (Cloudflare captcha) - use test keys for local dev
19+
NEXT_PUBLIC_TURNSTILE_SITE_KEY=1x00000000000000000000AA
20+
TURNSTILE_SECRET_KEY=1x0000000000000000000000000000000
21+
STYTCH_PROJECT_ID=test-fake-project-id
22+
STYTCH_PROJECT_SECRET=test-fake-project-secret
23+
R2_ACCOUNT_ID=mock-test-account-id
24+
R2_ACCESS_KEY_ID=mock-test-access-key
25+
R2_SECRET_ACCESS_KEY=mock-test-secret-key
26+
R2_CLI_SESSIONS_BUCKET_NAME=test-bucket
27+
# ============================================================================
28+
# AI / Model Inference (Required for AI features)
29+
# ============================================================================
30+
# OpenRouter (primary AI provider) - get from https://openrouter.ai/keys
31+
OPENROUTER_API_KEY=sk-or-v1-your-openrouter-key
32+
# Optional: Other AI providers
33+
OPENAI_API_KEY=sk-your-openai-key
34+
MISTRAL_API_KEY=your-mistral-key
35+
XAI_API_KEY=your-xai-grok-key
36+
# ============================================================================
37+
# OAuth Providers (Required for real OAuth login)
38+
# ============================================================================
39+
# GitHub OAuth - create at https://github.com/settings/developers
40+
GITHUB_CLIENT_ID=your-github-client-id
41+
GITHUB_CLIENT_SECRET=your-github-client-secret
42+
# Google OAuth - create at https://console.cloud.google.com/auth/clients
43+
GOOGLE_CLIENT_ID=your-google-client-id
44+
GOOGLE_CLIENT_SECRET=your-google-client-secret
45+
# GitLab OAuth - create at https://gitlab.com/-/profile/applications
46+
GITLAB_CLIENT_ID=your-gitlab-client-id
47+
GITLAB_CLIENT_SECRET=your-gitlab-client-secret
48+
# LinkedIn OAuth - create at https://www.linkedin.com/developers/apps
49+
LINKEDIN_CLIENT_ID=your-linkedin-client-id
50+
LINKEDIN_CLIENT_SECRET=your-linkedin-client-secret
51+
# Discord OAuth (optional)
52+
DISCORD_CLIENT_ID=your-discord-client-id
53+
DISCORD_CLIENT_SECRET=your-discord-client-secret
54+
# ============================================================================
55+
# Billing & Stripe (Required for billing features)
56+
# ============================================================================
57+
# Stripe - get from https://dashboard.stripe.com/test/apikeys
58+
STRIPE_SECRET_KEY=sk_test_changeme
59+
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY=pk_test_changeme
60+
# Stripe product/price IDs (use test values)
61+
STRIPE_TEAMS_SUBSCRIPTION_PRODUCT_ID=prod_test_teams
62+
STRIPE_ENTERPRISE_SUBSCRIPTION_PRODUCT_ID=prod_test_enterprise
63+
STRIPE_TOP_UP_PRICE_ID=price_test_topup
64+
# Kilo Pass pricing (test values)
65+
STRIPE_KILO_PASS_TIER_19_MONTHLY_PRICE_ID=price_test_tier_19_monthly
66+
STRIPE_KILO_PASS_TIER_19_YEARLY_PRICE_ID=price_test_tier_19_yearly
67+
STRIPE_KILO_PASS_TIER_49_MONTHLY_PRICE_ID=price_test_tier_49_monthly
68+
STRIPE_KILO_PASS_TIER_49_YEARLY_PRICE_ID=price_test_tier_49_yearly
69+
STRIPE_KILO_PASS_TIER_199_MONTHLY_PRICE_ID=price_test_tier_199_monthly
70+
STRIPE_KILO_PASS_TIER_199_YEARLY_PRICE_ID=price_test_tier_199_yearly
71+
# KiloClaw pricing (test values)
72+
STRIPE_KILOCLAW_EARLYBIRD_PRICE_ID=price_test_kiloclaw_earlybird
73+
STRIPE_KILOCLAW_EARLYBIRD_COUPON_ID=coupon_test_kiloclaw_earlybird
74+
STRIPE_KILOCLAW_COMMIT_PRICE_ID=price_test_kiloclaw_commit
75+
STRIPE_KILOCLAW_STANDARD_PRICE_ID=price_test_kiloclaw_standard
76+
STRIPE_KILOCLAW_STANDARD_FIRST_MONTH_COUPON_ID=coupon_test_kiloclaw_standard_first_month
77+
# ============================================================================
78+
# Internal Services (Optional - use defaults for local dev)
79+
# ============================================================================
80+
# Internal API secret (generate: openssl rand -base64 32)
81+
INTERNAL_API_SECRET=changeme
82+
# Worker URLs (defaults shown, workers are optional)
83+
CLOUD_AGENT_API_URL=http://localhost:8788
84+
WEBHOOK_AGENT_URL=http://localhost:8793
85+
SESSION_INGEST_WORKER_URL=
86+
CODE_REVIEW_WORKER_URL=mock-url
87+
CODE_REVIEW_WORKER_AUTH_TOKEN=mock-token
88+
AUTO_TRIAGE_URL='mock-url'
89+
AUTO_TRIAGE_AUTH_TOKEN='mock-key'
90+
AUTO_FIX_URL='mock-url'
91+
AUTO_FIX_AUTH_TOKEN='mock-key'
92+
APP_BUILDER_URL=
93+
APP_BUILDER_AUTH_TOKEN=
94+
KILOCLAW_API_URL=
95+
# ============================================================================
96+
# Optional Services (Can be left empty)
97+
# ============================================================================
98+
# WorkOS (for enterprise SSO)
99+
WORKOS_API_KEY=sk_foo
100+
WORKOS_CLIENT_ID=
101+
# Email (Mailgun)
102+
MAILGUN_API_KEY=
103+
MAILGUN_DOMAIN=
104+
NEVERBOUNCE_API_KEY=
105+
# Vector databases
106+
QDRANT_HOST=
107+
QDRANT_API_KEY=
108+
MILVUS_ADDRESS=
109+
MILVUS_TOKEN=
110+
# Analytics
111+
NEXT_PUBLIC_POSTHOG_KEY=
112+
# Sentry (error tracking)
113+
SENTRY_ORG=
114+
SENTRY_PROJECT=
115+
NEXT_PUBLIC_SENTRY_DSN=
116+
# Encryption keys (generate if needed)
117+
BYOK_ENCRYPTION_KEY=
118+
CREDIT_CATEGORIES_ENCRYPTION_KEY=
119+
# Agent environment vars encryption (RSA public key, base64 encoded)
120+
AGENT_ENV_VARS_PUBLIC_KEY=
121+
# User deployments
122+
USER_DEPLOYMENTS_API_BASE_URL=
123+
USER_DEPLOYMENTS_API_AUTH_KEY=
124+
USER_DEPLOYMENTS_ENV_VARS_PUBLIC_KEY=
125+
# Slack integration
126+
SLACK_CLIENT_ID=
127+
SLACK_CLIENT_SECRET=
128+
SLACK_SIGNING_SECRET=
129+
SLACK_USER_FEEDBACK_WEBHOOK_URL=
130+
SLACK_DEPLOY_THREAT_WEBHOOK_URL=
131+
# Discord bot
132+
DISCORD_BOT_TOKEN=
133+
DISCORD_PUBLIC_KEY=
134+
DISCORD_OAUTH_CLIENT_ID=
135+
DISCORD_OAUTH_CLIENT_SECRET=
136+
DISCORD_OAUTH_BOT_TOKEN=
137+
DISCORD_SERVER_ID=
138+
# Google services
139+
GOOGLE_WEB_RISK_API_KEY=
140+
GOOGLE_SHEETS_SPREADSHEET_ID=
141+
GOOGLE_SERVICE_ACCOUNT_EMAIL=
142+
# Other services
143+
ARTIFICIAL_ANALYSIS_API_KEY=
144+
AI_ATTRIBUTION_ADMIN_SECRET=
145+
GASTOWN_SERVICE_URL=
146+
O11Y_SERVICE_URL=
147+
CRON_SECRET=
148+
# Abuse detection
149+
ABUSE_SERVICE_URL=
150+
ABUSE_SERVICE_CF_ACCESS_CLIENT_ID=
151+
ABUSE_SERVICE_CF_ACCESS_CLIENT_SECRET=
152+
# Feature flags
153+
KILOCLAW_BILLING_ENFORCEMENT=false
154+
# Debug options
155+
DEBUG_SHOW_DEV_UI=1

DEVELOPMENT.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ brew install --cask docker
7474

7575
**Important:** Open Docker Desktop at least once after installation — it configures the CLI tools needed for `docker compose`.
7676

77-
### Vercel CLI
77+
### Vercel CLI (recommended if you have access)
7878

7979
Used to pull environment variables from the Vercel project:
8080

@@ -108,6 +108,8 @@ git lfs pull
108108

109109
### 3. Set up environment variables
110110

111+
#### a. Set up using Vercel
112+
111113
The project pulls environment variables from Vercel. Run these commands interactively (each will prompt for browser-based authentication):
112114

113115
```bash
@@ -125,6 +127,20 @@ The KiloClaw pages (`/claw/*`) render the Pylon support chat widget, which requi
125127

126128
Both are already present in Vercel and pulled by `vercel env pull`. If either is missing the widget is silently skipped, so local dev continues to work without Pylon configured.
127129

130+
#### b. Set up manually
131+
132+
If you do not have Vercel access (typical for non-Kilo-employees), you will need to set up the `.env.local` file manually.
133+
134+
Copy `.env.local.example` to `.env.local`, then update the following variables in `.env.local`:
135+
136+
- `NEXTAUTH_SECRET`: Generate a random secret with `openssl rand -base64 32`
137+
- `INTERNAL_API_SECRET`: Generate a random secret with `openssl rand -base64 32`
138+
- `STRIPE_SECRET_KEY` and `NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY`: These must be set to create a fake account. You can use an existing Stripe account or create a new one, and use the keys from Sandbox Mode (formerly Test Mode) here.
139+
140+
Then copy `.env.development.local.example` to `.env.development.local`.
141+
142+
These changes will allow you to do local testing with a fake account.
143+
128144
### 4. Start the database
129145

130146
The project uses PostgreSQL 18 with pgvector, running via Docker. The compose file is at `dev/docker-compose.yml`:

0 commit comments

Comments
 (0)