### Quick Start: Basic Agent Setup Source: https://github.com/truffle-ai/dexto/blob/main/docs/docs/guides/dexto-sdk.md Illustrates the minimal configuration required to create and start a DextoAgent using the OpenAI provider and a specified model. It then shows how to run a simple prompt and log the output. ```TypeScript import { DextoAgent } from 'dexto'; // Create agent with minimal configuration const agent = new DextoAgent({ llm: { provider: 'openai', model: 'gpt-4o', apiKey: process.env.OPENAI_API_KEY } }); await agent.start(); // Start a conversation const response = await agent.run('Hello! What can you help me with?'); console.log(response); ``` -------------------------------- ### Database Agent Setup and Execution Source: https://github.com/truffle-ai/dexto/blob/main/agents/README.md Instructions to set up and run the Database Agent. This involves navigating to the agent's directory, running a setup script, and starting the agent with a specific configuration file. ```bash cd database-agent ./setup-database.sh npm start -- --agent database-agent.yml ``` -------------------------------- ### Verify Dexto Installation Source: https://github.com/truffle-ai/dexto/blob/main/docs/docs/getting-started/installation.md Tests the Dexto installation by running a simple query through the CLI. A successful response indicates that the runtime is functioning correctly. ```bash dexto "What is the meaning of life?" ``` -------------------------------- ### Install Dexto CLI Source: https://github.com/truffle-ai/dexto/blob/main/docs/docs/getting-started/installation.md Installs the Dexto CLI globally using npm. This command makes the 'dexto' executable available on your system for running agents. ```bash npm install -g dexto ``` -------------------------------- ### Install Dexto SDK Source: https://github.com/truffle-ai/dexto/blob/main/docs/docs/guides/dexto-sdk.md Provides the command to install the Dexto SDK using npm, a package manager for Node.js. ```bash npm install dexto ``` -------------------------------- ### Install and Run Dexto LangChain Integration Source: https://github.com/truffle-ai/dexto/blob/main/examples/dexto-langchain-integration/README.md Installs dependencies, builds the LangChain agent, sets the OpenAI API key, and runs a sentiment analysis task using Dexto with the LangChain agent. ```bash cd examples/dexto-langchain-integration/langchain-agent npm install npm run build export OPENAI_API_KEY="your_openai_api_key_here" cd ../../.. dexto --agent ./examples/dexto-langchain-integration/dexto-agent-with-langchain.yml "Analyze the sentiment of this review: 'I absolutely love this product! The quality is amazing and the customer service was outstanding. Best purchase I've made this year.'" ``` -------------------------------- ### Setup and Run Database Agent Source: https://github.com/truffle-ai/dexto/blob/main/agents/database-agent/README.md This snippet details the steps to set up and run the database agent. It involves navigating to the agent's directory, executing a setup script, and starting the agent with a configuration file. ```bash cd database-agent ./setup-database.sh npm start -- --agent database-agent.yml ``` -------------------------------- ### Complete Example with Multiple Tool Servers Source: https://github.com/truffle-ai/dexto/blob/main/agents/README.md A comprehensive configuration example integrating multiple tool servers (github, filesystem, terminal, desktop, custom) with an LLM provider (OpenAI). It includes environment variables for authentication and API keys. ```yaml mcpServers: github: type: stdio command: npx args: - -y - "@modelcontextprotocol/server-github" env: GITHUB_PERSONAL_ACCESS_TOKEN: your-github-token filesystem: type: stdio command: npx args: - -y - "@modelcontextprotocol/server-filesystem" - . terminal: type: stdio command: npx args: - -y - "@modelcontextprotocol/server-terminal" desktop: type: stdio command: npx args: - -y - "@wonderwhy-er/desktop-commander" custom: type: stdio command: node args: - --loader - ts-node/esm - src/servers/customServer.ts env: API_KEY: your-api-key llm: provider: openai model: gpt-4 apiKey: $OPENAI_API_KEY ``` -------------------------------- ### Start Dexto API Server Source: https://github.com/truffle-ai/dexto/blob/main/docs/api/getting-started.md Starts the Dexto API server, enabling both REST and WebSocket APIs. The server runs on port 3001 by default. ```bash dexto --mode server ``` -------------------------------- ### Dexto SDK: Agent Initialization and Usage Source: https://github.com/truffle-ai/dexto/blob/main/docs/how-to-dexto.md Example of using the DextoAgent class in TypeScript. This includes loading agent configuration, starting the agent, running tasks, managing conversation history, and stopping the agent. ```typescript import 'dotenv/config'; import { DextoAgent, loadAgentConfig } from 'dexto'; // Load configuration from default location (auto-discovery) const config = await loadAgentConfig(); // Or load from a specific file // const config = await loadAgentConfig('./agents/default-agent.yml'); // Create and start the agent const agent = new DextoAgent(config); await agent.start(); // Initializes services like MCP servers // Run a single task const response = await agent.run('List the 3 largest files in the current directory.'); console.log(response); // Hold a conversation (state is maintained automatically) await agent.run('Write a function that adds two numbers.'); await agent.run('Now add type annotations to it.'); // Reset the conversation history agent.resetConversation(); // Stop the agent and disconnect services await agent.stop(); ``` -------------------------------- ### Setup a new TypeScript project with Dexto Source: https://github.com/truffle-ai/dexto/blob/main/docs/docs/guides/cli.md Initializes a fresh TypeScript project using dexto-core, setting up the basic structure for building AI applications with Dexto. ```bash dexto create-app ``` -------------------------------- ### Run Dexto Container (Quick Start) Source: https://github.com/truffle-ai/dexto/blob/main/docs/docs/guides/deployment.md Runs the Dexto Docker container with environment variables loaded from a .env file and exposes the server on port 3001. This is a quick way to start the Dexto server locally. ```bash docker run --env-file .env -p 3001:3001 dexto ``` -------------------------------- ### Setup API Key with Context-Aware Instructions Source: https://github.com/truffle-ai/dexto/blob/main/CLAUDE.md Utility for guiding users through API key setup, providing context-aware instructions. This ensures users receive relevant guidance based on their environment. ```TypeScript import { setupApiKey } from 'src/app/cli/utils/api-key-setup'; // Example usage: setupApiKey(); // Displays context-specific instructions for setting up the API key. ``` -------------------------------- ### Basic Dexto Configuration Example Source: https://github.com/truffle-ai/dexto/blob/main/agents/README.md Provides a fundamental YAML structure for Dexto configuration, including settings for tool servers (github, filesystem) and LLM (openai). ```yaml mcpServers: github: type: stdio command: npx args: - -y - "@modelcontextprotocol/server-github" env: GITHUB_PERSONAL_ACCESS_TOKEN: your-github-token filesystem: type: stdio command: npx args: - -y - "@modelcontextprotocol/server-filesystem" - . llm: provider: openai model: gpt-4 apiKey: $OPENAI_API_KEY ``` -------------------------------- ### Start Dexto Server using npm Source: https://github.com/truffle-ai/dexto/blob/main/postman/README.md This snippet shows the commands to build and start the Dexto server. It requires Node.js and npm to be installed. The server is started in 'server' mode with a specified configuration file. ```bash npm run build node dist/src/app/index.js --mode server --agent test-config.yml ``` -------------------------------- ### Dexto SDK: Installation Source: https://github.com/truffle-ai/dexto/blob/main/docs/how-to-dexto.md Install the Dexto SDK package into your project using npm. This is the first step to using Dexto programmatically in your TypeScript or JavaScript applications. ```bash npm install dexto ``` -------------------------------- ### Install Dexto CLI Source: https://github.com/truffle-ai/dexto/blob/main/docs/how-to-dexto.md Installs the Dexto command-line interface globally using npm. This command is essential for using Dexto from your terminal. ```bash npm install -g dexto ``` -------------------------------- ### Run Docker Compose Source: https://github.com/truffle-ai/dexto/blob/main/docs/docs/guides/deployment.md Builds and starts the Dexto services defined in the Docker Compose file. ```bash docker compose up --build ``` -------------------------------- ### Create and Run a Basic Dexto Agent Source: https://github.com/truffle-ai/dexto/blob/main/docs/docs/guides/dexto-sdk.md Demonstrates how to initialize a DextoAgent with OpenAI configuration, start it, run a query, and log the response. It requires an OpenAI API key set in the environment variables. ```TypeScript import { DextoAgent } from 'dexto'; const agent = new DextoAgent({ llm: { provider: 'openai', model: 'gpt-4', apiKey: process.env.OPENAI_API_KEY, }, }); await agent.start(); const response = await agent.run('Hello, world!'); console.log(response); await agent.stop(); ``` -------------------------------- ### Start Agents with PM2 Source: https://github.com/truffle-ai/dexto/blob/main/docs/docs/tutorials/multi-agent-systems.md This bash command installs PM2 globally and then uses it to start all the Dexto agents defined in the ecosystem configuration file. PM2 will manage these agents, ensuring they run continuously. ```bash # Install PM2 npm install -g pm2 # Create ecosystem file cat > ecosystem.config.js << EOF module.exports = { apps: [ { name: 'researcher-agent', script: 'dexto', args: '--mode mcp --web-port 3001 --agent researcher.yml' }, { name: 'writer-agent', script: 'dexto', args: '--mode web --web-port 3002 --agent writer.yml' } ] }; EOF # Start all agents pm2 start ecosystem.config.js ``` -------------------------------- ### Run Coordinator and Specialized Agents Source: https://github.com/truffle-ai/dexto/blob/main/docs/docs/tutorials/multi-agent-systems.md This bash script demonstrates how to start the specialized agents (researcher, writer, reviewer) in MCP server mode and then start the coordinator agent in web mode. This setup allows the coordinator to manage and delegate tasks to the specialized agents via user interaction through the web UI. ```bash # Start specialized agents (MCP servers) dexto --mode mcp --web-port 3001 --agent researcher.yml dexto --mode mcp --web-port 3002 --agent writer.yml dexto --mode mcp --web-port 3003 --agent reviewer.yml # Start coordinator (Web UI for user interaction) dexto --mode web --web-port 3000 --agent coordinator.yml ``` -------------------------------- ### Set API Keys for LLM Providers Source: https://github.com/truffle-ai/dexto/blob/main/docs/docs/getting-started/installation.md Sets environment variables for various Large Language Model providers, which Dexto uses to run agents. Dexto automatically detects these keys based on the selected model. ```bash # OpenAI export OPENAI_API_KEY="sk-..." # Anthropic export ANTHROPIC_API_KEY="sk-ant-..." # Google Gemini export GOOGLE_GENERATIVE_AI_API_KEY="AIza..." # Groq export GROQ_API_KEY="gsk_..." # XAI export XAI_API_KEY="xai_..." # Cohere export COHERE_API_KEY="cohere_..." ``` -------------------------------- ### Dexto Dockerfile for Deployment Source: https://github.com/truffle-ai/dexto/blob/main/docs/docs/tutorials/multi-agent-systems.md This Dockerfile outlines the steps to containerize a Dexto application. It starts from a Node.js Alpine image, sets up the working directory, installs Dexto globally, copies project files, and defines the default command to run Dexto in web mode. ```dockerfile # Dockerfile FROM node:18-alpine WORKDIR /app COPY package*.json ./ RUN npm install -g dexto COPY . . CMD ["dexto", "--mode", "web", "--web-port", "3000"] ``` -------------------------------- ### Quick Start MCP Manager Source: https://github.com/truffle-ai/dexto/blob/main/docs/docs/mcp/mcp-manager.md Demonstrates how to initialize the MCPManager, connect to an MCP server (filesystem type), retrieve available tools, and execute a tool (readFile). This provides a basic example of the MCPManager's functionality. ```typescript import { MCPManager } from 'dexto'; // Create manager instance const manager = new MCPManager(); // Connect to an MCP server await manager.connectServer('filesystem', { type: 'stdio', command: 'npx', args: ['-y', '@modelcontextprotocol/server-filesystem', '.'] }); // Get available tools const tools = await manager.getAllTools(); console.log('Available tools:', Object.keys(tools)); // Execute a tool const result = await manager.executeTool('readFile', { path: './README.md' }); console.log(result); ``` -------------------------------- ### Run One-Shot Prompt via CLI Source: https://github.com/truffle-ai/dexto/blob/main/docs/how-to-dexto.md Executes a single task using the Dexto CLI. This example demonstrates creating a new file named 'test.txt' with 'hello world' content directly from the command line. ```bash dexto "create a new file named test.txt with hello world content" ``` -------------------------------- ### Setup Database Agent Source: https://github.com/truffle-ai/dexto/blob/main/docs/docs/tutorials/database-agent.md This snippet demonstrates how to navigate to the database agent directory and run a setup script to initialize a sample database. It sets up tables for users, products, orders, and order items. ```bash cd agents/database-agent ./setup-database.sh ``` -------------------------------- ### Start Dexto with a different configuration file Source: https://github.com/truffle-ai/dexto/blob/main/docs/docs/guides/cli.md Configures the Dexto CLI to use a specific agent configuration file, allowing for custom AI agent setups. ```bash dexto --agent ``` -------------------------------- ### Implement Dexto Agent Fallback on Setup Failure Source: https://github.com/truffle-ai/dexto/blob/main/docs/docs/guides/dexto-sdk.md Shows how to implement a fallback mechanism for DextoAgent initialization. If the primary configuration fails, it attempts to start with a minimal configuration, ensuring basic functionality. ```typescript try { const agent = new DextoAgent({ llm: primaryLLMConfig, mcpServers: allServers }); await agent.start(); } catch (error) { console.warn('⚠️ Full setup failed, using minimal config'); // Fallback to basic configuration const agent = new DextoAgent({ llm: fallbackLLMConfig, mcpServers: {} // No external tools }); await agent.start(); } ``` -------------------------------- ### Start Dexto in Server Mode (Global Install) Source: https://github.com/truffle-ai/dexto/blob/main/docs/docs/guides/dexto-as-mcp-server.md This bash command starts the Dexto agent in server mode when Dexto is installed globally. This enables it to act as an MCP server. ```bash dexto --mode server ``` -------------------------------- ### Start Dexto in Server Mode (Global Install) Source: https://github.com/truffle-ai/dexto/blob/main/docs/docs/mcp/dexto-as-mcp-server.md This bash command starts the Dexto agent in server mode when Dexto is installed globally. This allows it to listen for incoming MCP connections. ```bash dexto --mode server ``` -------------------------------- ### Start Dexto in Server Mode with Debug Logging (Global Install) Source: https://github.com/truffle-ai/dexto/blob/main/docs/docs/mcp/dexto-as-mcp-server.md This command starts Dexto in server mode with debug logging enabled when Dexto is installed globally. This is helpful for troubleshooting. ```bash dexto --mode server --debug ``` -------------------------------- ### Start Dexto in MCP Mode with Debug Logging (Global Install) Source: https://github.com/truffle-ai/dexto/blob/main/docs/docs/mcp/dexto-as-mcp-server.md This bash command starts Dexto in MCP mode with debug logging enabled when Dexto is installed globally. This is useful for debugging MCP-specific interactions. ```bash dexto --mode mcp --debug ``` -------------------------------- ### Start Dexto Web Playground Source: https://github.com/truffle-ai/dexto/blob/main/docs/docs/guides/web-playground.md This command starts the Dexto web playground. After execution, access the playground by navigating to http://localhost:3000 in your web browser. ```bash dexto --mode web ``` -------------------------------- ### Run Image Editor Agent Source: https://github.com/truffle-ai/dexto/blob/main/docs/docs/tutorials/image-editor-agent.md This command initiates the Image Editor Agent. It automatically downloads and installs the necessary MCP server (`truffle-ai-image-editor-mcp`) via `uvx` upon the first execution. ```Bash dexto --agent agents/image-editor-agent/image-editor-agent.yml ``` -------------------------------- ### Run Dexto Image Editor Agent Source: https://github.com/truffle-ai/dexto/blob/main/docs/docs/tutorials/image-editor-agent.md Starts the Dexto image editor agent from the project root directory. This command initializes the agent, making it ready to process image-related requests. ```bash # From the project root dexto --agent agents/image-editor-agent/image-editor-agent.yml ``` -------------------------------- ### Start Dexto in Server Mode with Custom Port (Global Install) Source: https://github.com/truffle-ai/dexto/blob/main/docs/docs/mcp/dexto-as-mcp-server.md This command starts Dexto in server mode on a custom port (e.g., 8080) using an environment variable when Dexto is installed globally. This is useful for managing network traffic. ```bash API_PORT=8080 dexto --mode server ``` -------------------------------- ### Run Product Name Scout Agent Source: https://github.com/truffle-ai/dexto/blob/main/docs/docs/tutorials/product-name-scout-agent.md This command initiates the Product Name Scout Agent from the dexto project root. It automatically downloads and installs all necessary MCP servers for domain checking, web search, and advanced name analysis. ```bash dexto --agent agents/product-name-researcher/product-name-researcher.yml ``` -------------------------------- ### Run Dexto Product Name Research Agent Source: https://github.com/truffle-ai/dexto/blob/main/docs/docs/tutorials/product-name-scout-agent.md This command initiates the Dexto product name research agent from the project root. It specifies the configuration file for the agent. ```bash # From the project root dexto --agent agents/product-name-researcher/product-name-researcher.yml ``` -------------------------------- ### Example: Get Failed Connections Source: https://github.com/truffle-ai/dexto/blob/main/docs/api/mcp-manager.md Checks for and logs any failed connection error messages. ```typescript const errors = manager.getFailedConnections(); if (Object.keys(errors).length > 0) { console.log('Failed connections:', errors); } ``` -------------------------------- ### Install Dependencies (Yarn) Source: https://github.com/truffle-ai/dexto/blob/main/docs/README.md Installs project dependencies using Yarn. This is the first step before running any other commands. ```bash yarn ``` -------------------------------- ### Start Dexto Server with Debug Logging (npx) Source: https://github.com/truffle-ai/dexto/blob/main/docs/docs/guides/dexto-as-mcp-server.md This command starts Dexto in server mode using npx and enables debug logging. This is useful for troubleshooting when Dexto is not globally installed. ```bash npx dexto --mode server --debug ``` -------------------------------- ### Dexto MCPManager Complete Example Source: https://github.com/truffle-ai/dexto/blob/main/docs/api/mcp-manager.md A comprehensive example demonstrating the initialization of MCPManager, connecting to a filesystem server, executing a tool, listing available tools, and disconnecting. ```typescript import { MCPManager } from 'dexto'; const manager = new MCPManager(); // Connect to servers await manager.connectServer('filesystem', { type: 'stdio', command: 'npx', args: ['-y', '@modelcontextprotocol/server-filesystem', '.'] }); // Execute tools directly const result = await manager.executeTool('readFile', { path: './README.md' }); console.log('Read file result:', result); // Get all available tools const tools = await manager.getAllTools(); console.log('Available tools:', Object.keys(tools)); // Clean up await manager.disconnectAll(); ``` -------------------------------- ### Example Directory Structure Source: https://github.com/truffle-ai/dexto/blob/main/docs/docs/guides/configuring-dexto/systemPrompt.md Provides a visual representation of a typical project directory structure used with Truffle Dexto file contributors. ```markdown project/ ├── README.md ├── agents/ │ ├── support-agent.yml │ └── docs/ │ ├── guidelines.md │ └── policies.md └── shared/ └── common-instructions.md ``` -------------------------------- ### Start Dexto Server with Debug Logging (Global Install) Source: https://github.com/truffle-ai/dexto/blob/main/docs/docs/guides/dexto-as-mcp-server.md This command starts Dexto in server mode and enables debug logging. This is helpful for diagnosing issues when running Dexto as an MCP server. ```bash dexto --mode server --debug ``` -------------------------------- ### Start Dexto in Server Mode (npx) Source: https://github.com/truffle-ai/dexto/blob/main/docs/docs/guides/dexto-as-mcp-server.md This bash command starts the Dexto agent in server mode using npx, which is useful if Dexto is not installed globally. This enables it to act as an MCP server. ```bash npx dexto --mode server ``` -------------------------------- ### Run Talk2PDF Agent Source: https://github.com/truffle-ai/dexto/blob/main/docs/docs/tutorials/talk2pdf-agent.md This command initiates the Talk2PDF agent from the dexto project root. It automatically downloads and installs the necessary MCP server (`@truffle-ai/talk2pdf-mcp`) using `npx` on the first execution. ```bash # From the dexto project root dexto --agent agents/talk2pdf-agent/talk2pdf-agent.yml ``` -------------------------------- ### Build Dexto Docker Image Source: https://github.com/truffle-ai/dexto/blob/main/docs/docs/guides/deployment.md Builds the Docker image for Dexto. This is the first step in deploying Dexto using Docker. ```bash docker build -t dexto . ``` -------------------------------- ### Start Dexto in Server Mode with Debug Logging (npx) Source: https://github.com/truffle-ai/dexto/blob/main/docs/docs/mcp/dexto-as-mcp-server.md This command starts Dexto in server mode with debug logging enabled using npx. This is useful for diagnosing issues when Dexto is not globally installed. ```bash npx dexto --mode server --debug ``` -------------------------------- ### Image Editor Agent Project Structure Source: https://github.com/truffle-ai/dexto/blob/main/docs/docs/tutorials/image-editor-agent.md This outlines the basic file structure for the Image Editor Agent project. It includes the agent's configuration file (`image-editor-agent.yml`), a sample image for testing (`Lenna.webp`), and the main documentation file (`README.md`). ```Text agents/image-editor-agent/ ├── image-editor-agent.yml # Agent configuration ├── Lenna.webp # Sample image for testing └── README.md # Documentation ``` -------------------------------- ### Execute Multi-step Workflow: Read, Summarize, Save Source: https://github.com/truffle-ai/dexto/blob/main/examples/dexto-langchain-integration/README.md Illustrates a multi-step workflow where Dexto reads a file (README.md), summarizes its content using the LangChain agent, and saves the summary. ```bash dexto --agent ./examples/dexto-langchain-integration/dexto-agent-with-langchain.yml "Read README.md, summarize it, save the summary" ``` -------------------------------- ### Example: Get Clients Source: https://github.com/truffle-ai/dexto/blob/main/docs/api/mcp-manager.md Demonstrates retrieving all connected clients and logging their names and the number of available tools for each. ```typescript const clients = manager.getClients(); console.log('Connected servers:', Array.from(clients.keys())); for (const [name, client] of clients) { console.log(`Server: ${name}, Tools available: ${Object.keys(await client.getTools()).length}`); } ``` -------------------------------- ### Dexto Project Scaffolding Source: https://github.com/truffle-ai/dexto/blob/main/docs/how-to-dexto.md Commands for setting up new Dexto projects or integrating Dexto into existing TypeScript projects. These commands help in initializing the necessary project structure. ```bash dexto create-app ``` ```bash dexto init-app ``` -------------------------------- ### Start Dexto Music Agent Source: https://github.com/truffle-ai/dexto/blob/main/docs/docs/tutorials/music-agent.md This command initiates the Dexto music agent from the project root directory. It requires the path to the agent's configuration file. ```bash # From the project root dexto --agent agents/music-agent/music-agent.yml ``` -------------------------------- ### Start Dexto in Server Mode (npx) Source: https://github.com/truffle-ai/dexto/blob/main/docs/docs/mcp/dexto-as-mcp-server.md This bash command starts the Dexto agent in server mode using npx, which is useful if Dexto is not installed globally. It allows Dexto to listen for incoming MCP connections. ```bash npx dexto --mode server ``` -------------------------------- ### Start Dexto in MCP Mode with Debug Logging (npx) Source: https://github.com/truffle-ai/dexto/blob/main/docs/docs/mcp/dexto-as-mcp-server.md This bash command starts Dexto in MCP mode with debug logging enabled using npx. This is helpful for diagnosing MCP-related issues when Dexto is not globally installed. ```bash npx dexto --mode mcp --debug ``` -------------------------------- ### Start Local Development Server (Yarn) Source: https://github.com/truffle-ai/dexto/blob/main/docs/README.md Starts a local development server for Dexto. Changes are reflected live without server restarts. Opens the site in a browser. ```bash yarn start ``` -------------------------------- ### Run Music Creator Agent Source: https://github.com/truffle-ai/dexto/blob/main/docs/docs/tutorials/music-agent.md This command initiates the Music Creator Agent. It automatically downloads and installs the necessary MCP server (`truffle-ai-music-creator-mcp`) using `uvx` on the first execution. ```Bash # From the dexto project root dexto --agent agents/music-agent/music-agent.yml ``` -------------------------------- ### LLM Provider Setup and Switching (Bash) Source: https://github.com/truffle-ai/dexto/blob/main/README.md Demonstrates how to set environment variables for API keys for different LLM providers (OpenAI, Anthropic, Google) and how to use the Dexto CLI to switch between providers. ```bash # OpenAI (default) export OPENAI_API_KEY=your_openai_api_key_here export ANTHROPIC_API_KEY=your_anthropic_api_key_here export GOOGLE_GENERATIVE_AI_API_KEY=your_google_gemini_api_key_here dexto # Switch providers via CLI dexto -m claude-3.5-sonnet-20240620 dexto -m gemini-1.5-flash-latest ``` -------------------------------- ### File Path Resolution Examples Source: https://github.com/truffle-ai/dexto/blob/main/docs/docs/guides/configuring-dexto/systemPrompt.md Illustrates how file paths are resolved relative to the configuration file's location, including examples for relative, parent directory, and absolute paths. ```markdown If your config file is at `/project/agents/billing-agent.yml`: - `docs/policies.md` → `/project/agents/docs/policies.md` - `./README.md` → `/project/agents/README.md` - `../README.md` → `/project/README.md` (parent directory) - `/absolute/path/file.md` → `/absolute/path/file.md` (absolute paths unchanged) ``` -------------------------------- ### Start Dexto Server with Custom Port (Global Install) Source: https://github.com/truffle-ai/dexto/blob/main/docs/docs/guides/dexto-as-mcp-server.md This command starts Dexto in server mode and sets a custom API port (e.g., 8080) using an environment variable. This allows you to control the port Dexto listens on. ```bash API_PORT=8080 dexto --mode server ``` -------------------------------- ### Start Dexto Server for Network Access (Global Install) Source: https://github.com/truffle-ai/dexto/blob/main/docs/docs/guides/dexto-as-mcp-server.md This command starts Dexto in server mode and configures it to listen on a specific port (e.g., 3001) for network access. This allows other devices on the network to connect to the Dexto server. ```bash API_PORT=3001 dexto --mode server ``` -------------------------------- ### Example: Get Prompt Source: https://github.com/truffle-ai/dexto/blob/main/docs/api/mcp-manager.md Shows how to retrieve a 'code-review' prompt with specific arguments for language and file, then logs the prompt messages. ```typescript const prompt = await manager.getPrompt('code-review', { language: 'typescript', file: 'src/index.ts' }); console.log('Prompt:', prompt.messages); ``` -------------------------------- ### View all Dexto CLI options Source: https://github.com/truffle-ai/dexto/blob/main/docs/docs/guides/cli.md Displays all available options and flags for the Dexto CLI, providing a comprehensive overview of its functionalities. ```bash dexto -h ``` -------------------------------- ### TeamFlow API - JavaScript SDK Example Source: https://github.com/truffle-ai/dexto/blob/main/agents/triage-demo/docs/company-overview.md This snippet demonstrates how to use the TeamFlow API's JavaScript SDK to interact with the platform. It assumes the SDK is installed and configured with necessary authentication credentials. The example shows a basic request to fetch project data. ```javascript const TeamFlowAPI = require('teamflow-sdk'); const client = new TeamFlowAPI({ apiKey: 'YOUR_API_KEY', apiSecret: 'YOUR_API_SECRET' }); async function getProjects() { try { const projects = await client.projects.list(); console.log('Projects:', projects); } catch (error) { console.error('Error fetching projects:', error); } } getProjects(); ``` -------------------------------- ### Create Project Directory Source: https://github.com/truffle-ai/dexto/blob/main/docs/docs/getting-started/first-agent-tutorial.md This snippet shows the bash commands to create a new directory for your Dexto agent project and navigate into it. ```bash mkdir my-pirate-agent cd my-pirate-agent ``` -------------------------------- ### Launch interactive Dexto CLI Source: https://github.com/truffle-ai/dexto/blob/main/docs/docs/guides/cli.md Starts the Dexto CLI in interactive mode, allowing direct conversation with AI agents. ```bash dexto ``` -------------------------------- ### Create Project Structure (Bash) Source: https://github.com/truffle-ai/dexto/blob/main/docs/docs/tutorials/multi-agent-systems.md This snippet demonstrates the bash commands to create a new project directory and initialize configuration files for a multi-agent Dexto system. ```bash mkdir multi-agent-example cd multi-agent-example # Create config files for each agent touch researcher.yml writer.yml .env ```