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"}
)
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
Release history Release notifications | RSS feed
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.1.0.tar.gz
(6.8 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file crewdeck-0.1.0.tar.gz.
File metadata
- Download URL: crewdeck-0.1.0.tar.gz
- Upload date:
- Size: 6.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a9e9a8fb7daf7e7f3e705c5e7c57e59a2e7ad5e89c21bec5ae5c987172623bed
|
|
| MD5 |
5e61c9093732042c447ccd82d475b700
|
|
| BLAKE2b-256 |
b14f185d7963d12c3f38d25796c089bccf184062e0454e3062fdfeb0eabf9e2f
|
File details
Details for the file crewdeck-0.1.0-py3-none-any.whl.
File metadata
- Download URL: crewdeck-0.1.0-py3-none-any.whl
- Upload date:
- Size: 8.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c466a47299921ec18370663d727e088fc8e2afa5917e50ca7edb3b2c766609d1
|
|
| MD5 |
f631ed6f3bf74ad4c1ba718ed981ddbb
|
|
| BLAKE2b-256 |
dab5ed930284714d49109f6840d917a267e26fcba40edd5dbfeae9df6a289216
|