### Example Makefile Usage Source: https://github.com/significant-gravitas/autogpt/blob/master/docs/platform/getting-started.md Demonstrates a sequence of common Makefile commands to start the application. Run these in order to get the full application stack running. ```makefile make start-core make run-backend make run-frontend ``` -------------------------------- ### Install and Run Direct Benchmark Source: https://github.com/significant-gravitas/autogpt/blob/master/classic/direct_benchmark/CLAUDE.md Installs dependencies and runs the direct benchmark. Use this for initial setup and general benchmark execution. ```bash cd classic poetry install poetry run direct-benchmark run ``` -------------------------------- ### Install, Configure, and Run AutoGPT Forge Source: https://github.com/significant-gravitas/autogpt/blob/master/classic/forge/README.md These commands guide you through the initial setup of AutoGPT Forge. Ensure you are in the 'classic/' directory before running. ```bash cd classic poetry install cp .env.example .env # Edit .env with your OPENAI_API_KEY poetry run python -m forge ``` -------------------------------- ### Subsequent Development Server Start Source: https://github.com/significant-gravitas/autogpt/blob/master/autogpt_platform/frontend/README.md Command to start the development server for subsequent sessions after initial setup. ```bash pnpm dev ``` -------------------------------- ### Quick Setup Script for Windows Source: https://github.com/significant-gravitas/autogpt/blob/master/README.md Installs dependencies, configures Docker, and launches a local AutoGPT instance using a PowerShell script. Recommended for local hosting. ```powershell powershell -c "iwr https://setup.agpt.co/install.bat -o install.bat; ./install.bat" ``` -------------------------------- ### GitHub Provider Scope Example Source: https://github.com/significant-gravitas/autogpt/blob/master/docs/platform/integrating/oauth-guide.md Example of specifying GitHub provider and scopes for the Integration Setup Wizard. ```javascript { provider: 'github', scopes: ['repo', 'read:user'] } ``` -------------------------------- ### Start Core Services Source: https://github.com/significant-gravitas/autogpt/blob/master/docs/platform/getting-started.md Starts the core services like Supabase, Redis, and RabbitMQ in the background. Use this to get the essential backend infrastructure running. ```makefile make start-core ``` -------------------------------- ### Quick Setup Script for macOS/Linux Source: https://github.com/significant-gravitas/autogpt/blob/master/README.md Installs dependencies, configures Docker, and launches a local AutoGPT instance using a one-line script. Recommended for local hosting. ```bash curl -fsSL https://setup.agpt.co/install.sh -o install.sh && bash install.sh ``` -------------------------------- ### AutoGPT Setup Command Source: https://github.com/significant-gravitas/autogpt/blob/master/README.md Installs necessary dependencies for your system to run AutoGPT. Execute this command after cloning the repository. ```shell ./run setup ``` -------------------------------- ### Start Backend Dependencies and Services Source: https://github.com/significant-gravitas/autogpt/blob/master/autogpt_platform/frontend/README.md Starts the backend dependencies and services using Docker Compose. This is part of the recommended setup for running the frontend and backend separately. ```bash # on `autogpt_platform` docker compose --profile local up deps_backend -d ``` -------------------------------- ### Example Instruction File Content Source: https://github.com/significant-gravitas/autogpt/blob/master/docs/content/challenges/memory/challenge_b.md Illustrates the format of instruction files, including task IDs and noise, guiding the agent on the next file to read. ```text The current task_id is 4563. [NOISE intended to confuse the agent] Read the file instructions_2.txt using the read_file command. ``` ```text The current task_id is 6182. [NOISE intended to confuse the agent] Read the file instructions_3.txt using the read_file command. ``` ```text The current task_id is 8912. Write all the task_ids into the file output.txt. The file has not been created yet. After that, use the task_complete command. ``` -------------------------------- ### Install Dependencies Source: https://github.com/significant-gravitas/autogpt/blob/master/classic/direct_benchmark/README.md Install the necessary dependencies for the benchmark harness. Run these commands from the parent 'classic/' directory. ```bash cd classic poetry install ``` -------------------------------- ### Google Provider Scope Examples Source: https://github.com/significant-gravitas/autogpt/blob/master/docs/platform/integrating/oauth-guide.md Examples of specifying Google provider and scopes for the Integration Setup Wizard. Default scopes (email, profile, openid) are used if none are provided. ```javascript { provider: 'google', scopes: ['https://www.googleapis.com/auth/calendar'] } // Or use defaults (email, profile, openid): { provider: 'google' } ``` -------------------------------- ### List Blocks using API Key Source: https://github.com/significant-gravitas/autogpt/blob/master/docs/platform/integrating/api-guide.md Quick start example for listing available blocks using curl with API key authentication. ```bash # List available blocks curl -H "X-API-Key: YOUR_API_KEY" \ https://backend.agpt.co/external-api/v1/blocks ``` -------------------------------- ### Run Backend Dependencies Source: https://github.com/significant-gravitas/autogpt/blob/master/docs/platform/getting-started.md Starts the backend dependencies like the database and message queues using Docker Compose. Use `--profile local` for local development setup. ```sh docker compose --profile local up deps --build --detach ``` -------------------------------- ### Start Local Development Dependencies Source: https://github.com/significant-gravitas/autogpt/blob/master/docs/platform/getting-started.md Starts the backend, database, and message queue dependencies required for local development. Use the `--build` flag if dependencies have changed. ```bash docker compose --profile local up deps_backend --build --detach ``` -------------------------------- ### Install AutoGPT and Set Up Environment Source: https://github.com/significant-gravitas/autogpt/blob/master/classic/original_autogpt/README.md Installs AutoGPT dependencies using Poetry and copies the environment template. Remember to edit the .env file with your OpenAI API key. ```bash cd classic poetry install cp .env.template .env # Edit .env with your OPENAI_API_KEY ``` -------------------------------- ### Install Backend Dependencies Source: https://github.com/significant-gravitas/autogpt/blob/master/docs/platform/getting-started.md Installs the backend project dependencies, including development tools, using Poetry. ```sh poetry install --with dev ``` -------------------------------- ### Install AutoGPT Classic with Poetry Source: https://github.com/significant-gravitas/autogpt/blob/master/classic/README.md Clone the repository and install all dependencies using Poetry. Ensure Python 3.12+ and Poetry are installed. ```bash git clone https://github.com/Significant-Gravitas/AutoGPT.git cd classic poetry install ``` -------------------------------- ### Start Frontend Development Server Source: https://github.com/significant-gravitas/autogpt/blob/master/autogpt_platform/frontend/README.md Starts the frontend development server using pnpm. This command should be run after the backend is running separately. ```bash # on `autogpt_platform/frontend` pnpm dev ``` -------------------------------- ### Install Frontend Dependencies Source: https://github.com/significant-gravitas/autogpt/blob/master/docs/platform/getting-started.md Installs all necessary Node.js dependencies for the frontend application using PNPM. Ensure Node.js and PNPM are installed first. ```bash pnpm install ``` -------------------------------- ### Check Node.js and NPM Installation Source: https://github.com/significant-gravitas/autogpt/blob/master/docs/platform/getting-started.md Verify if Node.js and NPM are installed on your system. These are required for running the frontend application. ```bash node -v npm -v ``` -------------------------------- ### Example Calculation Inputs and Operation Source: https://github.com/significant-gravitas/autogpt/blob/master/docs/platform/create-basic-agent.md Demonstrates the inputs and operation for a simple calculator agent test. This example does not require AI. ```text Input A: 227 Input B: 17 Operation: Multiply ``` -------------------------------- ### Start AutoGPT Platform Services Source: https://github.com/significant-gravitas/autogpt/blob/master/docs/platform/ollama.md Navigate to the autogpt_platform directory and run this command to start the backend and frontend services using Docker Compose. ```bash cd autogpt_platform docker compose up -d --build ``` -------------------------------- ### Set Up Environment Variables Source: https://github.com/significant-gravitas/autogpt/blob/master/classic/CLAUDE.md Copies the example environment file and instructs to edit it with API keys. ```bash cp .env.example .env # Edit .env with your OPENAI_API_KEY, etc. ``` -------------------------------- ### Start Production Server Source: https://github.com/significant-gravitas/autogpt/blob/master/autogpt_platform/frontend/CONTRIBUTING.md Launches the production-ready server. ```bash pnpm start ``` -------------------------------- ### Start Ollama Container (NVIDIA GPU) Source: https://github.com/significant-gravitas/autogpt/blob/master/docs/platform/ollama.md This command starts an Ollama Docker container with support for NVIDIA GPUs. Ensure NVIDIA Container Toolkit is installed. ```bash docker run -d --gpus=all -v ollama:/root/.ollama -p 11434:11434 --name ollama ollama/ollama ``` -------------------------------- ### Setting Up Backend and Database Source: https://github.com/significant-gravitas/autogpt/blob/master/autogpt_platform/frontend/TESTING.md Commands to start the backend and Supabase stack, and to seed the database with rich E2E test data. This is essential for running tests that require pre-populated data. ```bash docker compose --profile local up deps_backend -d poetry run python test/e2e_test_data.py ``` -------------------------------- ### Quick Start Load Testing Commands Source: https://github.com/significant-gravitas/autogpt/blob/master/autogpt_platform/backend/load-tests/README.md Set up Supabase keys, generate tokens, configure k6 cloud credentials, and run orchestrated load tests locally or in k6 cloud. ```bash # 1. Set up Supabase service key (required for token generation) export SUPABASE_SERVICE_KEY="your-supabase-service-key" # 2. Generate pre-authenticated tokens (first time setup - creates 160+ tokens with 24-hour expiry) node generate-tokens.js --count=160 # 3. Set up k6 cloud credentials (for cloud testing - see Credential Setup section below) export K6_CLOUD_TOKEN="your-k6-cloud-token" export K6_CLOUD_PROJECT_ID="4254406" # 4. Run orchestrated load tests locally node orchestrator/orchestrator.js DEV local # 5. Run orchestrated load tests in k6 cloud (recommended) node orchestrator/orchestrator.js DEV cloud ``` -------------------------------- ### Redirect to Integration Setup Wizard Source: https://github.com/significant-gravitas/autogpt/blob/master/docs/platform/integrating/oauth-guide.md Construct a URL to redirect users to the Integration Setup Wizard. Ensure all required parameters like client ID, providers, redirect URI, and state are included. ```url https://platform.agpt.co/auth/integrations/setup-wizard? client_id={YOUR_CLIENT_ID}& providers={BASE64_ENCODED_PROVIDERS}& redirect_uri=https://yourapp.com/callback& state={RANDOM_STATE_TOKEN} ``` -------------------------------- ### Example Podman Error Message Source: https://github.com/significant-gravitas/autogpt/blob/master/docs/platform/getting-started.md This error message indicates that Podman is being used instead of Docker, which is not supported. Ensure Docker Desktop is installed and configured. ```text Error: the specified Containerfile or Dockerfile does not exist, ..\..\autogpt_platform\backend\Dockerfile ``` -------------------------------- ### Override MSW Handler with Custom Data Source: https://github.com/significant-gravitas/autogpt/blob/master/autogpt_platform/frontend/TESTING.md Example of overriding a default MSW handler to provide custom JSON response data for an HTTP GET request. ```tsx import { http, HttpResponse } from "msw"; server.use( http.get("http://localhost:3000/api/proxy/api/library/agents", () => { return HttpResponse.json({ agents: [{ id: "1", name: "My Agent" }], pagination: { total: 1 }, }); }), ); ``` -------------------------------- ### Configure Environment Variables Source: https://github.com/significant-gravitas/autogpt/blob/master/classic/README.md Copy the example environment file and add your API keys and optional LLM/search provider settings. Key variables include OPENAI_API_KEY, SMART_LLM, FAST_LLM, TAVILY_API_KEY, and SERPER_API_KEY. ```bash cp .env.example .env ``` ```bash # Required OPENAI_API_KEY=sk-... # Optional LLM settings SMART_LLM=gpt-4o # Model for complex reasoning FAST_LLM=gpt-4o-mini # Model for simple tasks # Optional search providers TAVILY_API_KEY=tvly-... SERPER_API_KEY=... # Optional infrastructure LOG_LEVEL=DEBUG PORT=8000 FILE_STORAGE_BACKEND=local # local, s3, or gcs ``` -------------------------------- ### List Blocks using OAuth 2.0 Source: https://github.com/significant-gravitas/autogpt/blob/master/docs/platform/integrating/api-guide.md Quick start example for listing available blocks using curl with OAuth 2.0 Bearer token authentication. ```bash curl -H "Authorization: Bearer agpt_xt_..." \ https://backend.agpt.co/external-api/v1/blocks ``` -------------------------------- ### Pipeline Execution Example Source: https://github.com/significant-gravitas/autogpt/blob/master/classic/forge/CLAUDE.md Demonstrates how to run a pipeline, specifically collecting commands from all CommandProvider components. ```python results = await self.run_pipeline(CommandProvider.get_commands) # Iterates all components implementing CommandProvider # Collects all yielded Commands # Handles retries on ComponentEndpointError ``` -------------------------------- ### Template Wrapping Order Example Source: https://github.com/significant-gravitas/autogpt/blob/master/autogpt_platform/frontend/src/components/renderers/InputRenderer/docs/HEIRARCHY.md Shows the typical order of template wrapping for rendering schema properties, starting with ObjectFieldTemplate and progressively adding FieldTemplate, TitleField, DescriptionField, and finally the Widget or nested templates. ```text ObjectFieldTemplate (root) └── FieldTemplate (per property) └── WrapIfAdditionalTemplate (if additionalProperties) └── TitleField + DescriptionField + children └── Widget OR nested Template/Field ``` -------------------------------- ### Frontend Build Page Test Example Source: https://github.com/significant-gravitas/autogpt/blob/master/docs/platform/contributing/tests.md Demonstrates a typical frontend test for the build page using Playwright. It includes setup with `test.describe` and `test.beforeEach`, navigation, and assertions for page loading and element interactions like adding and closing blocks. ```typescript test.describe("Build Page Tests", () => { let buildPage: BuildPage; test.beforeEach(async ({ page, loginPage, testUser }) => { await page.goto("/login"); await loginPage.login(testUser); await test.expect(page).toHaveURL("/"); buildPage = new BuildPage(page); }); test("user can add a block", async ({ page }) => { await test.expect(buildPage.isLoaded()).resolves.toBeTruthy(); await test.expect(page).toHaveURL(new RegExp("/.*build")); await buildPage.closeTutorial(); await buildPage.openBlocksPanel(); const block = "some-block-id"; await buildPage.addBlock(block); await buildPage.closeBlocksPanel(); await test.expect(buildPage.hasBlock(block)).resolves.toBeTruthy(); }); }); ``` -------------------------------- ### Implement MessageProvider for Hello Message Source: https://github.com/significant-gravitas/autogpt/blob/master/docs/content/forge/components/protocols.md Example of a component providing a simple user message 'Hello World!' to the agent's prompt. ```python class HelloComponent(MessageProvider): def get_messages(self) -> Iterator[ChatMessage]: yield ChatMessage.user("Hello World!") ``` -------------------------------- ### Delete Google Doc Content Source: https://github.com/significant-gravitas/autogpt/blob/master/docs/integrations/block-integrations/google/docs.md Removes a specified range of content from a Google Doc using start and end index positions. It's recommended to use the 'Get Structure' block first to identify the correct indices. Subsequent content is shifted to fill the deleted gap. ```APIDOC ## Delete Google Doc Content ### Description Deletes a range of content from a Google Doc based on provided start and end index positions. This operation is useful for cleaning up documents or restructuring content. ### Inputs * **document** (Document) - Optional - The Google Doc to modify. Should be provided via an AgentGoogleDriveFileInputBlock. * **start_index** (int) - Required - The 1-based starting index of the content to delete. Index 0 is reserved for a section break. * **end_index** (int) - Required - The ending index of the content to delete. ### Outputs * **error** (str) - An error message if the operation failed. * **result** (Dict[str, Any]) - The result of the delete operation. * **document** (GoogleDriveFile) - The modified Google Doc for chaining operations. ``` -------------------------------- ### Run Llamafile Serve Script Source: https://github.com/significant-gravitas/autogpt/blob/master/docs/content/classic/setup/index.md Execute this command to start the Llamafile server. The first run will download the model and runtime, requiring disk space and time. Add `--use-gpu` to force GPU acceleration. ```shell python3 ./scripts/llamafile/serve.py ``` -------------------------------- ### Install Dependencies with Poetry Source: https://github.com/significant-gravitas/autogpt/blob/master/autogpt_platform/backend/AGENTS.md Installs project dependencies using Poetry. This is a prerequisite for most other backend commands. ```bash poetry install ``` -------------------------------- ### List Benchmark Commands Source: https://github.com/significant-gravitas/autogpt/blob/master/classic/CLAUDE.md Displays help information for the direct-benchmark CLI. ```bash poetry run direct-benchmark --help ``` -------------------------------- ### Install Poetry Source: https://github.com/significant-gravitas/autogpt/blob/master/docs/platform/advanced_setup.md Install the Poetry dependency manager using pip. This is a prerequisite for managing project dependencies. ```bash pip install poetry ``` -------------------------------- ### Example Instruction File Content Source: https://github.com/significant-gravitas/autogpt/blob/master/docs/content/challenges/memory/challenge_c.md Illustrates the format of instruction files, including a phrase and a command to read the next file. The NOISE is intended to confuse the agent. ```text The purple elephant danced on a rainbow while eating a taco. [NOISE intended to confuse the agent] Read the file instructions_2.txt using the read_file command. ``` ```text The sneaky toaster stole my socks and ran away to Hawaii. [NOISE intended to confuse the agent] Read the file instructions_3.txt using the read_file command. ``` -------------------------------- ### Install Pre-commit Hooks Source: https://github.com/significant-gravitas/autogpt/wiki/Contributing Automate code formatting and checks before each commit by installing the pre-commit package and its hooks. ```bash pip install --user pre-commit pre-commit install ``` -------------------------------- ### Permission Pattern Syntax Example Source: https://github.com/significant-gravitas/autogpt/blob/master/classic/forge/README.md Illustrates the syntax for defining permissions using command names and glob patterns. Special tokens like {workspace} and ** are used for path matching. ```text Format: `command_name(glob_pattern)` | Pattern | |---------| | `read_file({workspace}/**)` | Read any file in workspace | | `execute_shell(python:**)` | Execute Python commands | | `web_search(*)` | All web searches | Special tokens: - `{workspace}` - Replaced with workspace path - `**` - Matches any path including `/` - `*` - Matches any characters except `/` ``` -------------------------------- ### GitHub OAuth Handler Example Source: https://github.com/significant-gravitas/autogpt/blob/master/docs/platform/new_blocks.md Example implementation of an OAuth handler for GitHub, enabling OAuth2 authentication. ```python class GithubOAuthHandler(BaseOAuthHandler): """OAuth handler for GitHub.""" async def get_access_token(self, authorization_code: str) -> str: """Retrieve an access token from GitHub. Args: authorization_code: The authorization code received from GitHub. Returns: The access token. """ # Implementation details for exchanging authorization code for access token # This would involve making a POST request to GitHub's token endpoint # with client_id, client_secret, code, redirect_uri, and grant_type='authorization_code'. # The response would contain the access token. return "mock_access_token" async def refresh_access_token(self, refresh_token: str) -> str: """Refresh an expired access token for GitHub. Args: refresh_token: The refresh token to use. Returns: The new access token. """ # Implementation details for refreshing the access token using the refresh token. # This would involve a POST request to GitHub's token endpoint with # client_id, client_secret, refresh_token, and grant_type='refresh_token'. return "mock_refreshed_access_token" async def revoke_access_token(self, access_token: str) -> None: """Revoke an access token for GitHub. Args: access_token: The access token to revoke. """ # Implementation details for revoking the access token. # This typically involves a DELETE request to a specific GitHub endpoint. pass async def get_user_info(self, access_token: str) -> dict: """Retrieve user information from GitHub. Args: access_token: The access token to use. Returns: A dictionary containing user information. """ # Implementation details for fetching user info using the access token. # This would involve a GET request to GitHub's user info endpoint. return {"login": "mock_user", "id": 12345} async def get_authorization_url(self, redirect_uri: str) -> str: """Get the URL to redirect the user to for GitHub authorization. Args: redirect_uri: The URI to redirect the user to after authorization. Returns: The authorization URL. """ # Construct the GitHub authorization URL with client_id, redirect_uri, scope, etc. return f"https://github.com/login/oauth/authorize?client_id=YOUR_CLIENT_ID&redirect_uri={redirect_uri}&scope=read:user,repo" async def get_token_from_refresh_token(self, refresh_token: str) -> dict: """Get a new access token from a refresh token for GitHub. Args: refresh_token: The refresh token to use. Returns: A dictionary containing the new access token and other relevant information. """ # This method is often similar to refresh_access_token but might return # a broader set of token details as per OAuth2 spec. return {"access_token": await self.refresh_access_token(refresh_token)} ``` -------------------------------- ### Run Llamafile Server Source: https://github.com/significant-gravitas/autogpt/blob/master/classic/forge/forge/llm/providers/llamafile/README.md Start the Llamafile server with specified configurations for context size and prediction count. Note that ctx-size=0 uses the model's default context size. ```shell LLAMAFILE="./mistral-7b-instruct-v0.2.Q5_K_M.llamafile" "${LLAMAFILE}" \ --server \ --nobrowser \ --ctx-size 0 \ --n-predict 1024 ``` -------------------------------- ### List Available Strategies Source: https://github.com/significant-gravitas/autogpt/blob/master/classic/direct_benchmark/README.md Display a list of all supported agent strategies that can be configured for the benchmark runs. ```bash poetry run direct-benchmark list-strategies ``` -------------------------------- ### Todoist Get Tasks Source: https://github.com/significant-gravitas/autogpt/blob/master/docs/integrations/block-integrations/todoist/tasks.md Queries Todoist API with provided filters to get matching active tasks. ```APIDOC ## Todoist Get Tasks ### Description Queries Todoist API with provided filters to get matching active tasks. ### Inputs (No specific inputs documented for filtering in the source text.) ### Outputs (No specific outputs documented for this operation in the source text.) ``` -------------------------------- ### List Available Benchmarking Options Source: https://github.com/significant-gravitas/autogpt/blob/master/classic/direct_benchmark/CLAUDE.md Provides commands to list available challenges, model presets, and strategies within the benchmark harness. Use these to understand the testing landscape. ```bash poetry run direct-benchmark list-challenges poetry run direct-benchmark list-models poetry run direct-benchmark list-strategies ``` -------------------------------- ### Start Fresh Benchmark Run Source: https://github.com/significant-gravitas/autogpt/blob/master/classic/direct_benchmark/CLAUDE.md Command to clear all saved benchmark state and start a new run. ```bash # Start fresh (clear all saved state) poetry run direct-benchmark run --fresh \ --strategies one_shot,reflexion \ --models claude ```