Skip to main content

A Shadcn-style CLI for building composable AI agents with LangGraph. Fetch component templates directly from GitHub.

Project description

shadcn-agent

PyPI version Python versions License: MIT

The shadcn for AI Agents - A CLI tool that provides a collection of reusable, framework-native AI agent components with the same developer experience as shadcn/ui.

๐ŸŒŸ Features

  • ๐Ÿ“ฆ Fetch from GitHub: Components are fetched directly from our GitHub repository - no need to clone anything
  • ๐Ÿ”ง Atomic and Composable: Get individual agent "nodes" (e.g., web scraper, summarizer, translator) that combine into powerful workflows
  • ๐Ÿ•ธ๏ธ Built for LangGraph: Components use LangGraph's graph-based architecture for stateful, multi-step workflows
  • ๐Ÿ’ป Own Your Code: CLI copies component code into your project - full control to modify, extend, and debug
  • ๐Ÿš€ Zero Dependencies: No package lock-in once components are copied
  • ๐ŸŽฎ Interactive Playground: Test workflows with a web interface before deploying

๐Ÿš€ Quick Start

Installation

pip install shadcn-agent

1. Initialize Your Project

# Create a new directory for your AI project
mkdir my-ai-project
cd my-ai-project

# Initialize shadcn-agent structure
shadcn-agent init

This creates:

my-ai-project/
โ”œโ”€โ”€ components/
โ”‚   โ”œโ”€โ”€ nodes/        # Individual agent nodes
โ”‚   โ””โ”€โ”€ workflows/    # Multi-node workflows
โ””โ”€โ”€ .env             # Your configuration

2. Add Components You Need

# Add individual nodes
shadcn-agent add node search_node
shadcn-agent add node summarizer_node
shadcn-agent add node translate_node
shadcn-agent add node email_node

# Add pre-built workflows
shadcn-agent add workflow summarize_and_email_graph
shadcn-agent add workflow translate_and_email_graph

3. Configure Environment

Create a .env file with your credentials:

# Email configuration (for email workflows)
SENDER_EMAIL=your@gmail.com
SENDER_PASSWORD=your_app_password

# Default recipient for testing
DEFAULT_RECIPIENT=recipient@example.com

# Optional: Custom library folder
AGENTS_LIBRARY=components

4. Run Workflows

# Run workflows directly from CLI
shadcn-agent run workflow summarize_and_email_graph \
  --url "https://en.wikipedia.org/wiki/Large_language_model" \
  --recipient "your@email.com"

shadcn-agent run workflow translate_and_email_graph \
  --text "Hello, how are you?" \
  --target_lang "fr" \
  --recipient "your@email.com"

5. Interactive Playground

# Launch the web-based playground
shadcn-agent playground

Features:

  • ๐Ÿ–ฅ๏ธ Test workflows with a GUI
  • ๐Ÿ”ง Custom Workflow Builder: Drag-and-drop node combinations
  • ๐Ÿ’พ Download results as JSON
  • ๐Ÿ“Š Real-time execution monitoring

๐Ÿ“š Available Components

Nodes

Node Description Inputs Outputs
search_node Web scraper with BeautifulSoup url text, scraped_url
summarizer_node Extractive text summarizer text summary, word_count
translate_node Google Translate integration text, target_lang translation
email_node SMTP email sender body, recipient status

Workflows

Workflow Description Nodes Used
summarize_and_email_graph Scrapes โ†’ Summarizes โ†’ Emails search + summarizer + email
translate_and_email_graph Translates โ†’ Emails translate + email
scrape_and_summarize_graph Scrapes โ†’ Summarizes search + summarizer

๐Ÿ› ๏ธ CLI Commands

# Initialize project structure
shadcn-agent init [--dest folder_name] [--config]

# List available templates and your components
shadcn-agent list [--dest folder_name]

# Add components from GitHub
shadcn-agent add node <node_name> [--dest folder_name]
shadcn-agent add workflow <workflow_name> [--dest folder_name]

# Run workflows
shadcn-agent run workflow <workflow_name> [--dest folder_name] [args...]

# Launch interactive playground
shadcn-agent playground

๐Ÿ—๏ธ Custom Folder Structure

You can organize components in any folder structure:

# Use custom folder names
shadcn-agent init --dest my_agents
shadcn-agent add node search_node --dest my_agents
shadcn-agent run workflow summarize_and_email_graph --dest my_agents

๐Ÿ’ก The "Own Your Code" Philosophy

Unlike traditional packages, shadcn-agent copies component code into your project:

shadcn-agent add node search_node

This creates components/nodes/search_node.py in your project. You can:

  • โœ… Modify the code however you want
  • โœ… Debug with full visibility into execution
  • โœ… Add custom error handling and logging
  • โœ… Change APIs, prompts, or business logic
  • โœ… Version control your modifications
  • โœ… No dependency on shadcn-agent after copying

๐Ÿงฉ Framework Integration

All components are built for LangGraph, ensuring:

  • ๐Ÿ”„ Native state management between nodes
  • ๐Ÿ“Š Graph-based workflow orchestration
  • ๐Ÿ”— Easy composition and extension
  • ๐Ÿ›ก๏ธ Type-safe state passing
  • ๐Ÿ“ˆ Built-in monitoring and debugging

Example of a custom workflow:

from langgraph.graph import StateGraph, END
from components.nodes.search_node import search_node
from components.nodes.summarizer_node import summarizer_node

def build_custom_workflow():
    workflow = StateGraph(dict)
    workflow.add_node("search", search_node)
    workflow.add_node("summarizer", summarizer_node)
    
    workflow.set_entry_point("search")
    workflow.add_edge("search", "summarizer")
    workflow.add_edge("summarizer", END)
    
    return workflow.compile()

๐Ÿ”ง Email Configuration

For email workflows, you need to configure SMTP credentials:

Gmail Setup (Recommended)

  1. Enable 2-Factor Authentication on your Google account

  2. Generate an App Password:

    • Go to Google Account settings
    • Security โ†’ 2-Step Verification โ†’ App passwords
    • Generate password for "Mail"
  3. Add to your .env file:

SENDER_EMAIL=your@gmail.com
SENDER_PASSWORD=your_16_digit_app_password

Other Email Providers

The email node supports any SMTP server. Modify the email_node.py after copying to use different SMTP settings.


๐Ÿงช Development & Testing

Running Tests

# Install development dependencies
pip install -e .[dev]

# Run tests
pytest tests/ -v

# Run with coverage
pytest tests/ --cov=shadcn_agent --cov-report=html

Development Setup

# Clone repository
git clone https://github.com/Aryan-Bagale/shadcn-agents.git
cd shadcn-agents

# Install in development mode
pip install -e .[dev]

# Install pre-commit hooks
pre-commit install

# Run the playground locally
shadcn-agent playground

๐Ÿณ Docker Support

# Build and run with Docker
docker-compose up playground

# Development environment
docker-compose run dev bash

๐Ÿšจ Troubleshooting

Common Issues

"Import Error: Could not import workflow"

# Make sure all required nodes are added
shadcn-agent add node search_node
shadcn-agent add node summarizer_node
shadcn-agent add node email_node

"Email authentication failed"

  • Verify your Gmail App Password (not regular password)
  • Check that 2FA is enabled on your Google account
  • Ensure SENDER_EMAIL and SENDER_PASSWORD are in .env

"Library folder not found"

# Initialize the project first
shadcn-agent init --dest components

"Workflow validation failed"

# Check required parameters for each workflow:
shadcn-agent run workflow summarize_and_email_graph --url "https://example.com"
shadcn-agent run workflow translate_and_email_graph --text "Hello" --target_lang "fr"

Debug Mode

Enable detailed error messages:

DEBUG=true

Network Issues

If you're behind a corporate firewall:

# Use HTTP instead of HTTPS for GitHub (not recommended for production)
export GITHUB_REPO="http://raw.githubusercontent.com/Aryan-Bagale/shadcn-agents"

๐Ÿค Contributing

We welcome contributions! Here's how to get started:

Adding New Components

  1. Create templates in the templates/ directory
  2. Follow the LangGraph node/workflow patterns
  3. Add comprehensive error handling
  4. Include tests for your components
  5. Submit a pull request

Component Guidelines

  • Nodes: Should be pure functions that take and return state dictionaries
  • Error Handling: Always handle failures gracefully and return meaningful error messages
  • Documentation: Include docstrings and type hints
  • Testing: Add unit tests in the tests/ directory

Development Workflow

# Fork the repository
git fork https://github.com/Aryan-Bagale/shadcn-agents.git

# Create a feature branch
git checkout -b feature/new-component

# Make your changes
# ...

# Run tests
pytest tests/

# Format code
black shadcn_agent/
flake8 shadcn_agent/

# Commit and push
git commit -m "Add new component"
git push origin feature/new-component

# Create pull request

๐Ÿ“„ License

MIT License - see LICENSE file for details.


๐Ÿ”— Links


โญ Show Your Support

If shadcn-agent helps you build better AI workflows, please consider:

  • โญ Starring the repository
  • ๐Ÿ› Reporting bugs and feature requests
  • ๐Ÿ”ง Contributing new components
  • ๐Ÿ“ข Sharing with the community

Made with โค๏ธ by Aryan Bagale

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

shadcn_agent-0.2.0.tar.gz (21.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

shadcn_agent-0.2.0-py3-none-any.whl (15.8 kB view details)

Uploaded Python 3

File details

Details for the file shadcn_agent-0.2.0.tar.gz.

File metadata

  • Download URL: shadcn_agent-0.2.0.tar.gz
  • Upload date:
  • Size: 21.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.3

File hashes

Hashes for shadcn_agent-0.2.0.tar.gz
Algorithm Hash digest
SHA256 440807a3ea620e4eecacbd2124b58f210ec477a9555eec233581b2a84469b714
MD5 011fcec28f91b5c06d946474356de3eb
BLAKE2b-256 d4a352a2f267e82f01c441933771bdcac9e3ec9a94da81172de5a535b44418a5

See more details on using hashes here.

File details

Details for the file shadcn_agent-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: shadcn_agent-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 15.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.3

File hashes

Hashes for shadcn_agent-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 29c2d9e59e2c1ed1bc511b78c1942f5c5244e1eb0ec77873fd83aad4d014900e
MD5 798eb3d1308e994ee8844b541c89be2b
BLAKE2b-256 e9c3e8aef3e661abf627c20021271f458a13f91e62778876c3cb39cd4b4dd924

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page