server/env.ts.
Setup
Copy the.env.example file to .env in the source directory:
Slack Configuration
These variables configure the Slack app connection and behavior.Bot User OAuth Token from OAuth & Permissions section in your Slack app.
- Format: Starts with
xoxb- - Get it from: https://api.slack.com/authentication/token-types
- Scopes needed: See
slack-manifest.json
Signing secret used to verify requests from Slack.
- Get it from: Basic Information section of your Slack app
- Used to validate webhook authenticity
App-level token for Socket Mode. Required if
SLACK_SOCKET_MODE=true.- Format: Starts with
xapp- - Requires:
connections:writescope - Get it from: Basic Information > App-Level Tokens
- Docs: https://api.slack.com/apis/connections/socket
Enable Socket Mode for receiving events (recommended for local development).
true: Use WebSocket connection (requiresSLACK_APP_TOKEN)false: Use HTTP endpoints (requires public URL andPORT)- Default:
false
HTTP port to listen on when Socket Mode is disabled.
Channel ID to automatically add users to when they first mention the bot.
- Format: Slack channel ID (e.g.,
C12345678) - Use case: Onboarding users to a community channel
Channel ID that users must join before they can use Gorkie beyond simple pings.
- Format: Slack channel ID (e.g.,
C12345678) - Use case: Require opt-in for advanced features
AI Providers
Gorkie supports multiple AI model providers. Both are currently required.Primary AI model provider API key from Hack Club.
- Format: Must start with
sk-hc- - Get it from: https://ai.hackclub.com/
- Used as: Primary inference provider
Secondary AI model provider API key from OpenRouter.
- Format: Must start with
sk-or- - Get it from: https://openrouter.ai/keys
- Used as: Secondary inference provider
Database
PostgreSQL database connection string.See Database Setup for detailed instructions.
- Format:
postgresql://user:password@host:5432/dbname?sslmode=require - Supports: Postgres, Neon, or any Postgres-compatible database
- Used for: Storing sandbox sessions and scheduled tasks
Redis
Redis connection string for caching and rate limiting.See Redis Setup for detailed instructions.
- Format:
redis://host:portorrediss://host:port(SSL) - Local:
redis://localhost:6379 - Cloud: Varies by provider (Upstash, Redis Cloud, etc.)
E2B Sandbox
API key for E2B code execution sandboxes.
- Get it from: https://e2b.dev/
- Used for: Secure code execution in isolated environments
- Template: Auto-builds
gorkie-sandbox:latestif missing
API key for AgentMail service (used by sandbox environment).
- Format: Must start with
am_ - Used for: Email functionality in sandbox sessions
Web Search
API key for Exa web search functionality.
- Get it from: https://exa.ai/docs/home
- Used for: AI-powered web searches
Observability (Langfuse)
Langfuse provides tracing and observability for AI model calls.Public key for Langfuse tracing.
- Format: Starts with
pk-lf- - Required with:
LANGFUSE_SECRET_KEY
Langfuse API base URL.
- EU region:
https://cloud.langfuse.com(default) - US region:
https://us.cloud.langfuse.com - Self-hosted: Your instance URL
Logging
Logging verbosity level for Pino logger.
- Options:
debug,info,warn,error - Production: Use
infoorwarn - Development: Use
debugfor detailed logs
Directory path for log file output.
- Relative or absolute path
- Created automatically if it doesn’t exist
Runtime
Runtime environment mode.
- Options:
development,production,test - Affects: Logging format, error handling, and performance optimizations
Validation
All environment variables are validated on startup using Zod schemas inserver/env.ts. If any required variable is missing or invalid, the application will fail to start with a descriptive error message.
Access environment variables in code via
env.VARIABLE_NAME, not process.env.VARIABLE_NAME. This ensures type safety and validation.