### Install Forge CLI Source: https://github.com/tailcallhq/forgecode/blob/main/README.md Installs the Forge command-line interface. This is the initial step to get Forge running on your system. ```bash curl -fsSL https://forgecode.dev/cli | sh ``` -------------------------------- ### Session Flow Example Source: https://github.com/tailcallhq/forgecode/blob/main/shell-plugin/README.md Shows a typical session flow, starting with a general topic, asking specific questions, referencing files, and then starting a new conversation. ```bash : I'm working on a Rust web API : What are the best practices for error handling? : Show me an example with @[src/errors.rs] :info :new : New conversation starts here ``` -------------------------------- ### PDF Processing Quick Start Example Source: https://github.com/tailcallhq/forgecode/blob/main/crates/forge_repo/src/skills/create-skill/SKILL.md Demonstrates how to extract text from a PDF using the pdfplumber library. This is a basic example for getting started. ```markdown # PDF Processing ## Quick start Extract text with pdfplumber: [code example] ``` -------------------------------- ### Documentation Query Test Case Example Source: https://github.com/tailcallhq/forgecode/blob/main/benchmarks/evals/semantic_search_quality/README.md Example of a test case for finding documentation, specifying expected and to-be-avoided file types. ```yaml - task: "Find documentation on how to configure semantic search" intent: "documentation" expected_file_types: "markdown,txt" should_avoid: "rust,typescript,javascript" ``` -------------------------------- ### Forge YAML Configuration Example Source: https://github.com/tailcallhq/forgecode/blob/main/README.md Example Forge YAML configuration snippets for different AI models. ```yaml # forge.yaml model: meta-llama/Llama-3.3-70B-Instruct ``` ```yaml # forge.yaml model: o3-mini-high ``` ```yaml # forge.yaml model: claude-3.7-sonnet ``` ```yaml # forge.yaml model: google/gemini-2.5-pro ``` ```yaml # forge.yaml model: ``` -------------------------------- ### Implementation Query Test Case Example Source: https://github.com/tailcallhq/forgecode/blob/main/benchmarks/evals/semantic_search_quality/README.md Example of a test case for finding implementation code, specifying expected and to-be-avoided file types. ```yaml - task: "Find the retry mechanism with exponential backoff implementation" intent: "implementation" expected_file_types: "rust,typescript,javascript" should_avoid: "markdown,txt,documentation" ``` -------------------------------- ### Google Vertex AI Setup and Configuration (Deprecated) Source: https://github.com/tailcallhq/forgecode/blob/main/README.md Legacy environment variable setup for Google Vertex AI. This method is deprecated; use `forge provider login` instead. Requires project ID, location, and an auth token. ```bash # .env PROJECT_ID= LOCATION= VERTEX_AI_AUTH_TOKEN= ``` -------------------------------- ### Basic Command Examples Source: https://github.com/tailcallhq/forgecode/blob/main/shell-plugin/README.md Illustrates basic usage of the Forge shell plugin for various tasks like asking questions, explaining concepts, and planning projects. ```bash : What's the weather like? :sage Explain the MVC pattern :planner Help me structure this project ``` -------------------------------- ### Install fd - Fast File Finder Source: https://github.com/tailcallhq/forgecode/blob/main/shell-plugin/README.md Installs the 'fd' command-line tool, a prerequisite for the Forge ZSH plugin, on Ubuntu/Debian systems. ```bash # Ubuntu/Debian sudo apt install fd-find ``` -------------------------------- ### Start Forge Application Source: https://github.com/tailcallhq/forgecode/blob/main/README.md Launches the Forge application after provider credentials have been configured. Forge will then be ready to assist with development tasks. ```bash forge ``` -------------------------------- ### Install fd - Fast File Finder Source: https://github.com/tailcallhq/forgecode/blob/main/shell-plugin/README.md Installs the 'fd' command-line tool, a prerequisite for the Forge ZSH plugin, on macOS using Homebrew. ```bash # macOS (using Homebrew) brew install fd ``` -------------------------------- ### Task Configuration Example Source: https://github.com/tailcallhq/forgecode/blob/main/benchmarks/evals/semantic_search_quality/README.md Example of how to define a new task for semantic search evaluation in task.yml. Specify the task description, intent, expected file types, and file types to avoid. ```yaml task: "Your task description" intent: "implementation|flow_understanding|tests|documentation|debugging|modification|architecture|configuration" expected_file_types: "comma,separated,extensions" should_avoid: "comma,separated,extensions" ``` -------------------------------- ### Test Data Example (CSV) Source: https://github.com/tailcallhq/forgecode/blob/main/benchmarks/README.md Create a CSV file with columns matching your template variables for test cases. ```csv prompt,expected_output "Create a backup script","backup.sh" "Generate API client","api_client.py" ``` -------------------------------- ### Install Forge CLI Source: https://github.com/tailcallhq/forgecode/blob/main/README.md Commands for installing the Forge CLI using curl or package managers. ```bash # YOLO curl -fsSL https://forgecode.dev/cli | sh ``` ```bash # Package managers nix run github:tailcallhq/forgecode # for latest dev branch ``` -------------------------------- ### Flow Understanding Query Test Case Example Source: https://github.com/tailcallhq/forgecode/blob/main/benchmarks/evals/semantic_search_quality/README.md Example of a test case for understanding system flows, detailing expected and to-be-avoided file types. ```yaml - task: "How does the authentication flow work from request to response?" intent: "flow_understanding" expected_file_types: "rust,typescript" should_avoid: "test,markdown" ``` -------------------------------- ### Install fd - Fast File Finder Source: https://github.com/tailcallhq/forgecode/blob/main/shell-plugin/README.md Installs the 'fd' command-line tool, a prerequisite for the Forge ZSH plugin, on Arch Linux. ```bash # Arch Linux sudo pacman -S fd ``` -------------------------------- ### Command Examples with File Tagging Source: https://github.com/tailcallhq/forgecode/blob/main/shell-plugin/README.md Demonstrates how to use file tagging with the '@[filename]' syntax to reference specific files in your commands. This is useful for code review, debugging, and configuration tasks. ```bash : Review this implementation @[src/auth.rs] : Debug the issue in @[logs/error.log] @[config/app.yml] ``` -------------------------------- ### Rust User Struct Initialization Examples Source: https://github.com/tailcallhq/forgecode/blob/main/crates/forge_domain/src/snapshots/forge_domain__conversation_html__tests__conversation.snap.html Illustrates preferred methods for initializing Rust structs using default, new, and custom test constructors, contrasting them with less idiomatic approaches. ```rust User::default().age(12).is_happy(true).name("John") User::new("Job").age(12).is_happy() User::test() // Special test constructor ``` ```rust User {name: "John".to_string(), is_happy: true, age: 12} User::with_name("Job") // Bad name, should stick to User::new() or User::test() ``` -------------------------------- ### Task Definition Example Source: https://github.com/tailcallhq/forgecode/blob/main/benchmarks/README.md Defines how to run an evaluation, including pre-run commands, the command to execute, parallelism, timeout, and validations. ```yaml # Optional: Commands to run before evaluation starts before_run: - cargo build - npm install # Required: Command(s) to execute for each test case # Single command run: forgee -p '{{prompt}}' # Or multiple commands (executed sequentially) run: - echo "Step 1: {{task}}" - forgee -p '{{prompt}}' - echo "Step 2: Complete" # Execution configuration parallelism: 10 # Number of tasks to run in parallel (default: 1) timeout: 60 # Timeout in seconds (optional) early_exit: true # Stop execution when validations pass (optional) # Optional: Validations to run on output validations: - name: "Check success message" type: regex regex: "\[[0-9:]*\] Skill create-skill" # Required: Data sources for test cases sources: - csv: my_tasks.csv ``` -------------------------------- ### Start Interactive Forge Session with Specific Agent Source: https://github.com/tailcallhq/forgecode/blob/main/README.md Start an interactive Forge session with a specific agent pre-selected. ```bash forge --agent ``` -------------------------------- ### Start Forge Session in Specific Directory Source: https://github.com/tailcallhq/forgecode/blob/main/README.md Initiate a Forge session, specifying the project directory to work within. ```bash forge -C /path/to/project ``` -------------------------------- ### Start Forge Session in Isolated Sandbox Source: https://github.com/tailcallhq/forgecode/blob/main/README.md Create an isolated Git worktree and branch for experimentation before starting a Forge session. ```bash forge --sandbox experiment-name ``` -------------------------------- ### Rust Test Structure with Pretty Assertions Source: https://github.com/tailcallhq/forgecode/blob/main/AGENTS.md Illustrates the standard three-step process for writing Rust tests: setup, execution, and assertion. Always use `pretty_assertions` for enhanced error reporting. ```rust use pretty_assertions::assert_eq; // Always use pretty assertions fn test_foo() { let setup = ...; // Instantiate a fixture or setup for the test let actual = ...; // Execute the fixture to create an output let expected = ...; // Define a hand written expected result assert_eq!(actual, expected); // Assert that the actual result matches the expected result } ``` -------------------------------- ### Groq API Key and URL Configuration (Deprecated) Source: https://github.com/tailcallhq/forgecode/blob/main/README.md Legacy environment variable setup for Groq. This method is deprecated; use `forge provider login` instead. Uses OpenAI compatible keys and a specific URL. ```bash # .env OPENAI_API_KEY= OPENAI_URL=https://api.groq.com/openai/v1 ``` -------------------------------- ### Setting Initial Parallelism Source: https://github.com/tailcallhq/forgecode/blob/main/benchmarks/README.md Advises starting with a low `parallelism` value (e.g., 1) in Forge for testing and gradually increasing it. This helps in debugging and performance tuning. ```yaml parallelism: 1 # Start here ``` -------------------------------- ### Agent Context Compaction Configuration Example Source: https://github.com/tailcallhq/forgecode/blob/main/plans/agent-context-compaction-2025-03-24-concise.md Example of how to configure agent context compaction in the forge.yaml file. This configuration sets a maximum token limit and defines triggers for compaction based on token count, turn count, and message count. ```yaml # Example in forge.yaml agents: myAgent: id: myAgent model: gpt-4-turbo system_prompt: "You are a helpful assistant." compact: max_tokens: 4000 token_threshold: 6000 turn_threshold: 10 message_threshold: 30 ``` -------------------------------- ### Run Environment Diagnostics Source: https://github.com/tailcallhq/forgecode/blob/main/shell-plugin/README.md Execute comprehensive environment diagnostics with the :doctor command to check your Forge setup. This verifies ZSH, Forge installation, plugin status, dependencies, and more. ```bash :doctor ``` -------------------------------- ### Sample Error Response for Binary File Detection Source: https://github.com/tailcallhq/forgecode/blob/main/plans/2025-04-27-large-file-read-range-support-v4.md Example JSON response when a binary file is detected and not supported. ```json { "error": "Binary files are not supported. File detected as image/png. Please use another tool or method to process this file." } ``` -------------------------------- ### Simple Sequential Execution Example Source: https://github.com/tailcallhq/forgecode/blob/main/benchmarks/README.md A basic Forge task that sequentially executes a command for each item in a CSV source. Use this for straightforward, step-by-step processing. ```yaml run: echo "Processing {{name}}" sources: - csv: names.csv ``` ```csv name Alice Bob Charlie ``` -------------------------------- ### Anti-pattern: Cumbersome Usage Example Source: https://github.com/tailcallhq/forgecode/blob/main/AGENTS.md Demonstrates the cumbersome usage that results from services with too many generic parameters and explicit type bounds in the constructor. ```rust // BAD: Usage becomes cumbersome let service = BadUserService::::new(...); ``` -------------------------------- ### Git Operations Prompt Source: https://github.com/tailcallhq/forgecode/blob/main/README.md Use this prompt to get help with Git operations, like resolving merge conflicts. Forge guides you through conflict resolution and explains differences. ```plaintext > I need to merge branch 'feature/user-profile' into main but there are conflicts ``` -------------------------------- ### Windows Environment Variable Examples Source: https://github.com/tailcallhq/forgecode/blob/main/plans/2025-09-13-forge-history-file-env-var-v2.md Examples of setting the FORGE_HISTORY_FILE environment variable on Windows. Supports drive letters, UNC paths, and relative paths. ```bash # Windows examples FORGE_HISTORY_FILE=.\project-history FORGE_HISTORY_FILE=..\shared\team-history FORGE_HISTORY_FILE=C:\Users\Name\ForgeHistories\project1 FORGE_HISTORY_FILE=\\server\share\team-histories\project1 ``` -------------------------------- ### Amazon Bedrock Setup with Forge Source: https://github.com/tailcallhq/forgecode/blob/main/README.md Configure Forge to use Amazon Bedrock models via the Bedrock Access Gateway. Requires setting up the gateway and providing its API base URL. ```bash forge provider login # Select OpenAI-compatible provider and enter your Bedrock Gateway details ``` ```dotenv # .env OPENAI_API_KEY= OPENAI_URL= ``` -------------------------------- ### Unix/Linux/macOS Environment Variable Examples Source: https://github.com/tailcallhq/forgecode/blob/main/plans/2025-09-13-forge-history-file-env-var-v2.md Examples of setting the FORGE_HISTORY_FILE environment variable on Unix-like systems. These paths can be relative or absolute. ```bash # Unix/Linux/macOS examples FORGE_HISTORY_FILE=./project-history FORGE_HISTORY_FILE=../shared/team-history FORGE_HISTORY_FILE=/home/user/forge-histories/project1 ``` -------------------------------- ### OpenAI-Compatible Providers Configuration (Deprecated) Source: https://github.com/tailcallhq/forgecode/blob/main/README.md Legacy environment variable setup for OpenAI-compatible providers. This method is deprecated; use `forge provider login` instead. Requires API key and URL. ```bash # .env OPENAI_API_KEY= OPENAI_URL= ``` -------------------------------- ### Good Claude Tool Description Example (JSON) Source: https://github.com/tailcallhq/forgecode/blob/main/docs/tool-guidelines.md This JSON object demonstrates a well-formed tool description for Claude. It includes a detailed explanation of the tool's function, usage scenarios, limitations, and input schema, ensuring Claude can accurately interpret and use the tool. ```json { "name": "get_stock_price", "description": "Retrieves the current stock price for a given ticker symbol. The ticker symbol must be a valid symbol for a publicly traded company on a major US stock exchange like NYSE or NASDAQ. The tool will return the latest trade price in USD. It should be used when the user asks about the current or most recent price of a specific stock. It will not provide any other information about the stock or company.", "input_schema": { "type": "object", "properties": { "ticker": { "type": "string", "description": "The stock ticker symbol, e.g. AAPL for Apple Inc." } }, "required": ["ticker"] } } ``` -------------------------------- ### Start a New Session Source: https://github.com/tailcallhq/forgecode/blob/main/shell-plugin/README.md Clears the current conversation context and starts a fresh session. This resets the session state and displays helpful information. ```bash :new # or use the alias :n ``` -------------------------------- ### x-ai API Key Configuration (Deprecated) Source: https://github.com/tailcallhq/forgecode/blob/main/README.md Legacy environment variable setup for x-ai. This method is deprecated; use `forge provider login` instead. Ensure the API key is correctly formatted. ```bash # .env XAI_API_KEY= ``` -------------------------------- ### Poor Claude Tool Description Example (JSON) Source: https://github.com/tailcallhq/forgecode/blob/main/docs/tool-guidelines.md This JSON object illustrates a poorly written tool description for Claude. Its brevity lacks crucial details about the tool's functionality, usage, and parameter constraints, leading to potential misinterpretations by Claude. ```json { "name": "get_stock_price", "description": "Gets the stock price for a ticker.", "input_schema": { "type": "object", "properties": { "ticker": { "type": "string" } }, "required": ["ticker"] } } ``` -------------------------------- ### CSV Data for Template Variables Source: https://github.com/tailcallhq/forgecode/blob/main/benchmarks/README.md Example CSV data providing values for template variables used in commands. ```csv input_file,format data1.txt,json data2.txt,yaml ``` -------------------------------- ### Feature Addition PR Description Example Source: https://github.com/tailcallhq/forgecode/blob/main/crates/forge_repo/src/skills/github-pr-description/SKILL.md Example of a comprehensive PR description for a new feature, including summary, context, changes, implementation details, use cases, testing, and links. ```markdown ## Summary Add semantic code search to enable searching codebase by concepts and behavior rather than exact string matching. ## Context Currently, users can only search using exact string matching, which makes it difficult to find code based on functionality or behavior. This has been a recurring request in issues #123 and #456. ## Changes - Implemented semantic search using vector embeddings - Integrated with existing search interface - Added support for multiple concurrent queries with result aggregation - Configurable search scope (entire codebase or specific directories) ### Key Implementation Details Uses OpenAI embeddings for code representation and cosine similarity for matching. Index is built incrementally to support large codebases. Search results are reranked based on code context and usage patterns. ## Use Cases - Find authentication flow without knowing exact function names - Locate retry logic across the codebase - Search for "database connection" patterns ## Testing ```bash # Run the search service npm run search:dev # Test semantic queries curl -X POST http://localhost:3000/search \ -H "Content-Type: application/json" \ -d '{"query": "user authentication"}' ``` ## Links - Related issues: #123, #456 - Documentation: /docs/semantic-search.md ``` -------------------------------- ### OpenAI API Key Configuration (Deprecated) Source: https://github.com/tailcallhq/forgecode/blob/main/README.md Legacy environment variable setup for OpenAI. This method is deprecated; use `forge provider login` instead. Ensure the API key is correctly formatted. ```bash # .env OPENAI_API_KEY= ``` -------------------------------- ### Requesty API Key Configuration (Deprecated) Source: https://github.com/tailcallhq/forgecode/blob/main/README.md Legacy environment variable setup for Requesty. This method is deprecated; use `forge provider login` instead. Ensure the API key is correctly formatted. ```bash # .env REQUESTY_API_KEY= ``` -------------------------------- ### Start a New Conversation Source: https://github.com/tailcallhq/forgecode/blob/main/shell-plugin/README.md Initiates a new conversation with the default Forge agent by prefixing a prompt with a colon. ```bash : Get the current time ``` -------------------------------- ### Multiple Commands Execution Example Source: https://github.com/tailcallhq/forgecode/blob/main/benchmarks/README.md Define a Forge task that executes a sequence of commands. This allows for more complex workflows within a single task definition. ```yaml run: - echo "Starting task {{id}}" - ./process --input {{file}} - echo "Task {{id}} complete" parallelism: 3 timeout: 120 sources: - csv: tasks.csv ``` -------------------------------- ### IO Intelligence API Key Configuration (Deprecated) Source: https://github.com/tailcallhq/forgecode/blob/main/README.md Legacy environment variable setup for IO Intelligence. This method is deprecated; use `forge provider login` instead. Ensure the API key is correctly formatted. ```bash # .env IO_INTELLIGENCE_API_KEY= ``` -------------------------------- ### ZSH Plugin Mode Commands Source: https://github.com/tailcallhq/forgecode/blob/main/README.md After `forge setup`, use the `:` prefix for direct shell integration. This mode allows sending prompts, committing, suggesting commands, and managing conversations without leaving your shell. ```zsh : refactor the auth module :commit :suggest "find large log files" :conversation ``` -------------------------------- ### Rust Service Constructor with Single Dependency Source: https://github.com/tailcallhq/forgecode/blob/main/AGENTS.md Example of a simple service implementation using a tuple struct pattern for a single infrastructure dependency, stored as `Arc`. ```rust struct Service(Arc); ``` -------------------------------- ### z.ai API Key Configuration (Deprecated) Source: https://github.com/tailcallhq/forgecode/blob/main/README.md Legacy environment variable setup for z.ai. This method is deprecated; use `forge provider login` instead. Supports both general and coding plan API keys. ```bash # .env ZAI_API_KEY= # Or for coding plan subscription ZAI_CODING_API_KEY= ``` -------------------------------- ### OpenRouter API Key Configuration (Deprecated) Source: https://github.com/tailcallhq/forgecode/blob/main/README.md Legacy environment variable setup for OpenRouter. This method is deprecated; use `forge provider login` instead. Ensure the API key is correctly formatted. ```bash # .env OPENROUTER_API_KEY= ``` -------------------------------- ### Database Schema Design Prompt Source: https://github.com/tailcallhq/forgecode/blob/main/README.md Use this prompt to get assistance designing a database schema for features like a blog. Forge suggests tables, relationships, indexes, and constraints. ```plaintext > I need to design a database schema for a blog with users, posts, comments, and categories ``` -------------------------------- ### Initialize Project-Local Skill Source: https://github.com/tailcallhq/forgecode/blob/main/crates/forge_repo/src/skills/create-skill/SKILL.md Creates a new skill in the project-local directory, including necessary subdirectories and the SKILL.md file with basic YAML frontmatter and markdown body. Also creates a sample script file and makes it executable. ```bash mkdir -p {{local_skills_path}}/edit-pdf/{scripts,references,assets} cat > {{local_skills_path}}/edit-pdf/SKILL.md << 'EOF' --- name: edit-pdf description: TODO - Describe what this skill does and when to use it --- # Edit PDF TODO - Add skill instructions here EOF cat > {{local_skills_path}}/edit-pdf/scripts/rotate.sh << 'EOF' #!/bin/bash # Rotate PDF using pdftk pdftk "$1" cat 1-endright output "$2" EOF chmod +x {{local_skills_path}}/edit-pdf/scripts/rotate.sh ``` -------------------------------- ### Other Forge CLI Commands Source: https://github.com/tailcallhq/forgecode/blob/main/README.md Miscellaneous Forge CLI commands for information, tool listing, diagnostics, updates, and setup. ```bash forge info ``` ```bash forge list tool --agent ``` ```bash forge doctor ``` ```bash forge update ``` ```bash forge setup ``` -------------------------------- ### Anthropic API Key Configuration (Deprecated) Source: https://github.com/tailcallhq/forgecode/blob/main/README.md Legacy environment variable setup for Anthropic. This method is deprecated; use `forge provider login` instead. Ensure the API key is correctly formatted. ```bash # .env ANTHROPIC_API_KEY= ``` -------------------------------- ### Implementing New Features Prompt Source: https://github.com/tailcallhq/forgecode/blob/main/README.md Use this prompt to get guidance on adding new features, such as dark mode to a React app. Forge suggests approaches, outlines steps, and can scaffold necessary components. ```plaintext > I need to add a dark mode toggle to our React application. How should I approach this? ``` -------------------------------- ### Regex Validation Example Source: https://github.com/tailcallhq/forgecode/blob/main/benchmarks/README.md Utilize regex validations in Forge to verify task outputs against regular expressions. This is ideal for pattern matching in command output. ```yaml run: cargo test {{test_name}} validations: - name: "All tests passed" type: regex regex: test result:\s+ok sources: - csv: tests.csv ``` -------------------------------- ### Cerebras API Key Configuration (Deprecated) Source: https://github.com/tailcallhq/forgecode/blob/main/README.md Legacy environment variable setup for Cerebras. This method is deprecated; use `forge provider login` instead. Ensure the API key is correctly formatted. ```bash # .env CEREBRAS_API_KEY= ``` -------------------------------- ### Select from Options with ForgeSelect Source: https://github.com/tailcallhq/forgecode/blob/main/crates/forge_select/README.md Use this snippet to create a select prompt where the user chooses one option from a list. The options must implement the Clone trait. You can configure the starting cursor position. ```rust use forge_select::ForgeSelect; let options = vec!["Option 1", "Option 2", "Option 3"]; let selected = ForgeSelect::select("Choose an option:", options) .with_starting_cursor(1) .prompt()?; ``` -------------------------------- ### Parallel Execution with Timeout Example Source: https://github.com/tailcallhq/forgecode/blob/main/benchmarks/README.md Configure Forge to run tasks in parallel with a specified timeout. This is suitable for scenarios where tasks can be executed concurrently and need to complete within a time limit. ```yaml run: ./slow_task --id {{task_id}} parallelism: 5 timeout: 30 sources: - csv: tasks.csv ``` -------------------------------- ### Initialize Global Skill Source: https://github.com/tailcallhq/forgecode/blob/main/crates/forge_repo/src/skills/create-skill/SKILL.md Creates a new skill in the global directory, including necessary subdirectories and the SKILL.md file with basic YAML frontmatter and markdown body. Also creates a sample script file and makes it executable. ```bash mkdir -p {{global_skills_path}}/edit-pdf/{scripts,references,assets} cat > {{global_skills_path}}/edit-pdf/SKILL.md << 'EOF' --- name: edit-pdf description: TODO - Describe what this skill does and when to use it --- # Edit PDF TODO - Add skill instructions here EOF cat > {{global_skills_path}}/edit-pdf/scripts/rotate.sh << 'EOF' #!/bin/bash # Rotate PDF using pdftk pdftk "$1" cat 1-endright output "$2" EOF chmod +x {{global_skills_path}}/edit-pdf/scripts/rotate.sh ``` -------------------------------- ### Generate Summary for a Specific Sequence Source: https://github.com/tailcallhq/forgecode/blob/main/plans/agent-context-compaction-2025-03-25-concise.md This method generates a summary for a given sequence of messages within the agent's context. It prepares a temporary context, renders a summarization prompt, and then uses a provider service to get the summary. ```rust async fn generate_summary_for_sequence( &self, agent: &Agent, messages: &[ContextMessage] ) -> Result { let compact = agent.compact.as_ref().unwrap(); // Create a temporary context with just the sequence for summarization let mut sequence_context = Context::default(); for msg in messages { sequence_context = sequence_context.add_message(msg.clone()); } // Render the summarization prompt let prompt = self .services .template_service() .render_summarization(agent, &sequence_context) .await?; let message = ContextMessage::user(prompt); let summary_context = Context::default().add_message(message); // Get summary from the provider let response = self .services .provider_service() .chat(&compact.model, summary_context) .await?; self.collect_completion_stream_content(response).await } ``` -------------------------------- ### ZSH Plugin: Conversation Management Commands Source: https://github.com/tailcallhq/forgecode/blob/main/README.md Manage your Forge conversations using various `:` commands. This includes starting new conversations, switching between them, cloning, renaming, retrying prompts, and exporting. ```zsh :new :new :conversation :conversation :conversation - :clone :clone :rename :conversation-rename :retry :copy :dump :dump html :compact ``` -------------------------------- ### Learning New Technologies Prompt Source: https://github.com/tailcallhq/forgecode/blob/main/README.md Use this prompt to learn how to integrate new technologies, like GraphQL with Express. Forge provides tailored tutorials based on your project structure. ```plaintext > I want to integrate GraphQL into this Express application. Can you explain how to get started? ``` -------------------------------- ### Update init_agent_context to Pass Empty Variables Source: https://github.com/tailcallhq/forgecode/blob/main/plans/2025-04-02-system-context-rendering-final.md Updates the `init_agent_context` method to pass empty variables when rendering the system prompt initially. This ensures that the system context is rendered correctly even when no specific conversation variables are available at the start. ```rust async fn init_agent_context(&self, agent: &Agent) -> anyhow::Result { let tool_defs = self.init_tool_definitions(agent); // Use the agent's tool_supported flag directly instead of querying the provider let tool_supported = agent.tool_supported.unwrap_or_default(); let mut context = Context::default(); if let Some(system_prompt) = &agent.system_prompt { // Create empty variables for initial rendering let empty_variables = HashMap::new(); let system_message = self .services .template_service() .render_system(agent, system_prompt, &empty_variables) .await?; context = context.set_first_system_message(system_message); } Ok(context.extend_tools(if tool_supported { tool_defs } else { Vec::new() })) } ``` -------------------------------- ### Using before_run for Build Steps Source: https://github.com/tailcallhq/forgecode/blob/main/benchmarks/README.md Shows how to use the `before_run` directive in Forge to execute commands, such as building binaries, before the main task execution. This ensures dependencies are met. ```yaml before_run: - cargo build ``` -------------------------------- ### Sample Error Response for Invalid Range Source: https://github.com/tailcallhq/forgecode/blob/main/plans/2025-04-27-large-file-read-range-support-v4.md Example JSON response indicating an invalid byte range was specified. ```json { "error": "Invalid range specified: start_byte (5000) is greater than end_byte (4000)." } ``` -------------------------------- ### Write PR Description to File Source: https://github.com/tailcallhq/forgecode/blob/main/crates/forge_repo/src/skills/github-pr-description/SKILL.md Use the `write` tool to create the `.forge/FORGE_PR_DESCRIPTION.md` file with the generated description content. ```bash Use the `write` tool to create `.forge/FORGE_PR_DESCRIPTION.md` with the generated description content. ``` -------------------------------- ### Skill File Structure Source: https://github.com/tailcallhq/forgecode/blob/main/crates/forge_repo/src/skills/create-skill/SKILL.md Illustrates the required and optional components of a skill package, highlighting the SKILL.md file and its frontmatter. ```markdown skill-name/ ├── SKILL.md (required) │ ├── YAML frontmatter metadata (required) │ │ ├── name: (required) │ │ └── description: (required) │ └── Markdown instructions (required) └── Bundled Resources (optional) ├── scripts/ - Executable code (Python/Bash/etc.) ├── references/ - Documentation intended to be loaded into context as needed └── assets/ - Files used in output (templates, icons, fonts, etc.) ``` -------------------------------- ### Create Evaluation Directory Source: https://github.com/tailcallhq/forgecode/blob/main/benchmarks/README.md Create a new directory for your evaluation definitions. ```bash mkdir -p evals/my_eval ``` -------------------------------- ### Rust Hello World Source: https://github.com/tailcallhq/forgecode/blob/main/crates/forge_display/src/fixtures/code-02.md A basic 'Hello, world!' program in Rust. ```rust fn main() { println!("Hello, world!"); } ``` -------------------------------- ### Use Specific Forge Agents Source: https://github.com/tailcallhq/forgecode/blob/main/shell-plugin/README.md Starts a conversation with a specific Forge agent by naming it after the colon. Tab completion is available for agent names. ```bash :sage How does caching work in this system? :muse Create a deployment strategy for my app ``` -------------------------------- ### Sample Success Response for fs_read Tool Source: https://github.com/tailcallhq/forgecode/blob/main/plans/2025-04-27-large-file-read-range-support-v4.md Illustrates the JSON structure for a successful file read operation, including content and detailed metadata. ```json { "content": "This is the file content within the requested range...", "metadata": { "file_size": 1024000, "requested_range": { "start_byte": 500, "end_byte": 1500 }, "actual_range": { "start_byte": 498, "end_byte": 1503 }, "boundary_adjustments": { "start_adjusted": true, "start_adjustment_reason": "UTF-8 character boundary alignment", "end_adjusted": true, "end_adjustment_reason": "UTF-8 character boundary alignment" }, "is_partial": true, "percent_of_file": 0.1 } } ``` -------------------------------- ### Text Input with ForgeSelect Source: https://github.com/tailcallhq/forgecode/blob/main/crates/forge_select/README.md Use this snippet to get text input from the user. You can specify whether empty input is allowed and provide a default value. ```rust use forge_select::ForgeSelect; let name = ForgeSelect::input("Enter your name:") .allow_empty(false) .with_default("John") .prompt()?; ``` -------------------------------- ### View System Information Source: https://github.com/tailcallhq/forgecode/blob/main/shell-plugin/README.md Displays system and project information, including system details, project details, and current configuration. Aliases :i are available. ```bash :info # or use the alias :i ``` -------------------------------- ### Parse FORGE_DUMP_AUTO_OPEN Environment Variable Source: https://github.com/tailcallhq/forgecode/blob/main/plans/2025-09-12-forge-dump-autoopen-env-var-v2.md This snippet demonstrates parsing the `FORGE_DUMP_AUTO_OPEN` environment variable within the `get()` method of `crates/forge_infra/src/env.rs`. It defaults to `false` if the variable is unset or cannot be parsed. ```rust let auto_open_dump = parse_env::("FORGE_DUMP_AUTO_OPEN").unwrap_or(false); Environment { // existing field assignments... auto_open_dump, } ``` -------------------------------- ### Refactoring Legacy Code Prompt Source: https://github.com/tailcallhq/forgecode/blob/main/README.md Use this prompt to refactor legacy code, such as converting class-based React components to use Hooks. Forge guides you through the refactoring process. ```plaintext > Help me refactor this class-based component to use React Hooks ``` -------------------------------- ### Run Full Semantic Search Quality Evaluation Source: https://github.com/tailcallhq/forgecode/blob/main/benchmarks/evals/semantic_search_quality/README.md Execute the complete semantic search quality evaluation using npm. ```bash npm run eval semantic_search_quality ``` -------------------------------- ### Simple Service with Methods Source: https://github.com/tailcallhq/forgecode/blob/main/AGENTS.md Defines a basic service with no external dependencies, suitable for self-contained logic. ```rust pub struct UserValidationService; impl UserValidationService { pub fn new() -> Self { ... } pub fn validate_email(&self, email: &str) -> Result<()> { // Validation logic here ... } pub fn validate_age(&self, age: u32) -> Result<()> { // Age validation logic here ... } } ``` -------------------------------- ### Initialize ForgeConfig in main.rs Source: https://github.com/tailcallhq/forgecode/blob/main/plans/2026-04-05-config-init-at-startup-v1.md Call `ForgeConfig::read()` at the top of `main()` to load configuration. Use `?` propagation for error handling, ensuring any configuration errors are reported to the user. ```rust let config: ForgeConfig = ForgeConfig::read()?; // ... other initialization code ``` -------------------------------- ### Manage MCP Servers via CLI Source: https://github.com/tailcallhq/forgecode/blob/main/README.md Commands for listing, importing, showing, removing, and reloading MCP servers. ```bash # List all MCP servers forge mcp list ``` ```bash # Import a server from JSON forge mcp import ``` ```bash # Show server configuration details forge mcp show ``` ```bash # Remove a server forge mcp remove ``` ```bash # Reload servers and rebuild caches forge mcp reload ``` -------------------------------- ### README Documentation for Tool Configuration Source: https://github.com/tailcallhq/forgecode/blob/main/plans/2025-09-12-forge-dump-autoopen-env-var-v2.md This snippet shows the pattern for documenting the `FORGE_DUMP_AUTO_OPEN` environment variable in `README.md` under the 'Tool Configuration' section. It specifies the variable name, its purpose, and its default value. ```markdown
Tool Configuration Configuring the tool calls settings: ```bash # .env FORGE_TOOL_TIMEOUT=300 # Maximum execution time in seconds for a tool (default: 300) FORGE_DUMP_AUTO_OPEN=false # Automatically open dump files in browser (default: false) ```
``` -------------------------------- ### Convert Tool Catalog to Fetch Permission Operation Source: https://github.com/tailcallhq/forgecode/blob/main/crates/forge_display/src/fixtures/code-01.md This snippet demonstrates the conversion of a `ToolCatalog::Fetch` input into a `PermissionOperation::Fetch` structure. This is done to prepare the input for the policy engine's evaluation. ```rust ToolCatalog::Fetch(input) => Some(crate::policies::PermissionOperation::Fetch { url: input.url.clone(), cwd, message: format!("Fetch content from URL: {}", input.url), }) ``` -------------------------------- ### Write Pull Request Description to Temporary File Source: https://github.com/tailcallhq/forgecode/blob/main/crates/forge_repo/src/skills/github-pr-description/SKILL.md Demonstrates how to write a pull request description to a temporary file using shell commands, which is a prerequisite for using tools like the GitHub CLI to create the pull request. ```bash # Step 1: Write description to temp file ``` -------------------------------- ### Code Understanding Prompt Source: https://github.com/tailcallhq/forgecode/blob/main/README.md Use this prompt to ask Forge to explain the authentication system within a codebase. Forge analyzes project structure and identifies relevant files to provide a detailed explanation. ```plaintext > Can you explain how the authentication system works in this codebase? ``` -------------------------------- ### Configuration Viewing and Editing Commands Source: https://github.com/tailcallhq/forgecode/blob/main/README.md Commands to view current session information, effective configuration, and to open the configuration file for editing. ```zsh # View & edit config :info # Show current session info (model, agent, conversation ID) :config # Display effective resolved configuration in TOML format :config-edit # Open config file in $EDITOR (alias: :ce) :tools # List available tools for the current agent :skill # List available skills ``` -------------------------------- ### Rust User Object Construction with Setters Source: https://github.com/tailcallhq/forgecode/blob/main/AGENTS.md Demonstrates idiomatic ways to construct Rust objects using `Default`, `derive_setters`, and custom constructors like `new` or `test`. ```rust User::default().age(12).is_happy(true).name("John") User::new("Job").age(12).is_happy() User::test() // Special test constructor ``` -------------------------------- ### Debugging Assistance Prompt Source: https://github.com/tailcallhq/forgecode/blob/main/README.md Use this prompt to get help with debugging errors like 'TypeError: Cannot read property 'map' of undefined'. Forge analyzes the error and suggests potential causes and solutions. ```plaintext > I'm getting this error: "TypeError: Cannot read property 'map' of undefined". What might be causing it? ``` -------------------------------- ### Custom Commands for Forge Source: https://github.com/tailcallhq/forgecode/blob/main/README.md Define custom commands with names, descriptions, and prompts to create shortcuts for repetitive tasks. ```yaml # forge.yaml commands: - name: "refactor" description: "Refactor selected code" prompt: "Please refactor this code to improve readability and performance" ``` -------------------------------- ### Test Email Template Rendering Source: https://github.com/tailcallhq/forgecode/blob/main/crates/forge_repo/src/skills/github-pr-description/SKILL.md Runs tests specifically for email templates to ensure they render correctly. This includes unit tests for template logic and a command to verify the rendering of a specific template, like the welcome email. ```bash # Run email template tests npm test tests/unit/email-templates.test.ts # Verify email renders correctly npm run test:email --template=welcome ``` -------------------------------- ### Launch Greeting Responder Agent Source: https://github.com/tailcallhq/forgecode/blob/main/crates/forge_domain/src/tools/descriptions/task.md Use the task tool to launch the 'greeting-responder' agent to respond to user greetings with a joke. ```javascript I'm going to use the {{tool_names.task}} tool to launch the greeting-responder agent ``` -------------------------------- ### Shell Command Validation Example Source: https://github.com/tailcallhq/forgecode/blob/main/benchmarks/README.md Implement shell command validations in Forge to check task outputs based on command execution results. Use this for custom validation logic that can be expressed via shell commands. ```yaml run: echo "{{message}}" parallelism: 3 validations: # Using grep to check if output contains specific text - name: "Contains 'test' word" type: shell command: grep -q "test" exit_code: 0 # Count words and ensure it's greater than 2 - name: "More than 2 words" type: shell command: test $(wc -w | awk '{print $1}') -gt 2 exit_code: 0 # Traditional regex validation (for comparison) - name: "Contains test or validation" type: regex regex: "test|validation" sources: - csv: messages.csv ``` -------------------------------- ### Entry Point for Permission Check Source: https://github.com/tailcallhq/forgecode/blob/main/crates/forge_display/src/fixtures/code-01.md This code snippet shows the initial check for enabling permissions and calling the tool permission check method. It acts as the gating condition for further permission verification. ```rust if env.enable_permissions && self.check_tool_permission(&tool_input, context).await? ``` -------------------------------- ### Display Configuration for Forge UI and ZSH Theme Source: https://github.com/tailcallhq/forgecode/blob/main/README.md Configure currency symbol, conversion rate, and Nerd Font icons for the ZSH theme. Defaults are provided. ```bash # .env FORGE_CURRENCY_SYMBOL="$" # Currency symbol for cost display in ZSH theme (default: "$") FORGE_CURRENCY_CONVERSION_RATE=1.0 # Conversion rate for currency display (default: 1.0) NERD_FONT=1 # Enable Nerd Font icons in ZSH theme (default: auto-detected, set to "1" or "true" to enable, "0" or "false" to disable) USE_NERD_FONT=1 # Alternative variable for enabling Nerd Font icons (same behavior as NERD_FONT) ``` -------------------------------- ### ZSH Plugin: Attaching Files to Prompts Source: https://github.com/tailcallhq/forgecode/blob/main/README.md Attach files to your prompts by typing `@` followed by Tab to fuzzy-search and select files. The selected file path is inserted and sent as context to the AI. ```zsh : review this code @[src/auth.rs] @[tests/auth_test.rs] ``` -------------------------------- ### Verify Git Prerequisites Source: https://github.com/tailcallhq/forgecode/blob/main/crates/forge_repo/src/skills/github-pr-description/SKILL.md Check current branch and verify there are commits ahead of the main branch before creating a PR. ```bash # Get current branch git branch --show-current # Verify branch is not main/master # Verify there are commits ahead of main git log origin/main..HEAD --oneline ``` -------------------------------- ### Deprecate Transform::Assistant Variant Source: https://github.com/tailcallhq/forgecode/blob/main/plans/agent-context-compaction-2025-03-24.md Adds a deprecation comment to the Transform::Assistant enum variant, indicating that the `compact` field on the Agent struct should be used instead. This ensures backward compatibility while guiding users to the new approach. ```rust #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(tag = "type", rename_all = "snake_case")] pub enum Transform { /// Compresses multiple assistant messages into a single message /// /// DEPRECATED: Use the new `compact` field on the Agent struct instead. #[deprecated( since = "next_version", note = "Use the compact field on Agent instead" )] Assistant { // existing fields... }, // Other variants... } ``` -------------------------------- ### Launch Test Runner Agent Source: https://github.com/tailcallhq/forgecode/blob/main/crates/forge_domain/src/tools/descriptions/task.md Use the task tool to launch the 'test-runner' agent after code has been written to execute tests. ```javascript function isPrime(n) { if (n <= 1) return false for (let i = 2; i * i <= n; i++) { if (n % i === 0) return false } return true } ``` -------------------------------- ### Rust: Structured XML Building with Element Source: https://github.com/tailcallhq/forgecode/blob/main/crates/forge_domain/src/fixtures/tool_call_01.md Demonstrates a structured approach to building XML using an Element struct, which includes proper escaping for content and attributes. This is a more maintainable and safer alternative to manual string manipulation. ```rust result.push_str(&format!("<{}", self.name)); // Add attributes result.push('>'); // Add content and children (with escaping) result.push_str(&format!("", self.name)); ``` -------------------------------- ### Optional Range Parameters for FSReadInput Source: https://github.com/tailcallhq/forgecode/blob/main/plans/2025-04-26-large-file-read-range-support-v3.md Add optional start and end byte parameters to the FSReadInput struct to support range-based file reads. These parameters allow specifying a byte range for reading, with defaults to read the entire file if not provided. ```rust /// Optional start position in bytes (0-based) pub start_byte: Option, /// Optional end position in bytes (exclusive) pub end_byte: Option, ``` -------------------------------- ### Simulate Database Failure and Test Timeout Source: https://github.com/tailcallhq/forgecode/blob/main/crates/forge_repo/src/skills/github-pr-description/SKILL.md Simulates a database failure by stopping the database service and then runs integration tests to verify connection timeout and retry behavior. Also shows how to verify circuit breaker activation. ```bash # Simulate database failure docker-compose stop db # Verify timeout and retry behavior npm test -- tests/integration/connection-timeout.test.ts # Verify circuit breaker activation curl http://localhost:3000/health # Should return 503 after circuit opens ``` -------------------------------- ### Run Verification Commands Source: https://github.com/tailcallhq/forgecode/blob/main/plans/2025-04-11-tool-call-context-implementation.md Commands to run for final verification, including acceptance testing, formatting, and linting. ```bash cargo insta test --accept --unreferenced=delete cargo +nightly fmt --all cargo +nightly clippy --fix --allow-staged --allow-dirty --workspace ``` -------------------------------- ### Workspace Semantic Search Commands Source: https://github.com/tailcallhq/forgecode/blob/main/README.md Commands for indexing your codebase for semantic search. Run ':sync' after initialization to index files. The workspace server URL can be overridden using an environment variable. ```zsh :sync # Index your codebase for semantic search :workspace-init # Initialize workspace for indexing :workspace-status # Show indexing status :workspace-info # Show workspace details ``` -------------------------------- ### Manual MCP Server Configuration Source: https://github.com/tailcallhq/forgecode/blob/main/README.md Structure for manually creating a .mcp.json file to configure MCP servers with commands or URLs. ```json { "mcpServers": { "server_name": { "command": "command_to_execute", "args": ["arg1", "arg2"], "env": { "ENV_VAR": "value" } }, "another_server": { "url": "http://localhost:3000/events" } } } ``` -------------------------------- ### Codebase Indexing Command Source: https://github.com/tailcallhq/forgecode/blob/main/shell-plugin/README.md A comment explaining the purpose of the :sync command, which is to sync the current directory for semantic search. ```bash # Sync current directory for semantic search :sync ``` -------------------------------- ### Sample Response for Range Read Source: https://github.com/tailcallhq/forgecode/blob/main/plans/2025-04-27-large-file-read-range-support-v4.md This is a sample response format for a range-based file read operation. It includes the file path, the requested range, the total file size, and the content within the specified range. ```yaml --- path: /a/b/c.txt range: 100-200 total: 1024 --- Hello! This is the contents of file c.txt ``` -------------------------------- ### Update ForgeEnvironmentInfra::new signature and cache initialization Source: https://github.com/tailcallhq/forgecode/blob/main/plans/2026-04-05-config-init-at-startup-v1.md Modify `ForgeEnvironmentInfra::new` to accept `ForgeConfig` and initialize the internal cache with the provided configuration. This eliminates the need for a subsequent disk read for the initial configuration. ```rust fn new(cwd: PathBuf, config: ForgeConfig) -> Self { let cache = Arc::new(Mutex::new(Some(config))); ForgeEnvironmentInfra { cwd, cache } } ``` -------------------------------- ### Configure AI Provider Credentials Source: https://github.com/tailcallhq/forgecode/blob/main/README.md Initiates an interactive process to set up your AI provider credentials. This is necessary for Forge to communicate with AI services. ```bash forge provider login ``` -------------------------------- ### Forge Workspace Management Commands Source: https://github.com/tailcallhq/forgecode/blob/main/README.md Commands for synchronizing, initializing, checking status, and querying the workspace's semantic index. ```bash forge workspace sync ``` ```bash forge workspace init ``` ```bash forge workspace status ``` ```bash forge workspace query ``` -------------------------------- ### Run Full Evaluation with Specific Model Source: https://github.com/tailcallhq/forgecode/blob/main/benchmarks/evals/semantic_search_quality/README.md Execute the semantic search quality evaluation using a particular LLM model. ```bash npm run eval semantic_search_quality -- --model "anthropic/claude-sonnet-4.5" ``` -------------------------------- ### Service with Tuple Struct and Composed Trait Bounds Source: https://github.com/tailcallhq/forgecode/blob/main/AGENTS.md Demonstrates using a tuple struct for a service with a single infrastructure dependency and composing multiple trait bounds for business logic. ```rust // Infrastructure traits pub trait FileReader { async fn read_file(&self, path: &Path) -> Result; } pub trait Environment { fn max_file_size(&self) -> u64; } // Tuple struct for simple single dependency service pub struct FileService(Arc); impl FileService { // Constructor without bounds pub fn new(infra: Arc) -> Self { ... } } impl FileService { // Business logic methods with composed trait bounds pub async fn read_with_validation(&self, path: &Path) -> Result { ... } } ``` -------------------------------- ### Semantic Search Configuration Source: https://github.com/tailcallhq/forgecode/blob/main/README.md Configure parameters for semantic search, including the limit for initial vector search results and the top-k parameter for relevance filtering. ```bash # .env FORGE_SEM_SEARCH_LIMIT=200 # Maximum number of results to return from initial vector search (default: 200) FORGE_SEM_SEARCH_TOP_K=20 # Top-k parameter for relevance filtering during semantic search (default: 20) ``` -------------------------------- ### Sync Codebase for Semantic Search Source: https://github.com/tailcallhq/forgecode/blob/main/shell-plugin/README.md Index the current directory for semantic code search using the :sync command. This enables efficient searching within your codebase. ```bash :sync ``` -------------------------------- ### Rust: Format File Listing XML Source: https://github.com/tailcallhq/forgecode/blob/main/crates/forge_domain/src/fixtures/tool_call_01.md Manually generates XML strings for directory and file entries in file system listings. Requires careful handling of paths to avoid XML errors. ```rust paths.push(format!(r#""#, entry.path)); paths.push(format!(r#""#, entry.path)); ``` -------------------------------- ### Implement Context Compaction Logic Source: https://github.com/tailcallhq/forgecode/blob/main/plans/agent-context-compaction-2025-03-24.md Adds a method to compact agent context based on configuration. It uses an existing Summarize mechanism and is called before sending context to the provider if compaction is needed. ```rust impl Orchestrator { // Add a new method to compact context async fn compact_context( &self, agent: &Agent, context: &mut Context ) -> anyhow::Result<()> { if let Some(config) = &agent.compact { let max_tokens = config.max_tokens; // Use the existing Summarize mechanism let mut summarize = Summarize::new(context, max_tokens); while let Some(mut summary) = summarize.summarize() { // Get the content to summarize let content_to_summarize = summary.get(); // TODO: In a future enhancement, we could use an AI model to generate better summaries // For now, use a simple placeholder that the existing code will handle summary.set("Summary of previous conversation"); } } Ok(()) } // Modify the init_agent_with_event method to check for compaction async fn init_agent_with_event(&self, agent_id: &AgentId, event: &Event) -> anyhow::Result<()> { // Existing code... // Before sending the context to the provider, check if compaction is needed if let Some(config) = &agent.compact { let turn_count = self.conversation.read().await.turn_count(&agent.id).unwrap_or(0); let message_count = context.messages.len(); if config.should_compact(&context, turn_count, message_count) { self.compact_context(agent, &mut context).await?; self.set_context(&agent.id, context.clone()).await?; } } // Continue with existing code... } } ``` -------------------------------- ### Manage Provider Credentials Source: https://github.com/tailcallhq/forgecode/blob/main/README.md Commands for logging out of a provider or listing supported providers. Use `logout` to remove credentials and `list` to see available options. ```bash forge provider logout ``` ```bash forge provider list ``` -------------------------------- ### Rust Verification Command Source: https://github.com/tailcallhq/forgecode/blob/main/AGENTS.md Command to run tests and accept new snapshots using `cargo-insta`. Use `--accept` to update expected outputs. ```bash cargo insta test --accept ``` -------------------------------- ### Handling Vague Input Source: https://github.com/tailcallhq/forgecode/blob/main/templates/forge-command-generator-prompt.md Provides helpful general-purpose commands for vague or unclear requests. ```json {"command": "pwd && ls -la"} ``` ```json {"command": "ls -lah"} ```