# Basic Memory - Modern Command Runner # Install dependencies install: uv pip install -e ".[dev]" uv sync @echo "" @echo "๐Ÿ’ก Remember to activate the virtual environment by running: source .venv/bin/activate" # Run unit tests only (fast, no coverage) test-unit: uv run pytest -p pytest_mock -v --no-cov -n auto tests # Run integration tests only (fast, no coverage) test-int: uv run pytest -p pytest_mock -v --no-cov -n auto test-int # Run all tests with unified coverage report test: test-unit test-int # Generate HTML coverage report coverage: uv run pytest -p pytest_mock -v -n auto tests test-int --cov-report=html @echo "Coverage report generated in htmlcov/index.html" # Lint and fix code (calls fix) lint: fix # Lint and fix code fix: uv run ruff check --fix --unsafe-fixes src tests test-int # Type check code typecheck: uv run pyright # Clean build artifacts and cache files clean: find . -type f -name '*.pyc' -delete find . -type d -name '__pycache__' -exec rm -r {} + rm -rf installer/build/ installer/dist/ dist/ rm -f rw.*.dmg .coverage.* # Format code with ruff format: uv run ruff format . # Run MCP inspector tool run-inspector: npx @modelcontextprotocol/inspector # Build macOS installer installer-mac: cd installer && chmod +x make_icons.sh && ./make_icons.sh cd installer && uv run python setup.py bdist_mac # Build Windows installer installer-win: cd installer && uv run python setup.py bdist_win32 # Update all dependencies to latest versions update-deps: uv sync --upgrade # Run all code quality checks and tests check: lint format typecheck test # Generate Alembic migration with descriptive message migration message: cd src/basic_memory/alembic && alembic revision --autogenerate -m "{{message}}" # Create a stable release (e.g., just release v0.13.2) release version: #!/usr/bin/env bash set -euo pipefail # Validate version format if [[ ! "{{version}}" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then echo "โŒ Invalid version format. Use: v0.13.2" exit 1 fi # Extract version number without 'v' prefix VERSION_NUM=$(echo "{{version}}" | sed 's/^v//') echo "๐Ÿš€ Creating stable release {{version}}" # Pre-flight checks echo "๐Ÿ“‹ Running pre-flight checks..." if [[ -n $(git status --porcelain) ]]; then echo "โŒ Uncommitted changes found. Please commit or stash them first." exit 1 fi if [[ $(git branch --show-current) != "main" ]]; then echo "โŒ Not on main branch. Switch to main first." exit 1 fi # Check if tag already exists if git tag -l "{{version}}" | grep -q "{{version}}"; then echo "โŒ Tag {{version}} already exists" exit 1 fi # Run quality checks echo "๐Ÿ” Running quality checks..." just check # Update version in __init__.py echo "๐Ÿ“ Updating version in __init__.py..." sed -i.bak "s/__version__ = \".*\"/__version__ = \"$VERSION_NUM\"/" src/basic_memory/__init__.py rm -f src/basic_memory/__init__.py.bak # Commit version update git add src/basic_memory/__init__.py git commit -m "chore: update version to $VERSION_NUM for {{version}} release" # Create and push tag echo "๐Ÿท๏ธ Creating tag {{version}}..." git tag "{{version}}" echo "๐Ÿ“ค Pushing to GitHub..." git push origin main git push origin "{{version}}" echo "โœ… Release {{version}} created successfully!" echo "๐Ÿ“ฆ GitHub Actions will build and publish to PyPI" echo "๐Ÿ”— Monitor at: https://github.com/basicmachines-co/basic-memory/actions" # Create a beta release (e.g., just beta v0.13.2b1) beta version: #!/usr/bin/env bash set -euo pipefail # Validate version format (allow beta/rc suffixes) if [[ ! "{{version}}" =~ ^v[0-9]+\.[0-9]+\.[0-9]+(b[0-9]+|rc[0-9]+)$ ]]; then echo "โŒ Invalid beta version format. Use: v0.13.2b1 or v0.13.2rc1" exit 1 fi # Extract version number without 'v' prefix VERSION_NUM=$(echo "{{version}}" | sed 's/^v//') echo "๐Ÿงช Creating beta release {{version}}" # Pre-flight checks echo "๐Ÿ“‹ Running pre-flight checks..." if [[ -n $(git status --porcelain) ]]; then echo "โŒ Uncommitted changes found. Please commit or stash them first." exit 1 fi if [[ $(git branch --show-current) != "main" ]]; then echo "โŒ Not on main branch. Switch to main first." exit 1 fi # Check if tag already exists if git tag -l "{{version}}" | grep -q "{{version}}"; then echo "โŒ Tag {{version}} already exists" exit 1 fi # Run quality checks echo "๐Ÿ” Running quality checks..." just check # Update version in __init__.py echo "๐Ÿ“ Updating version in __init__.py..." sed -i.bak "s/__version__ = \".*\"/__version__ = \"$VERSION_NUM\"/" src/basic_memory/__init__.py rm -f src/basic_memory/__init__.py.bak # Commit version update git add src/basic_memory/__init__.py git commit -m "chore: update version to $VERSION_NUM for {{version}} beta release" # Create and push tag echo "๐Ÿท๏ธ Creating tag {{version}}..." git tag "{{version}}" echo "๐Ÿ“ค Pushing to GitHub..." git push origin main git push origin "{{version}}" echo "โœ… Beta release {{version}} created successfully!" echo "๐Ÿ“ฆ GitHub Actions will build and publish to PyPI as pre-release" echo "๐Ÿ”— Monitor at: https://github.com/basicmachines-co/basic-memory/actions" echo "๐Ÿ“ฅ Install with: uv tool install basic-memory --pre" # List all available recipes default: @just --list