#!/bin/bash
# Claude PM Framework - atd wrapper (Python version)
# Generated by deployment script v1.4.6

# Get the directory where this script is located
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
PROJECT_DIR="$(dirname "$SCRIPT_DIR")"

# Check if virtual environment exists and activate it
if [ -f "$PROJECT_DIR/venv/bin/activate" ]; then
    source "$PROJECT_DIR/venv/bin/activate"
elif [ -f "$PROJECT_DIR/.venv/bin/activate" ]; then
    source "$PROJECT_DIR/.venv/bin/activate"
elif [ -f "$HOME/.claude-pm/venv/bin/activate" ]; then
    source "$HOME/.claude-pm/venv/bin/activate"
fi

# Run the Python CLI command
# First try with python3, fallback to python if that fails
if command -v python3 >/dev/null 2>&1; then
    python3 -m ai_trackdown_pytools.cli "$@"
else
    python -m ai_trackdown_pytools.cli "$@"
fi
