### Local Development Setup Source: https://github.com/agent0ai/agent-zero/blob/main/knowledge/main/about/setup-and-deployment.md Sets up a Python virtual environment, installs dependencies, and runs the Agent Zero UI for local development. Ensure you are in the project root directory. ```bash python -m venv .venv source .venv/bin/activate pip install -r requirements.txt pip install -r requirements2.txt python run_ui.py ``` -------------------------------- ### Example First Chat Prompt Source: https://github.com/agent0ai/agent-zero/blob/main/docs/quickstart.md Use this prompt to get Agent Zero to create a short plan for organizing your project notes. ```text Create a short plan for organizing my project notes. ``` -------------------------------- ### Set Up Virtual Environment and Install Dependencies Source: https://github.com/agent0ai/agent-zero/blob/main/AGENTS.md Commands to create a virtual environment, activate it, and install project dependencies from requirement files. Use this when encountering pip installation issues. ```bash python -m venv .venv source .venv/bin/activate pip install -r requirements.txt pip install -r requirements2.txt ``` -------------------------------- ### Install Qwen Code Source: https://github.com/agent0ai/agent-zero/blob/main/plugins/_desktop/assets/desktop/README.md Installs the Qwen Code CLI globally using npm. This command ensures you get the latest version. ```bash npm install -g @qwen-code/qwen-code@latest qwen ``` -------------------------------- ### A0 CLI Manual Installation with uv Source: https://github.com/agent0ai/agent-zero/blob/main/plugins/_a0_connector/skills/setup-a0-cli/SKILL.md If the direct installer URL is blocked, use `uv tool install` for a manual installation. This method allows for specifying package sources like local checkouts or internal Git hosts. ```bash uv tool install --upgrade ``` -------------------------------- ### Install Docker on Debian/Ubuntu Source: https://github.com/agent0ai/agent-zero/blob/main/docs/setup/vps-deployment.md Installs Docker Engine, CLI, and plugins on Debian-based systems. Ensures Docker is enabled and started. ```bash # Update package index apt-get update # Install prerequisites apt-get install -y ca-certificates curl gnupg # Add Docker's official GPG key install -m 0755 -d /etc/apt/keyrings curl -fsSL https://download.docker.com/linux/ubuntu/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg chmod a+r /etc/apt/keyrings/docker.gpg # Set up repository echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null # Install Docker apt-get update apt-get install -y docker-ce docker-ce-cli containerd.io docker-compose-plugin # Start and enable Docker systemctl enable docker systemctl start docker ``` -------------------------------- ### Install Docker on AlmaLinux/Rocky/CentOS/RHEL Source: https://github.com/agent0ai/agent-zero/blob/main/docs/setup/vps-deployment.md Installs Docker Engine, CLI, and plugins on RHEL-based systems. Ensures Docker is enabled and started. ```bash # Install required packages dnf -y install dnf-plugins-core # Add Docker repository (use CentOS repo for AlmaLinux/Rocky) dnf config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo # Install Docker dnf -y install docker-ce docker-ce-cli containerd.io docker-compose-plugin # Start and enable Docker systemctl enable docker systemctl start docker ``` -------------------------------- ### Install OpenCode (NPM Alternative) Source: https://github.com/agent0ai/agent-zero/blob/main/plugins/_desktop/assets/desktop/README.md Installs the OpenCode CLI globally using npm. This is an alternative installation method. ```bash npm i -g opencode opencode ``` -------------------------------- ### Fallback A0 CLI Install via uv tool install (Public Git) Source: https://github.com/agent0ai/agent-zero/blob/main/plugins/_a0_connector/skills/setup-a0-cli/SKILL.md If the direct installer URL is blocked or unavailable, use this command to install the A0 CLI using `uv tool install` with a public Git repository. ```bash uv tool install --upgrade git+https://github.com/agent0ai/a0-connector ``` -------------------------------- ### Fallback A0 CLI Install via uv tool install (Local Checkout) Source: https://github.com/agent0ai/agent-zero/blob/main/plugins/_a0_connector/skills/setup-a0-cli/SKILL.md Use this command to install the A0 CLI from a local checkout of the repository using `uv tool install`. ```bash uv tool install --upgrade /path/to/a0-connector ``` -------------------------------- ### Install Docker using Convenience Script Source: https://github.com/agent0ai/agent-zero/blob/main/docs/setup/vps-deployment.md Installs Docker using a convenience script. Note: May not work on all distributions. ```bash curl -fsSL https://get.docker.com -o get-docker.sh sh get-docker.sh systemctl enable docker systemctl start docker ``` -------------------------------- ### Get Files Example Source: https://github.com/agent0ai/agent-zero/blob/main/webui/components/settings/external/api-examples.html Retrieves content of specified files from the server. Supports text files and indicates binary files. ```javascript // Basic file retrieval async function getFiles(filePaths) { try { const response = await fetch('${url}/api/api_files_get', { method: 'POST', headers: { 'Content-Type': 'application/json', 'X-API-KEY': '${token}' }, body: JSON.stringify({ paths: filePaths }) }); const data = await response.json(); if (response.ok) { console.log('✅ Files retrieved successfully!'); console.log('Retrieved files:', Object.keys(data)); // Convert base64 back to text for display for (const [filename, base64Content] of Object.entries(data)) { try { const textContent = atob(base64Content); console.log(` ${filename}: ${textContent.substring(0, 100)}...`); } catch (e) { console.log(` ${filename}: Binary file (${base64Content.length} chars)`); } } return data; } else { console.error('❌ Error:', data.error); return null; } } catch (error) { console.error('❌ Request failed:', error); return null; } } // Example 1: Get specific files const filePaths = [ "/a0/usr/uploads/document.txt", "/a0/usr/uploads/data.json" ]; getFiles(filePaths); // Example 2: Complete attachment workflow async function attachmentWorkflow() { // Step 1: Send message with attachments const messageResponse = await fetch('${url}/api/api_message', { method: 'POST', headers: { 'Content-Type': 'application/json', 'X-API-KEY': '${token}' }, body: JSON.stringify({ message: "Please analyze this file", attachments: [ { filename: "test.txt", base64: btoa("Hello, this is tes ``` -------------------------------- ### Fallback A0 CLI Install via uv tool install (Internal Mirror) Source: https://github.com/agent0ai/agent-zero/blob/main/plugins/_a0_connector/skills/setup-a0-cli/SKILL.md Install the A0 CLI from an internal Git mirror using `uv tool install`. Ensure the Git URL is accessible. ```bash uv tool install --upgrade git+ssh://git.example.com/team/a0-connector.git ``` -------------------------------- ### Install OpenAI Codex Source: https://github.com/agent0ai/agent-zero/blob/main/plugins/_desktop/assets/desktop/README.md Installs the OpenAI Codex CLI using npm and then launches it. Ensure Node.js and npm are installed. ```bash npm i -g @openai/codex codex ``` -------------------------------- ### Install OpenClaw Source: https://github.com/agent0ai/agent-zero/blob/main/plugins/_desktop/assets/desktop/README.md Installs OpenClaw globally using npm and then initiates its onboarding process, including installing a daemon. Requires Node.js 24 or 22.14+. ```bash npm install -g openclaw@latest openclaw onboard --install-daemon ``` -------------------------------- ### Load Memories Example Source: https://github.com/agent0ai/agent-zero/blob/main/plugins/_memory/prompts/agent.system.tool.memory.md Example of how to structure a tool call to load memories based on a query, similarity threshold, and limit. ```json { "thoughts": ["I should search memory for relevant prior guidance."], "headline": "Loading related memories", "tool_name": "memory_load", "tool_args": { "query": "tool argument format", "threshold": 0.7, "limit": 3 } } ``` -------------------------------- ### API Files Get Example Source: https://github.com/agent0ai/agent-zero/blob/main/webui/components/settings/external/api-examples.html Retrieves a list of files from the API based on provided paths. The response is a dictionary mapping filenames to their content. ```javascript // API files get example async function getFiles(filePaths) { const response = await fetch(`${url}/api/api_files`, { method: 'POST', headers: { 'Content-Type': 'application/json', 'X-API-KEY': '${token}' }, body: JSON.stringify({ paths: filePaths }) }); const data = await response.json(); if (response.ok) { console.log('Files retrieved successfully:'); return data.files; } else { console.error('Error retrieving files:', data.error); return null; } } // Example usage: retrieve a specific file // const retrievedFiles = await getFiles(["/a0/usr/uploads/test.txt"]); // if (retrievedFiles && retrievedFiles["test.txt"]) { // const originalContent = atob(retrievedFiles["test.txt"]); // console.log('Retrieved content:', originalContent); // } ``` -------------------------------- ### Install OpenCode Source: https://github.com/agent0ai/agent-zero/blob/main/plugins/_desktop/assets/desktop/README.md Installs OpenCode using a curl script and then sources your bashrc. This is a convenient way to install the CLI. ```bash curl -sL https://opencode.ai/install | bash opencode ``` -------------------------------- ### Setup A0 CLI Connector Source: https://github.com/agent0ai/agent-zero/blob/main/docs/guides/a0-cli-connector.md Provide this single line to another agent if they are assisting with setup, instructing them to use the setup-a0-cli Skill. ```text Set up the A0 CLI connector for Agent Zero on this machine using the setup-a0-cli Skill. ``` -------------------------------- ### Install Plugin from Git URL via HTTP API Source: https://github.com/agent0ai/agent-zero/blob/main/skills/a0-manage-plugin/SKILL.md Installs a plugin by cloning it from a Git repository URL. This method handles the full installation pipeline, including validation, placement, hook execution, and cache clearing. ```python # (after authentication setup above) resp = s.post( f"{BASE}/api/plugins/_plugin_installer/plugin_install", json={ "action": "install_git", "git_url": "https://github.com//", # "git_token": "", # optional, for private repos # "plugin_name": "override" # optional, override directory name }, headers={"X-CSRF-Token": token, "Origin": ORIGIN}, timeout=120, ) print(resp.json()) ``` -------------------------------- ### Install Plugin from Git URL Source: https://github.com/agent0ai/agent-zero/blob/main/skills/a0-manage-plugin/SKILL.md Installs a plugin from a Git repository URL. This is the preferred method for programmatic use. It handles cloning, validation, installation, and cache clearing. ```APIDOC ## POST /api/plugins/_plugin_installer/plugin_install ### Description Installs a plugin from a Git repository URL. This method triggers a full installation pipeline including cloning, validation, placing the plugin in `usr/plugins/`, running the `install` hook, and clearing the plugin cache. ### Method POST ### Endpoint /api/plugins/_plugin_installer/plugin_install ### Parameters #### Request Body - **action** (string) - Required - Must be `"install_git"`. - **git_url** (string) - Required - The URL of the Git repository containing the plugin. - **git_token** (string) - Optional - A token for accessing private Git repositories. - **plugin_name** (string) - Optional - Overrides the directory name for the plugin. ``` -------------------------------- ### Install WhatsApp Bridge Dependencies Source: https://github.com/agent0ai/agent-zero/blob/main/plugins/_whatsapp_integration/README.md Commands to navigate to the bridge directory and install required production dependencies. ```bash cd plugins/_whatsapp_integration/whatsapp-bridge npm install --production ``` -------------------------------- ### Install Ollama on Linux Source: https://github.com/agent0ai/agent-zero/blob/main/docs/setup/installation.md Run this script to install Ollama on Linux systems. ```bash curl -fsSL https://ollama.com/install.sh | sh ``` -------------------------------- ### Install Plugin from ZIP File Source: https://github.com/agent0ai/agent-zero/blob/main/skills/a0-manage-plugin/SKILL.md Installs a plugin by uploading a ZIP file. This method is also available via the HTTP API. ```APIDOC ## POST /api/plugins/_plugin_installer/plugin_install ### Description Installs a plugin by uploading a ZIP file. The file is processed by the framework to install the plugin. ### Method POST ### Endpoint /api/plugins/_plugin_installer/plugin_install ### Parameters #### Request Body - **action** (string) - Required - Must be `"install_zip"`. - **plugin_file** (file) - Required - The ZIP file containing the plugin. ``` -------------------------------- ### Start Computer Use Session Source: https://github.com/agent0ai/agent-zero/blob/main/plugins/_a0_connector/skills/host-computer-use/SKILL.md Initiates a session with the computer use tool. This is the first action to call when starting a sequence of computer interactions. ```json { "tool_name": "computer_use_remote", "tool_args": { "action": "start_session" } } ``` -------------------------------- ### Install A0 CLI on Windows (PowerShell) Source: https://github.com/agent0ai/agent-zero/blob/main/docs/guides/a0-cli-connector.md Installs the A0 CLI connector using a PowerShell script. Run this on your host machine. ```powershell irm https://cli.agent-zero.ai/install.ps1 | iex ``` -------------------------------- ### Basic SKILL.md Content Example Source: https://github.com/agent0ai/agent-zero/blob/main/docs/developer/contributing-skills.md An example of the essential fields for a SKILL.md file, including name, description, version, author, and tags. ```markdown --- name: "my-awesome-skill" description: "Helps with [specific task] when [specific situation]" version: "1.0.0" author: "Your Name" tags: ["category"] --- # My Awesome Skill ## When to Use Use this skill when you need to [specific task]. ## Instructions 1. First, do this... 2. Then, do that... 3. Finally, verify by... ## Examples ### Example: Basic Case [Show a complete example] ``` -------------------------------- ### Install Gemini CLI Source: https://github.com/agent0ai/agent-zero/blob/main/plugins/_desktop/assets/desktop/README.md Installs the Gemini CLI using npm. This command assumes npm is available in your environment. ```bash npm install -g @google/gemini-cli gemini ``` -------------------------------- ### Install A0 CLI on macOS/Linux Source: https://github.com/agent0ai/agent-zero/blob/main/docs/guides/a0-cli-connector.md Installs the A0 CLI connector using a curl script. Run this on your host machine. ```bash curl -LsSf https://cli.agent-zero.ai/install.sh | sh ``` -------------------------------- ### Example API Endpoint Implementation Source: https://github.com/agent0ai/agent-zero/blob/main/skills/a0-development/SKILL.md An example demonstrating how to implement a custom API endpoint by extending the ApiHandler class and defining its behavior. ```APIDOC ## Example: API Endpoint ### Description This example shows a basic API endpoint that accepts GET and POST requests. It processes an input parameter and returns a result along with the context ID. ### Method - `GET`, `POST` ### Endpoint Auto-discovered based on filename (e.g., `my_endpoint.py` maps to `/api/my_endpoint`). The base path is typically `/a0/api/`. ### Parameters #### Request Body (for POST) - **param** (string) - Optional - The input parameter to process. Defaults to "default" if not provided. - **context** (string) - Required - The ID of the agent context to use. ### Request Example ```json { "param": "some_value", "context": "agent_context_id" } ``` ### Response #### Success Response (200) - **result** (string) - The processed result string. - **context** (string) - The ID of the agent context used. #### Response Example ```json { "result": "processed some_value", "context": "agent_context_id" } ``` ``` -------------------------------- ### Install Plugin from ZIP File via HTTP API Source: https://github.com/agent0ai/agent-zero/blob/main/skills/a0-manage-plugin/SKILL.md Installs a plugin by uploading a ZIP archive. The plugin file is sent as multipart/form-data. ```python # (after authentication setup above) with open("plugin.zip", "rb") as f: resp = s.post( f"{BASE}/api/plugins/_plugin_installer/plugin_install", data={"action": "install_zip"}, files={"plugin_file": f}, headers={"X-CSRF-Token": token, "Origin": ORIGIN}, ) print(resp.json()) ``` -------------------------------- ### List Installed Plugins Locally Source: https://github.com/agent0ai/agent-zero/blob/main/skills/a0-manage-plugin/SKILL.md Lists the names of plugins currently installed in the Agent Zero environment. This can be done via the command line. ```bash ls /a0/usr/plugins/ ``` -------------------------------- ### Example Project Creation Prompt Source: https://github.com/agent0ai/agent-zero/blob/main/docs/quickstart.md Use this prompt to ask Agent Zero to help create a project for a repository and write instructions for it. ```text Help me create a project for this repository and write good instructions for it. ``` -------------------------------- ### Example Project Instructions Source: https://github.com/agent0ai/agent-zero/blob/main/docs/guides/projects.md Define project-specific behavior and guidelines for Agent Zero. This example focuses on documentation tasks, emphasizing clear explanations, user-facing content, and specific file handling rules. ```markdown You are working inside the Docs Example Workspace. Use this project for small documentation examples and user-facing guidance. When this project is active: - Explain steps in plain language before technical detail. - Prefer screenshots, checklists, and concrete examples. - Keep generated files inside this project unless I ask otherwise. - Ask before using credentials, private data, or external accounts. - When editing docs, focus on what the user sees and what they should do next. ``` -------------------------------- ### Agent Profile agent.yaml Example Source: https://github.com/agent0ai/agent-zero/blob/main/skills/a0-development/SKILL.md Example of the agent.yaml file format for defining agent profiles. It includes fields for title, description, and context, which guide the agent's specialization and usage. ```yaml title: Developer description: Agent specialized in complex software development. context: Use this agent for software development tasks, including writing code, debugging, refactoring, and architectural design. ``` -------------------------------- ### Example Tool Implementation Source: https://github.com/agent0ai/agent-zero/blob/main/skills/a0-development/SKILL.md Demonstrates how to create a custom tool by inheriting from `Tool` and implementing the `execute` method to process input and return a response. ```python # my_tool.py from helpers.tool import Tool, Response class MyTool(Tool): async def execute(self, **kwargs): # Get arguments — kwargs contains the tool_args from the agent's JSON input_data = kwargs.get("input", "") # Do something result = f"Processed: {input_data}" # Return response return Response( message=result, # Shown to the agent break_loop=False, # Don't stop the agent loop ) ``` -------------------------------- ### POST /agent/tools/example_tool Source: https://github.com/agent0ai/agent-zero/blob/main/agents/_example/prompts/agent.system.tool.example_tool.md Executes the example tool to verify system functionality and tool integration. ```APIDOC ## POST /agent/tools/example_tool ### Description Executes the example_tool to test system functionality. This tool is automatically included in the system prompt. ### Method POST ### Endpoint /agent/tools/example_tool ### Parameters #### Request Body - **thoughts** (array) - Required - A list of strings representing the agent's reasoning process. - **headline** (string) - Required - A brief summary of the action. - **tool_name** (string) - Required - The name of the tool to execute (must be "example_tool"). - **tool_args** (object) - Required - Arguments for the tool. - **test_input** (string) - Required - The input string to be processed by the tool. ### Request Example { "thoughts": ["Let's test the example tool..."], "headline": "Testing example tool", "tool_name": "example_tool", "tool_args": { "test_input": "XYZ" } } ### Response #### Success Response (200) - **status** (string) - Indicates the execution result. #### Response Example { "status": "success", "output": "Processed XYZ" } ``` -------------------------------- ### Retrieve Logs using GET Request Source: https://github.com/agent0ai/agent-zero/blob/main/webui/components/settings/external/api-examples.html This example demonstrates how to retrieve logs using a GET request. It requires a `context_id` and optionally accepts a `length` parameter to specify the number of log items to retrieve. ```javascript // Get logs using GET request async function getLogsGET(contextId, length = 50) { try { const params = new URLSearchParams({ context_id: contextId, length: length.toString() }); const response = await fetch('${url}/api/api_log_get?' + params, { method: 'GET', headers: { 'X-API-KEY': '${token}' } }); const data = await response.json(); if (response.ok) { console.log('✅ Logs retrieved successfully!'); console.log('Total items:', data.log.total_items); console.log('Returned items:', data.log.returned_items); console.log('Log items:', data.log.items); return data; } else { console.error('❌ Error:', data.error); return null; } } catch (error) { console.error('❌ Request failed:', error); return null; } } // Example usage getLogsGET('ctx_abc123', 20); ``` -------------------------------- ### Get Logs Example Source: https://github.com/agent0ai/agent-zero/blob/main/webui/components/settings/external/api-examples.html Retrieves log entries for a given context ID. Specify the desired number of log entries to fetch. ```javascript async function getLogsPOST(contextId, length) { try { const response = await fetch(`${url}/api/api_logs`, { method: 'POST', headers: { 'Content-Type': 'application/json', 'X-API-KEY': '${token}' }, body: JSON.stringify({ context_id: contextId, length: length }) }); const data = await response.json(); if (response.ok) { console.log('✅ Logs retrieved successfully!'); console.log('Context ID:', data.context_id); console.log('Log GUID:', data.log.guid); console.log('Total items:', data.log.total_items); console.log('Returned items:', data.log.returned_items); console.log('Start position:', data.log.start_position); console.log('Progress:', data.log.progress); console.log('Log items:', data.log.items); return data; } else { console.error('❌ Error:', data.error); return null; } } catch (error) { console.error('❌ Request failed:', error); return null; } } // Example usage - get latest 10 log entries getLogsPOST('ctx_abc123', 10); ``` -------------------------------- ### Example @extensible Path Mapping Source: https://github.com/agent0ai/agent-zero/blob/main/skills/a0-development/SKILL.md Illustrates how a specific function maps to the generated extension point directories. ```text _functions/agent/Agent/handle_exception/start ``` ```text _functions/agent/Agent/handle_exception/end ``` -------------------------------- ### API Reset Example Source: https://github.com/agent0ai/agent-zero/blob/main/webui/components/settings/external/api-examples.html Sends a request to reset the agent's state. This is useful for starting a fresh conversation or clearing previous context. ```javascript // API reset example async function resetAgent() { const response = await fetch(`${url}/api/api_reset`, { method: 'POST', headers: { 'Content-Type': 'application/json', 'X-API-KEY': '${token}' }, body: JSON.stringify({}) }); const data = await response.json(); if (response.ok) { console.log('Agent reset successfully!'); } else { console.error('Error resetting agent:', data.error); } } // Call the function resetAgent(); ``` -------------------------------- ### Setup Multiple Agent Zero Instances Source: https://github.com/agent0ai/agent-zero/blob/main/docs/setup/vps-deployment.md Demonstrates the directory structure and basic commands for deploying multiple Agent Zero instances on a single server, each with unique ports and data directories. ```bash # Instance 1: a0-primary on port 50080 mkdir -p /opt/a0-primary # ... create .env, run container on port 50080 # Instance 2: a0-dev on port 50081 mkdir -p /opt/a0-dev # ... create .env, run container on port 50081 # Instance 3: a0-backup on port 50082 mkdir -p /opt/a0-backup # ... create .env, run container on port 50082 ``` -------------------------------- ### Direct Docker Run for Agent Zero Source: https://github.com/agent0ai/agent-zero/blob/main/docs/setup/installation.md Run the Agent Zero Docker image directly to start the service. This is an alternative to the install scripts. ```bash docker run -p 80:80 agent0ai/agent-zero ``` -------------------------------- ### Skill Directory Structure with Supporting Files Source: https://github.com/agent0ai/agent-zero/blob/main/docs/developer/contributing-skills.md Example of a skill's directory structure, including the required SKILL.md and optional supporting scripts or template files. ```bash my-awesome-skill/ ├── SKILL.md # Required ├── helper.py # Optional Python script ├── setup.sh # Optional shell script └── templates/ # Optional templates folder └── config.json ``` -------------------------------- ### Project Instructions Example Source: https://github.com/agent0ai/agent-zero/blob/main/docs/guides/usage.md Define specific instructions for Agent Zero within a project context, focusing on communication style and file handling. ```markdown When this project is active: - Explain steps in plain language before technical detail. - Prefer screenshots, checklists, and concrete examples. - Keep generated files inside this project unless I ask otherwise. - Ask before using credentials, private data, or external accounts. ``` -------------------------------- ### Invoke example_tool via JSON Source: https://github.com/agent0ai/agent-zero/blob/main/agents/_example/prompts/agent.system.tool.example_tool.md Demonstrates the JSON structure required to invoke the example_tool. It includes a thoughts array, a headline, the tool name, and the specific arguments required by the tool. ```json { "thoughts": [ "Let's test the example tool..." ], "headline": "Testing example tool", "tool_name": "example_tool", "tool_args": { "test_input": "XYZ" } } ``` -------------------------------- ### Run Agent Zero with Docker Source: https://github.com/agent0ai/agent-zero/blob/main/README.md If Docker is already installed, run this command to start Agent Zero. It maps port 80 and mounts a volume for user data. ```bash docker run -p 80:80 -v a0_usr:/a0/usr agent0ai/agent-zero ``` -------------------------------- ### Importing Example Store Component (JavaScript) Source: https://github.com/agent0ai/agent-zero/blob/main/webui/components/_examples/_example-component.html Demonstrates how to import a store component from a specified path within the project. This is a common pattern for managing application state or shared logic across components. ```javascript import { store } from "/components/_examples/_example-store.js"; ``` -------------------------------- ### Execute Node.js Code to Get Current Directory Source: https://github.com/agent0ai/agent-zero/blob/main/plugins/_code_execution/prompts/agent.system.tool.code_exe.md Execute Javascript code using Node.js to perform operations like retrieving the current working directory. Ensure Node.js is installed in the execution environment. ```json { "thoughts": [ "Need to do...", "I can use...", "Then I can...", ], "headline": "Executing Javascript code to check current directory", "tool_name": "code_execution_tool", "tool_args": { "runtime": "nodejs", "session": 0, "reset": false, "code": "console.log(process.cwd());", } } ``` -------------------------------- ### Example Profile Creation Prompt Source: https://github.com/agent0ai/agent-zero/blob/main/docs/guides/agent-profiles.md Provide a practical description of the desired profile's capabilities, target audience, tone, and output format. ```text This profile should help me plan YouTube scripts for technical demos. It should ask for the target audience, keep the tone simple, and suggest a visual outline. ``` -------------------------------- ### Install Claude Code (Native Installer) Source: https://github.com/agent0ai/agent-zero/blob/main/plugins/_desktop/assets/desktop/README.md Installs Claude Code using a recommended native installer script. After installation, source your bashrc to make the command available. ```bash curl -fsSL https://claude.ai/install.sh | bash source ~/.bashrc claude ``` -------------------------------- ### Install Ollama on macOS using Homebrew Source: https://github.com/agent0ai/agent-zero/blob/main/docs/setup/installation.md Use this command to install Ollama on macOS if you have Homebrew installed. ```bash brew install ollama ``` -------------------------------- ### Styling Example Component (CSS) Source: https://github.com/agent0ai/agent-zero/blob/main/webui/components/_examples/_example-component.html Provides CSS rules for styling an element with the ID 'example-component'. This snippet shows how to apply basic width styling to ensure the component occupies full available width. ```css #example-component { width: 100%; } ``` -------------------------------- ### Create Agent Zero Directory Structure Source: https://github.com/agent0ai/agent-zero/blob/main/docs/setup/vps-deployment.md Sets up the necessary directories for Agent Zero instance data and logs. ```bash # Choose your installation path A0_NAME="a0-instance" # Change this to your instance name A0_PATH="/opt/${A0_NAME}" # Create directories mkdir -p ${A0_PATH} mkdir -p ${A0_PATH}/work_dir mkdir -p ${A0_PATH}/memory mkdir -p ${A0_PATH}/logs ``` -------------------------------- ### Install Claude Code (NPM Alternative) Source: https://github.com/agent0ai/agent-zero/blob/main/plugins/_desktop/assets/desktop/README.md Installs the Claude Code CLI as an npm package. This is an alternative to the native installer. ```bash npm install -g @anthropic-ai/claude-code claude ``` -------------------------------- ### API Project Management Example Source: https://github.com/agent0ai/agent-zero/blob/main/webui/components/settings/external/api-examples.html Demonstrates activating a project by name in the first message and then continuing the conversation within that project's context. Subsequent messages do not need the project name. ```javascript // Project usage example async function sendMessageWithProject() { try { // First message - activate project const response = await fetch('${url}/api/api_message', { method: 'POST', headers: { 'Content-Type': 'application/json', 'X-API-KEY': '${token}' }, body: JSON.stringify({ message: "Analyze the project structure", project_name: "my-web-app" // Activates this project }) }); const data = await response.json(); if (response.ok) { console.log('✅ Project activated!'); console.log('Context ID:', data.context_id); console.log('Response:', data.response); // Continue conversation - project already set const followUp = await fetch('${url}/api/api_message', { method: 'POST', headers: { 'Content-Type': 'application/json', 'X-API-KEY': '${token}' }, body: JSON.stringify({ context_id: data.context_id, message: "What files are in the project?" // Do NOT include project_name here - already set on first message }) }); const followUpData = await followUp.json(); console.log('Follow-up response:', followUpData.response); return followUpData; } else { console.error('❌ Error:', data.error); return null; } } catch (error) { console.error('❌ Request failed:', error); return null; } } // Call the function sendMessageWithProject(); ``` -------------------------------- ### Example MCP Servers Configuration JSON Source: https://github.com/agent0ai/agent-zero/blob/main/webui/components/settings/mcp/client/example.html This JSON object demonstrates the structure for configuring MCP servers. It includes examples of local servers defined by 'command' and 'args', and remote servers defined by 'url' and 'headers'. Options like 'disabled', 'description', 'init_timeout', and 'tool_timeout' are also illustrated. ```json { "mcpServers": { "sqlite": { "command": "uvx", "args": [ "mcp-server-sqlite", "--db-path", "/root/db.sqlite" ], "init_timeout": 10, "tool_timeout": 200 }, "sequential-thinking": { "disabled": true, "command": "npx", "args": [ "--yes", "--package", "@modelcontextprotocol/server-sequential-thinking", "mcp-server-sequential-thinking" ] }, "deep-wiki": { "description": "Use this MCP to analyze github repositories", "url": "https://mcp.deepwiki.com/mcp", "type": "streamable-http" } } } ``` -------------------------------- ### Install OpenHands CLI Source: https://github.com/agent0ai/agent-zero/blob/main/plugins/_desktop/assets/desktop/README.md Installs OpenHands CLI using pip with uv as the package manager. It specifies Python 3.12 for the installation. ```bash python3 -m pip install uv uv tool install openhands --python 3.12 openhands ``` -------------------------------- ### Install Playwright Browsers for Local Development Source: https://github.com/agent0ai/agent-zero/blob/main/docs/guides/troubleshooting.md Run this command from the project root after installing Python requirements to install the Chromium browser for local development checkouts. ```bash PLAYWRIGHT_BROWSERS_PATH=tmp/playwright playwright install chromium ``` -------------------------------- ### Create Presentation and Check Slides in Desktop Source: https://github.com/agent0ai/agent-zero/blob/main/docs/guides/desktop.md Use this prompt to create a short Impress presentation and then use the Desktop to verify the slide appearance. ```text Create a short Impress deck, then use Desktop to check that the slides look clean. ``` -------------------------------- ### A0 CLI Installation within Container Source: https://github.com/agent0ai/agent-zero/blob/main/plugins/_a0_connector/skills/setup-a0-cli/SKILL.md The A0 CLI must be installed on the host machine, not within a Docker container. If you are inside a container, exit and run the host installer. ```bash exit ``` -------------------------------- ### Example Output Format Source: https://github.com/agent0ai/agent-zero/blob/main/plugins/_memory/prompts/memory.memories_filter.sys.md The AI should respond with a JSON array of integers representing the indices of relevant memories. No other text or formatting should be included. ```json [0, 2] ``` -------------------------------- ### Import Plugin Installer Store JavaScript Source: https://github.com/agent0ai/agent-zero/blob/main/plugins/_plugin_installer/webui/install-git.html Imports the store object from the plugin installer's web UI JavaScript module. This is essential for managing the state of plugin installations within the application. ```javascript import { store } from "/plugins/_plugin_installer/webui/pluginInstallStore.js"; ```