Overview
This guide covers common CLI workflows for day-to-day MeshAgent development. If you haven’t set up MeshAgent yet, start with the Getting Started Guide first. This will walk you through creating a MeshAgent account, installing MeshAgent, and running your first agent from the CLI. The MeshAgent CLI streamlines Room interactions and agent management right from your terminal. With the MeshAgent CLI you can easily:- Authenticate and activate projects
- Spin up live rooms and test your in progress agents and tools
- Deploy services to your project or room
- Inspect and manage existing projects, secrets, agents, and services
Before you begin
- Set up MeshAgent: If you haven’t installed MeshAgent yet, follow our Getting Started guide. This will walk you through how to set up your MeshAgent account, create your first project, install MeshAgent, and connect to your first room with your first agent.
-
Install the MeshAgent CLI: You can install the CLI globally on your system or in a virtual environment.
To install the CLI globally:
To install the CLI in a virtual environment: Ensure you are in the appropriate project folder and have activated your virtual environment. (The virtual environment is active when the terminal prompt starts with
venv.) If you need help with your machine setup check out our Machine Setup Guide for Python. Then you can install all the MeshAgent packages, or exclusively the MeshAgent CLI. -
Authenticate: Once the CLI is installed, authenticate and activate a project.
Optional: Alternatively, instead of running the
meshagent setupcommand you can run:You are now authenticated and ready to use the CLI!
Common Workflows
Test Agents Locally
Before deploying, test your agent locally in a room:Using CLI agents (no code required)
The MeshAgent CLI provides prebuilt ChatBot and VoiceBot agents you can test instantly:testroom, and start chatting with your agents.
Tip: Use--helpto see all available tools and options:meshagent chatbot join --help. The CLI ChatBot has built in tools you can turn on and off for things like image generation, web search, local shell, and mcp.
Note:chatbot join/voicebot joinare designed for local/dev usage. In containers or deployments, preferchatbot service/voicebot service.
Run your own MeshAgent service locally
The CLI based agents expose many tools and functionality already, we recommend using these for most use cases. When you need additional custom functionality you can extend the base agent classes, for example theChatBot. To run a custom agent or tool locally and deploy it, expose it via ServiceHost (local webhook server). A request from MeshAgent spins up your agent or tool, connects it to the Room, and manages it’s lifecycle for the session.
For example, create a file called my_agent.py:
bash
testroom, and start chatting with your agent. You can iterate on the code and restart the service to test your changes (run Ctrl+C to stop the agent then rerun the meshagent service run command). The agent will only exist for the current session unless deployed.
Package and Deploy Services
Once your agent works locally, you’ll need to package and deploy it as a project or room service. You can do this from MeshAgent Studio or using the CLI. For example, let’s deploy a CLI based chatbot with the web search tool, image generation tool, and storage tool. First copy thismeshagent.yaml file.
bash
Manage Projects and Rooms
Switch projects:Work with Secrets
Secrets allow you to store credentials securely for agents and services to use: When deploying a custom agent, you will need to build and push a docker image. For an example of this, check out Deploying a Custom ChatBot to see how to build and deploy a chat agent as a project or room service. If your docker image is not public, then you will need to configure a secret so that the image can be pulled.Logout
Rooms will spin down automatically after you leave and they are inactive. If you wish to logout you can run:Frequently used commands
Note you will need to fill in the appropriate parameters for these commands| Command | What it does |
|---|---|
meshagent setup | Authenticate to MeshAgent and activate a project |
meshagent room agents list-toolkits | List toolkits (including TaskRunner tool wrappers) available in a room |
meshagent chatbot join --room=myroom --agent-name=chatbot | Join a room with the built-in chatbot |
meshagent voicebot join --room=myroom --agent-name=voicebot | Join a room with the built-in voicebot |
meshagent service run "main.py" --room=myroom | Test a service locally |
meshagent service create --file=meshagent.yaml | Deploy an agent as a managed service |
meshagent service list | View deployed project services |
Next Steps
- ChatBot: Tutorial on creating and customizing a MeshAgent ChatBot
- Introduction to Services: Understand project and room services and how to run ad-hoc code in a Room through the Containers API
- Packaging Services: Learn about meshagent.yaml configuration
- Deploying Services: Learn how to deploy project and room services
- CLI Commands Reference: Complete CLI command documentation
- Secrets Management: Working with credentials and OAuth