A CLI for data analysis that interacts with the Agent Runtimes via AG-UI and ACP protocols.
Code AI is an AI-powered CLI agent built on Pydantic AI that helps with code analysis, Jupyter notebooks, and data science workflows.
pip install codeaigit clone https://github.com/datalayer/codeai.git
cd codeai
pip install -e .curl -fsSL https://raw.githubusercontent.com/datalayer/codeai/main/install.sh | bashSpecial commands available in interactive mode:
/exit: Exit the session/markdown: Show the last response in markdown format/multiline: Toggle multiline input mode (use Ctrl+D to submit)/cp: Copy the last response to clipboard
You can launch CodeAI with a specific agent configuration using the --agent-id parameter:
codeai --agent-id codemode-paper/financial-vizAvailable agent IDs can be found in the agentspecs repository. Each agent is optimized for specific tasks and comes with pre-configured tools and capabilities.
Important: Before launching an agent, make sure to set the required environment variables for its MCP servers and skills. Check the agent's configuration in the agentspecs repository to see which MCP servers and skills it uses, then refer to:
You can customize the agent by importing and modifying it:
from codeai.cli import agent
# Add custom tools or modify behavior
@agent.tool()
def my_custom_tool(data: str) -> str:
"""Custom tool description"""
return f"Processed: {data}"
# Run the CLI with customizations
agent.to_cli_sync()- Data Analysis: Get help with code review, debugging, and optimization
- Jupyter Notebooks: Assistance with notebook workflows and data exploration
- Data Science: Support for pandas, numpy, scikit-learn, and other libraries
- Interactive Chat: Conversational interface for iterative problem-solving
- Animated Loading: Beautiful spinner animation while processing queries
- Powered by Pydantic AI: Built on the robust Pydantic AI framework
Install development dependencies:
pip install -e ".[test,lint,typing]"Run tests:
pytestBSD 3-Clause License - see LICENSE for details.
