Skip to content

✨ Code AI - A CLI for data analysis that interacts with the Agent Runtimes via AG-UI and ACP protocols.

License

Notifications You must be signed in to change notification settings

datalayer/codeai

Repository files navigation

Datalayer

Become a Sponsor

✨ CodeAI

PyPI - Version

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.

Installation

Via pip

pip install codeai

From Source

git clone https://github.com/datalayer/codeai.git
cd codeai
pip install -e .

Quick Install (Recommended)

curl -fsSL https://raw.githubusercontent.com/datalayer/codeai/main/install.sh | bash

Usage

Special 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

Launch with Preconfigured Agent

You can launch CodeAI with a specific agent configuration using the --agent-id parameter:

codeai --agent-id codemode-paper/financial-viz

Available 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:

Custom Agent

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()

Features

  • 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

Development

Install development dependencies:

pip install -e ".[test,lint,typing]"

Run tests:

pytest

License

BSD 3-Clause License - see LICENSE for details.

About

✨ Code AI - A CLI for data analysis that interacts with the Agent Runtimes via AG-UI and ACP protocols.

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project

 

Contributors 2

  •  
  •