Skip to main content

Python SDK for CrewDeck - AI agent management dashboard

Project description

CrewDeck Python SDK

Official Python SDK for CrewDeck — the AI agent management dashboard.

Manage your AI crew like a real team. Assign tasks, track progress, review outputs, approve results.

Installation

pip install crewdeck

Quick Start

from crewdeck import CrewDeck

# Initialize with your API key
deck = CrewDeck(api_key="your-api-key")

# Create a task
task = deck.tasks.create(
    title="Analyze Q4 sales data",
    description="Process and summarize the quarterly sales report",
    priority="high",
    assignees=["JARVIS"]
)

# Update agent status
deck.agents.set_working("JARVIS")

# Send progress updates
deck.events.message("Starting data analysis...", agent_name="JARVIS")

# Complete the task with output
deck.tasks.complete(task.id, output="Analysis complete. Revenue up 15% YoY.")

API Reference

Tasks

# Create a task
task = deck.tasks.create(
    title="Task title",
    description="Task description",
    status="INBOX",  # INBOX, ASSIGNED, IN PROGRESS, REVIEW, DONE
    priority="medium",  # low, medium, high, critical
    assignees=["JARVIS", "FRIDAY"],
    tags=["data", "analysis"]
)

# List tasks
tasks = deck.tasks.list()
tasks = deck.tasks.list(status="IN PROGRESS", limit=50)

# Update a task
deck.tasks.update(
    task_id="task-id",
    status="IN PROGRESS",
    output="Working on it..."
)

# Move task to a status
deck.tasks.move(task_id, "REVIEW")

# Complete a task
deck.tasks.complete(task_id, output="Done!")

Agents

# Create an agent
agent = deck.agents.create(
    name="JARVIS",
    avatar="🤖",
    role="AI Assistant",
    level="LEAD",  # standard, INT, LEAD, SPC
    status="idle"
)

# List agents
agents = deck.agents.list()

# Update agent status
deck.agents.update_status("JARVIS", "working")

# Convenience methods
deck.agents.set_working("JARVIS")
deck.agents.set_idle("JARVIS")
deck.agents.set_offline("JARVIS")

Events

# Send a message to the live feed
deck.events.message("Starting work...", agent_name="JARVIS")

# Send a log event
deck.events.log(
    message="Processing file",
    agent_name="JARVIS",
    metadata={"file": "data.csv", "rows": 1000}
)

# Send a custom event
deck.events.send(
    type="custom",
    agent_name="JARVIS",
    message="Custom event",
    metadata={"key": "value"}
)

Spawn & Complete (Recommended)

The easiest way to manage agent tasks — auto-creates tasks and updates status:

# Spawn a task for an agent
# Creates task, assigns to agent, sets status IN_PROGRESS, agent → working
task_id = deck.spawn(
    task="Build the landing page",
    agent="HAPPY",
    spawned_by="JARVIS"  # optional: who requested this
)

# ... agent does the work ...

# Mark complete
# Moves task to REVIEW, sets agent → idle
deck.complete(
    agent="HAPPY",
    task_id=task_id,
    output="Deployed to https://crewdeck.dev"
)

Or use the events API directly:

# Spawn via events
task_id = deck.events.spawn(
    task="Analyze user feedback",
    agent_name="FRIDAY",
    priority="high",
    tags=["research", "urgent"]
)

# Complete via events
deck.events.complete(
    agent_name="FRIDAY",
    task_id=task_id,
    output="Analysis complete: 85% positive sentiment"
)

Integration Examples

CrewAI

from crewai import Agent, Task, Crew
from crewdeck import CrewDeck

deck = CrewDeck(api_key="your-api-key")

# Sync CrewAI agent with CrewDeck
crewai_agent = Agent(
    role="Researcher",
    goal="Research topics",
    backstory="Expert researcher"
)

# Create corresponding agent in CrewDeck
deck.agents.create(
    name="Researcher",
    avatar="🔬",
    role="Research Agent",
    level="INT"
)

# When starting a task
def on_task_start(task):
    deck.agents.set_working("Researcher")
    deck.events.message(f"Starting: {task.description}", agent_name="Researcher")

# When task completes
def on_task_complete(task, output):
    deck.events.message(f"Completed: {task.description}", agent_name="Researcher")
    deck.agents.set_idle("Researcher")

LangChain

from langchain.callbacks.base import BaseCallbackHandler
from crewdeck import CrewDeck

class CrewDeckCallback(BaseCallbackHandler):
    def __init__(self, deck: CrewDeck, agent_name: str):
        self.deck = deck
        self.agent_name = agent_name
    
    def on_chain_start(self, serialized, inputs, **kwargs):
        self.deck.agents.set_working(self.agent_name)
        self.deck.events.message(f"Processing: {inputs}", agent_name=self.agent_name)
    
    def on_chain_end(self, outputs, **kwargs):
        self.deck.events.message(f"Result: {outputs}", agent_name=self.agent_name)
        self.deck.agents.set_idle(self.agent_name)

Context Manager

with CrewDeck(api_key="your-api-key") as deck:
    task = deck.tasks.create(title="My task")
    # Client automatically closes when done

Error Handling

from crewdeck import CrewDeck, AuthenticationError, APIError

try:
    deck = CrewDeck(api_key="invalid-key")
    deck.tasks.list()
except AuthenticationError:
    print("Invalid API key")
except APIError as e:
    print(f"API error: {e} (status: {e.status_code})")

Configuration

deck = CrewDeck(
    api_key="your-api-key",
    base_url="https://your-convex-deployment.convex.site",  # Custom deployment
    timeout=30.0  # Request timeout in seconds
)

License

MIT

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

crewdeck-0.2.0.tar.gz (7.9 kB view details)

Uploaded Source

Built Distribution

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

crewdeck-0.2.0-py3-none-any.whl (9.6 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for crewdeck-0.2.0.tar.gz
Algorithm Hash digest
SHA256 7ee0f40cdb0d41b076c2ed9587ded93e4743aa6ff9260c440325b19a54877650
MD5 ff0ac72e6c10ab7141f83f0980d8f634
BLAKE2b-256 3da88bdf074889ab8a25d784e4ebd07373aadfd072a95270bdc023f7a654bb93

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for crewdeck-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9f7f70fce15d38c232d29181a7e2e7d5dce9c57d920365481e7336d477c5397a
MD5 aff63076278c311ac10574f2ba821f11
BLAKE2b-256 a41bb00ce2269e5a9d9689a117fe50ab1aff2348a47f0c8e7cfa202000dc38ba

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