### Install and Run Coral Studio Source: https://docs.coralprotocol.org/concepts/coral-studio This command installs and launches the Coral Studio application using Node Package Manager (npm). It's the primary method to get started with Coral Studio for local development and testing. ```bash npx @coral-protocol/coral-studio ``` -------------------------------- ### Install Coral CLI Source: https://docs.coralprotocol.org/help/troubleshooting Installs the Coral command-line interface using pip. Ensure you have Python and pip installed. ```bash pip install coralizer-cli ``` -------------------------------- ### Start Coral Server in Devmode Source: https://docs.coralprotocol.org/guides/writing-agents Command to launch the Coral Server in development mode, disabling application ID and privacy key checks for easier agent testing. ```bash ./gradlew run --dev ``` -------------------------------- ### Mount Docker Socket on Windows for Coral Server Source: https://docs.coralprotocol.org/guides/docker-in-docker This command mounts the Docker socket on Windows into the container, enabling Coral Server to manage Docker resources. ```bash docker run -v "//var/run/docker.sock://var/run/docker.sock" ... ``` -------------------------------- ### Mount Colima Docker Socket on macOS for Coral Server Source: https://docs.coralprotocol.org/guides/docker-in-docker This command mounts the Docker socket provided by Colima on macOS into the container, facilitating Coral Server's Docker interactions. ```bash docker run -v "~/.colima/docker.sock:/var/run/docker.sock" ... ``` -------------------------------- ### Mount Docker Socket on Linux for Coral Server Source: https://docs.coralprotocol.org/guides/docker-in-docker This command mounts the host's Docker socket at `/var/run/docker.sock` into the container, allowing Coral Server to interact with the Docker daemon. ```bash docker run -v /var/run/docker.sock:/var/run/docker.sock ... ``` -------------------------------- ### Mount Docker Socket on macOS (without Colima) for Coral Server Source: https://docs.coralprotocol.org/guides/docker-in-docker This command mounts the default Docker socket on macOS (when Colima is not used) into the container for Coral Server. ```bash docker run -v "~/.docker/run/docker.sock:/var/run/docker.sock" ... ``` -------------------------------- ### Mount Docker Engine Pipe on Windows for Coral Server Source: https://docs.coralprotocol.org/guides/docker-in-docker This command mounts the Docker engine pipe on Windows into the container when the standard socket mount fails, allowing Coral Server to interact with Docker. ```bash docker run \ -v "//./pipe/docker_engine://./pipe/docker_engine" \ ... ``` -------------------------------- ### Deploy Coral Server with Docker Source: https://docs.coralprotocol.org/guides/integrating-with-your-app This snippet demonstrates how to deploy Coral Server using Docker. It involves creating a configuration directory, placing config.toml and registry.toml files within it, and then running the Coral Server Docker image, mounting the configuration directory to /config. This method is recommended for its stability, reproducibility, and portability. ```bash # create your config dir, that our config.toml & registry.toml will live inside mkdir my-config touch my-config/config.toml # create empty files for now touch my-config/registry.toml # and mount my-config when running docker run -p 5555:5555 -v ./my-config:/config ghcr.io/coral-protocol/coral-server:latest ``` -------------------------------- ### Bootstrap Script for Local Executable Runtime Source: https://docs.coralprotocol.org/guides/writing-agents A bash script to set up and run a Python agent locally using 'uv'. It handles changing to the project directory and executing the main Python script. ```bash #!/usr/bin/env bash set -e fatal () { echo "$1" >&2 exit 1 } PYTHON_SCRIPT="main.py" # Determine script directory SCRIPT_DIR=$(dirname "$(realpath "$0" 2>/dev/null || readlink -f "$0" 2>/dev/null || echo "$0")") PROJECT_DIR="$SCRIPT_DIR" echo "Agent directory: $PROJECT_DIR" # Change to project directory cd "$PROJECT_DIR" || fatal "Could not cd to '$PROJECT_DIR'" echo "Running $PYTHON_SCRIPT..." uv run "$PYTHON_SCRIPT" ``` -------------------------------- ### Build Coral Server JAR with Gradle Source: https://docs.coralprotocol.org/guides/integrating-with-your-app This snippet shows how to clone the Coral Server repository and build the executable JAR file using Gradle. The build process excludes tests to speed up compilation. The resulting JAR file is located in the build/libs directory. ```bash git clone https://github.com/Coral-Protocol/coral-server.git cd coral-server ./gradlew build --no-daemon -x test # the resulting .jar will end up in build/libs/coral-server-[..].jar ``` -------------------------------- ### Connect to Coral Server (Python) Source: https://docs.coralprotocol.org/guides/writing-agents Demonstrates how to establish a connection to a Coral Server MCP using the Coral Python toolkit. It retrieves the connection URL from environment variables and configures client parameters like timeouts. ```python from camel.toolkits.mcp_toolkit import MCPClient from camel.utils.mcp_client import ServerConfig import os coral_url = os.getenv( "CORAL_CONNECTION_URL", default = "http://localhost:5555/sse/v1/devmode/exampleApplication/privkey/session1/?agentId=example_agent" ) coral_mcp = MCPClient( ServerConfig( url=coral_url, timeout=3000000.0, # These timeouts are large since wait_for_mentions, etc. can take a long time to resolve. sse_read_timeout=3000000.0, terminate_on_close=True, prefer_sse=True ), timeout=3000000.0 ) ``` -------------------------------- ### Coral Agent Options Configuration (TOML) Source: https://docs.coralprotocol.org/guides/writing-agents Shows how to define configurable options for a Coral agent within the `coral-agent.toml` file. Options include type, description, default values, and whether they are required. ```toml # ... [options] DISCORD_API_TOKEN = { type = "string", description = "Discord API token", required = true } DISCORD_THREAD_ID = { type = "string", description = "The ID of the thread to watch", required = true } DISCORD_TIMEOUT_WARNING = { type = "string", description = "The amount of time before a warning issuing a warning to the user that the thread will timeout.", default = "30m" } DISCORD_TIMEOUT = { type = "string", description = "After the timeout warning has occurred, the thread will close in this amount of time.", default = "30m" } OPENROUTER_API_KEY = { type = "string", description = "An API key for OpenRouter", required = true } # ... ``` -------------------------------- ### Configure Local Executable Runtime in coral-agent.toml Source: https://docs.coralprotocol.org/guides/writing-agents Configures the local executable runtime, specifying the command to execute the agent's bootstrap script. Each part of the command should be a separate item in the array. ```toml [runtime.executable] command = ["bash", "-c", "run_agent.sh"] # each 'word' of your command should be a separate item in the array, to minimise issues with argument parsing ``` -------------------------------- ### Run Coral Server with Java and Custom Configuration Source: https://docs.coralprotocol.org/guides/integrating-with-your-app This snippet illustrates how to run the Coral Server JAR file using Java after building it. It includes setting environment variables for configuration file paths (`CONFIG_FILE_PATH` and `REGISTRY_FILE_PATH`) to point to a custom configuration directory outside the repository. This approach is recommended for production deployments to ensure configurations are easily accessible. ```bash # make a folder outside of the repo folder, that our application.yaml will live inside mkdir ../coral-config/ # and point at that folder when running Coral Server export CONFIG_FILE_PATH=../coral-config/config.toml export REGISTRY_FILE_PATH=../coral-config/registry.toml java -jar "" ``` -------------------------------- ### Configure Docker Runtime in coral-agent.toml Source: https://docs.coralprotocol.org/guides/writing-agents Specifies the Docker image to use for running an agent. It is recommended not to specify a tag, as Coral Server will use the agent's defined version for better reproducibility. ```toml [runtimes.docker] image = "name-of-docker-image" # whatever you would put in `docker run ` ``` -------------------------------- ### Coral Agent Metadata (TOML) Source: https://docs.coralprotocol.org/guides/writing-agents Defines the basic metadata for a Coral agent, including its name, version, and a descriptive text. This TOML snippet is typically placed in a `coral-agent.toml` file. ```toml [agent] name = "name-of-my-agent" version = "0.1.0" # agent version (should be semver) description = "Description of this agent's capabilities, that is shown to other agents" ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.