| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
A comprehensive coding agent that integrates AI capabilities with your development environment
npx forgecode@latest
To get started with Forge, set up your provider API keys in your .env file, then run Forge using the command below:
npx forgecode@latestThat's it! Forge is now ready to assist you with your development tasks.
Forge can be used in different ways depending on your needs. Here are some common usage patterns:
Code Understanding> Can you explain how the authentication system works in this codebase?
Forge will analyze your project's structure, identify authentication-related files, and provide a detailed explanation of the authentication flow, including the relationships between different components.
Implementing New Features> I need to add a dark mode toggle to our React application. How should I approach this?
Forge will suggest the best approach based on your current codebase, explain the steps needed, and even scaffold the necessary components and styles for you.
Debugging Assistance> I'm getting this error: "TypeError: Cannot read property 'map' of undefined". What might be causing it?
Forge will analyze the error, suggest potential causes based on your code, and propose different solutions to fix the issue.
Code Reviews> Please review the code in src/components/UserProfile.js and suggest improvements
Forge will analyze the code, identify potential issues, and suggest improvements for readability, performance, security, and maintainability.
Learning New Technologies> I want to integrate GraphQL into this Express application. Can you explain how to get started?
Forge will provide a tailored tutorial on integrating GraphQL with Express, using your specific project structure as context.
Database Schema Design> I need to design a database schema for a blog with users, posts, comments, and categories
Forge will suggest an appropriate schema design, including tables/collections, relationships, indexes, and constraints based on your project's existing database technology.
Refactoring Legacy Code> Help me refactor this class-based component to use React Hooks
Forge can help modernize your codebase by walking you through refactoring steps and implementing them with your approval.
Git Operations> I need to merge branch 'feature/user-profile' into main but there are conflicts
Forge can guide you through resolving git conflicts, explaining the differences and suggesting the best way to reconcile them.
Forge is designed for developers who want to enhance their workflow with AI assistance while maintaining full control over their development environment.
Forge helps you code faster, solve complex problems, and learn new technologies without leaving your terminal.
Here's a quick reference of Forge's command-line options:
| Option | Description |
|---|---|
| -p, --prompt <PROMPT> | Direct prompt to process without entering interactive mode |
| -c, --command <COMMAND> | Path to a file containing initial commands to execute |
| -w, --workflow <WORKFLOW> | Path to a file containing the workflow to execute |
| -e, --event <EVENT> | Dispatch an event to the workflow |
| --conversation <CONVERSATION> | Path to a file containing the conversation to execute |
| -r, --restricted | Enable restricted shell mode for enhanced security |
| --verbose | Enable verbose output mode |
| -h, --help | Print help information |
| -V, --version | Print version |
Forge supports multiple AI providers. Below are setup instructions for each supported provider
OpenRouter# .env
OPENROUTER_API_KEY=<your_openrouter_api_key>No changes in forge.yaml required
Requesty# .env
REQUESTY_API_KEY=<your_requesty_api_key>No changes in forge.yaml required
x-ai# .env
XAI_API_KEY=<your_xai_api_key>switch the model using /model command in the Forge CLI.
z.ai# .env
ZAI_API_KEY=<your_zai_api_key>If you have a coding plan subscription, instead of setting ZAI_API_KEY, set ZAI_CODING_API_KEY and Forge will use your coding plan instead of standard API pricing:
# .env
ZAI_CODING_API_KEY=<your_zai_coding_api_key>switch the model using /model command in the Forge CLI.
Cerebras# .env
CEREBRAS_API_KEY=<your_cerebras_api_key>switch the model using /model command in the Forge CLI.
OpenAI# .env
OPENAI_API_KEY=<your_openai_api_key># forge.yaml
model: o3-mini-high# .env
ANTHROPIC_API_KEY=<your_anthropic_api_key># forge.yaml
model: claude-3.7-sonnet# .env
PROJECT_ID=<your_project_id>
LOCATION=<your_location>
VERTEX_AI_AUTH_TOKEN=<your_auth_token># forge.yaml
model: google/gemini-2.5-proInstall Google Cloud CLI and authenticate:
gcloud auth login
gcloud config set project YOUR_PROJECT_IDGet your authentication token:
gcloud auth print-access-tokenUse this token as VERTEX_AI_AUTH_TOKEN.
Find your project ID and location:
Forge loads Vertex AI models from a static configuration file, including:
Use the /model command in Forge CLI to see all available models.
OpenAI-Compatible Providers# .env
OPENAI_API_KEY=<your_provider_api_key>
OPENAI_URL=<your_provider_url># forge.yaml
model: <provider-specific-model># .env
OPENAI_API_KEY=<your_groq_api_key>
OPENAI_URL=https://api.groq.com/openai/v1# forge.yaml
model: deepseek-r1-distill-llama-70bTo use Amazon Bedrock models with Forge, you'll need to first set up the Bedrock Access Gateway:
Set up Bedrock Access Gateway:
Create these files in your project directory:
# .env
OPENAI_API_KEY=<your_bedrock_gateway_api_key>
OPENAI_URL=<your_bedrock_gateway_base_url># forge.yaml
model: anthropic.claude-3-opusForge supports several environment variables for advanced configuration and fine-tuning. These can be set in your .env file or system environment.
Retry ConfigurationControl how Forge handles retry logic for failed requests:
# .env
FORGE_RETRY_INITIAL_BACKOFF_MS=1000 # Initial backoff time in milliseconds (default: 1000)
FORGE_RETRY_BACKOFF_FACTOR=2 # Multiplier for backoff time (default: 2)
FORGE_RETRY_MAX_ATTEMPTS=3 # Maximum retry attempts (default: 3)
FORGE_SUPPRESS_RETRY_ERRORS=false # Suppress retry error messages (default: false)
FORGE_RETRY_STATUS_CODES=429,500,502 # HTTP status codes to retry (default: 429,500,502,503,504)Fine-tune HTTP client behavior for API requests:
# .env
FORGE_HTTP_CONNECT_TIMEOUT=30 # Connection timeout in seconds (default: 30)
FORGE_HTTP_READ_TIMEOUT=900 # Read timeout in seconds (default: 900)
FORGE_HTTP_POOL_IDLE_TIMEOUT=90 # Pool idle timeout in seconds (default: 90)
FORGE_HTTP_POOL_MAX_IDLE_PER_HOST=5 # Max idle connections per host (default: 5)
FORGE_HTTP_MAX_REDIRECTS=10 # Maximum redirects to follow (default: 10)
FORGE_HTTP_USE_HICKORY=false # Use Hickory DNS resolver (default: false)
FORGE_HTTP_TLS_BACKEND=default # TLS backend: "default" or "rustls" (default: "default")
FORGE_HTTP_MIN_TLS_VERSION=1.2 # Minimum TLS version: "1.0", "1.1", "1.2", "1.3"
FORGE_HTTP_MAX_TLS_VERSION=1.3 # Maximum TLS version: "1.0", "1.1", "1.2", "1.3"
FORGE_HTTP_ADAPTIVE_WINDOW=true # Enable HTTP/2 adaptive window (default: true)
FORGE_HTTP_KEEP_ALIVE_INTERVAL=60 # Keep-alive interval in seconds (default: 60, use "none"/"disabled" to disable)
FORGE_HTTP_KEEP_ALIVE_TIMEOUT=10 # Keep-alive timeout in seconds (default: 10)
FORGE_HTTP_KEEP_ALIVE_WHILE_IDLE=true # Keep-alive while idle (default: true)
FORGE_HTTP_ACCEPT_INVALID_CERTS=false # Accept invalid certificates (default: false) - USE WITH CAUTION
FORGE_HTTP_ROOT_CERT_PATHS=/path/to/cert1.pem,/path/to/cert2.crt # Paths to root certificate files (PEM, CRT, CER format), multiple paths separated by commasAPI Configuration⚠️ Security Warning: Setting FORGE_HTTP_ACCEPT_INVALID_CERTS=true disables SSL/TLS certificate verification, which can expose you to man-in-the-middle attacks. Only use this in development environments or when you fully trust the network and endpoints.
Override default API endpoints:
# .env
FORGE_API_URL=https://api.forgecode.dev # Custom Forge API URL (default: https://api.forgecode.dev)Configuring the tool calls settings:
# .env
FORGE_TOOL_TIMEOUT=300 # Maximum execution time in seconds for a tool before it is terminated to prevent hanging the session. (default: 300)
FORGE_DUMP_AUTO_OPEN=false # Automatically open dump files in browser (default: false)Configure the ZSH plugin behavior:
# .env
FORGE_BIN=forge # Command to use for forge operations (default: "forge")The FORGE_BIN environment variable allows you to customize the command used by the ZSH plugin when transforming # prefixed commands. If not set, it defaults to "forge".
System ConfigurationSystem-level environment variables (usually set automatically):
# .env
FORGE_MAX_SEARCH_RESULT_BYTES=101024 # Maximum bytes for search results (default: 101024 - 10 KB)
FORGE_HISTORY_FILE=/path/to/history # Custom path for Forge history file (default: uses system default location)
SHELL=/bin/zsh # Shell to use for command execution (Unix/Linux/macOS)
COMSPEC=cmd.exe # Command processor to use (Windows)The forge.yaml file supports several advanced configuration options that let you customize Forge's behavior.
Custom RulesAdd your own guidelines that all agents should follow when generating responses.
# forge.yaml
custom_rules: |
1. Always add comprehensive error handling to any code you write.
2. Include unit tests for all new functions.
3. Follow our team's naming convention: camelCase for variables, PascalCase for classes.Define custom commands as shortcuts for repetitive prompts:
# forge.yaml
commands:
- name: "refactor"
description: "Refactor selected code"
prompt: "Please refactor this code to improve readability and performance"Specify the default AI model to use for all agents in the workflow.
# forge.yaml
model: "claude-3.7-sonnet"Control how deeply Forge traverses your project directory structure when gathering context.
# forge.yaml
max_walker_depth: 3 # Limit directory traversal to 3 levels deepAdjust the creativity and randomness in AI responses. Lower values (0.0-0.3) produce more focused, deterministic outputs, while higher values (0.7-2.0) generate more diverse and creative results.
# forge.yaml
temperature: 0.7 # Balanced creativity and focusControl how many times a tool can fail before Forge forces completion to prevent infinite retry loops. This helps avoid situations where an agent gets stuck repeatedly trying the same failing operation.
# forge.yaml
max_tool_failure_per_turn: 3 # Allow up to 3 failures per tool before forcing completionSet to a higher value if you want more retry attempts, or lower if you want faster failure detection.
Max Requests Per TurnLimit the maximum number of requests an agent can make in a single conversation turn. This prevents runaway conversations and helps control API usage and costs.
# forge.yaml
max_requests_per_turn: 50 # Allow up to 50 requests per turnWhen this limit is reached, Forge will:
The MCP feature allows AI agents to communicate with external tools and services. This implementation follows Anthropic's Model Context Protocol design.
Configure MCP servers using the CLI:
# List all MCP servers
forge mcp list
# Add a new server
forge mcp add
# Add a server using JSON format
forge mcp add-json
# Get server details
forge mcp get
# Remove a server
forge mcp removeOr manually create a .mcp.json file with the following structure:
{
"mcpServers": {
"server_name": {
"command": "command_to_execute",
"args": ["arg1", "arg2"],
"env": { "ENV_VAR": "value" }
},
"another_server": {
"url": "http://localhost:3000/events"
}
}
}MCP configurations are read from two locations (in order of precedence):
MCP can be used for various integrations:
MCP tools can be used as part of multi-agent workflows, allowing specialized agents to interact with external systems as part of a collaborative problem-solving approach.
For comprehensive documentation on all features and capabilities, please visit the documentation site.
Join our vibrant Discord community to connect with other Forge users and contributors, get help with your projects, share ideas, and provide feedback!
Your support drives Forge's continued evolution! By starring our GitHub repository, you:
| Back | FazBrowse Home | New Git URL |