#!/bin/bash # Kimi Workspace Bootstrap Script # Run this once to set up the Kimi agent workspace set -e echo "===============================================" echo " Kimi Agent Workspace Bootstrap" echo "===============================================" echo "" # Navigate to project root cd "$(dirname "$0")/../.." PROJECT_ROOT=$(pwd) echo "๐Ÿ“ Project Root: $PROJECT_ROOT" echo "" # Check Python version echo "๐Ÿ” Checking Python version..." python3 -c "import sys; exit(0 if sys.version_info >= (3,11) else 1)" || { echo "โŒ ERROR: Python 3.11+ required (found $(python3 --version))" exit 1 } echo "โœ… Python $(python3 --version)" echo "" # Check if virtual environment exists echo "๐Ÿ” Checking virtual environment..." if [ -d ".venv" ]; then echo "โœ… Virtual environment exists" else echo "โš ๏ธ Virtual environment not found. Creating..." python3 -m venv .venv echo "โœ… Virtual environment created" fi echo "" # Check dependencies echo "๐Ÿ” Checking dependencies..." if [ -f ".venv/bin/timmy" ]; then echo "โœ… Dependencies appear installed" else echo "โš ๏ธ Dependencies not installed. Running make install..." make install || { echo "โŒ Failed to install dependencies" echo " Try: poetry install --with dev" exit 1 } echo "โœ… Dependencies installed" fi echo "" # Check .env file echo "๐Ÿ” Checking environment configuration..." if [ -f ".env" ]; then echo "โœ… .env file exists" else echo "โš ๏ธ .env file not found. Creating from template..." cp .env.example .env echo "โœ… Created .env from template (edit as needed)" fi echo "" # Check Git configuration echo "๐Ÿ” Checking Git configuration..." git config --local user.name &>/dev/null || { echo "โš ๏ธ Git user.name not set. Setting..." git config --local user.name "Kimi Agent" } git config --local user.email &>/dev/null || { echo "โš ๏ธ Git user.email not set. Setting..." git config --local user.email "kimi@timmy.local" } echo "โœ… Git config: $(git config --local user.name) <$(git config --local user.email)>" echo "" # Run tests to verify setup echo "๐Ÿงช Running quick test verification..." if tox -e unit -- -q 2>/dev/null | grep -q "passed"; then echo "โœ… Tests passing" else echo "โš ๏ธ Test status unclear - run 'make test' manually" fi echo "" # Show current branch echo "๐ŸŒฟ Current Branch: $(git branch --show-current)" echo "" # Display summary echo "===============================================" echo " โœ… Bootstrap Complete!" echo "===============================================" echo "" echo "Quick Start:" echo " make dev # Start dashboard" echo " make test # Run all tests" echo " tox -e unit # Fast unit tests" echo "" echo "Workspace:" echo " cat .kimi/CHECKPOINT.md # Current state" echo " cat .kimi/TODO.md # Task list" echo " bash .kimi/scripts/resume.sh # Status check" echo "" echo "Happy coding! ๐Ÿš€"