# Basic Memory - Modern Command Runner # Install dependencies install: pip install -e ".[dev]" # Run unit tests in parallel test-unit: uv run pytest -p pytest_mock -v -n auto # Run integration tests in parallel test-int: uv run pytest -p pytest_mock -v --no-cov -n auto test-int # Run all tests test: test-unit test-int # Lint and fix code lint: ruff check . --fix # Type check code type-check: 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 type-check 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" # Build DXT package with bundled virtual environment dxt: #!/usr/bin/env bash echo "๐Ÿ—๏ธ Building DXT package..." # Clean and create bundle directory rm -rf dxt-bundle mkdir -p dxt-bundle/server/lib dxt-bundle/src # Bundle dependencies to server/lib (like Anthropic example) echo "๐Ÿ“ฆ Bundling Python dependencies..." uv pip install -e . --target dxt-bundle/server/lib --force-reinstall # Copy source code echo "๐Ÿ“„ Copying source code..." cp -r src/basic_memory dxt-bundle/src/ # Copy manifest cp manifest.json dxt-bundle/ # Copy assets (icons, screenshots) echo "๐Ÿ–ผ๏ธ Copying assets..." mkdir -p dxt-bundle/images cp images/disk-ai-logo-black-fg-white-bg.png dxt-bundle/images/ cp images/claude-*.png dxt-bundle/images/ # Create DXT package echo "๐Ÿ“ฆ Creating DXT package..." cd dxt-bundle && dxt pack . ../basic-memory.dxt echo "โœ… DXT package created: basic-memory.dxt" echo "๐Ÿ” Info: dxt info basic-memory.dxt" echo "๐Ÿงช Test: Install in Claude Desktop" # List all available recipes default: @just --list