Justfile Reference#
The justfile is the divine command center for the MCP OAuth Gateway project, following the sacred commandments of CLAUDE.md. All commands flow through just
as decreed by the Holy Trinity of Tools.
Justfile Configuration#
The justfile uses these sacred settings:
set dotenv-load := true # Load .env automatically
set dotenv-required # Die if .env is missing
set positional-arguments := true # Enable blessed argument passing
set allow-duplicate-recipes # Allow recipe overloading
set export := true # Export all variables as environment
set quiet # Silence the incantations
Command Categories#
π§ͺ Testing Commands#
All testing follows the divine commandment: No Mocks or Burn in Production Hell!
Command |
Description |
Example |
---|---|---|
|
Universal test runner with flexible arguments |
|
|
Run tests in parallel using all CPU cores |
|
|
Run tests with specific worker count |
|
|
Parallel tests with worksteal distribution |
|
|
Keep tests in same file together |
|
|
Keep tests in same class together |
|
|
Run only serial tests (marked with @pytest.mark.serial) |
|
|
Run parallel tests excluding serial ones |
|
|
Production container coverage testing |
|
π³ Docker Operations#
Service orchestration through docker-compose as mandated by the commandments.
Command |
Description |
Example |
---|---|---|
|
Build services (all or specific) |
|
|
Start services with health checks |
|
|
Fresh build and start |
|
|
Stop services |
|
|
Rebuild from scratch (no-cache) |
|
|
Remove orphan containers |
|
|
View logs flexibly |
|
|
Execute commands in containers |
|
π Logging Management#
Centralized logging as decreed: Scattered logs = lost wisdom!
Command |
Description |
Example |
---|---|---|
|
View file-based logs |
|
|
Show log statistics |
|
|
Clean logs (with safety prompt) |
|
|
Force clean without prompt |
|
|
Manually rotate logs |
|
|
Setup log rotation (requires sudo) |
|
|
Purge all container logs |
|
|
Test logging configuration |
|
π OAuth Management#
Complete OAuth lifecycle management following RFC 7591/7592.
Command |
Description |
Example |
---|---|---|
|
Show all client registrations |
|
|
Show all active tokens |
|
|
Delete specific client |
|
|
Delete client and all data |
|
|
Show OAuth statistics |
|
|
Display all OAuth data |
|
|
Remove expired tokens |
|
|
Backup OAuth data |
|
|
Restore from latest backup |
|
π Token & Secret Generation#
Sacred token generation following divine security practices.
Command |
Description |
Example |
---|---|---|
|
Generate JWT secret to .env |
|
|
Generate RS256 signing keys |
|
|
Generate Redis password |
|
|
Generate all required secrets |
|
|
OAuth flow for GitHub token |
|
|
Generate MCP client token |
|
|
Refresh OAuth tokens |
|
|
Validate all tokens |
|
π§Ή Code Quality#
Following the divine linting commandments.
Command |
Description |
Example |
---|---|---|
|
Run all quality checks |
|
|
Quick ruff check only |
|
|
Auto-fix linting issues |
|
|
Format code |
|
|
Check formatting |
|
|
Hunt Pydantic deprecations |
|
|
Full lint, format, deprecations |
|
π₯ Health & Monitoring#
Real health checks following: sleep = random production failures!
Command |
Description |
Example |
---|---|---|
|
Complete health check (3 steps) |
|
|
Check environment tokens |
|
|
Check Docker services |
|
|
Quick endpoint check |
|
|
Show service status |
|
|
Verify SSL certificates |
|
|
Test MCP hostname connectivity |
|
π Documentation#
Documentation with Jupyter Book as commanded.
Command |
Description |
Example |
---|---|---|
|
Build Jupyter Book docs |
|
π οΈ Utility Commands#
Essential utilities for development workflow.
Command |
Description |
Example |
---|---|---|
|
Universal script runner |
|
|
Verify services before operations |
Called automatically |
|
Create docker network |
Called by build/up |
|
Create required volumes |
Called by build/up |
|
Generate compose includes |
Called by build/up |
|
Generate Traefik config |
Called by build/up |
|
Initial project setup |
|
π§ͺ Test Utilities#
Specialized testing and debugging commands.
Command |
Description |
Example |
---|---|---|
|
Show test registrations |
|
|
Clean test data |
|
|
Diagnose test failures |
|
|
Debug coverage setup |
|
π¦ PyPI Package Management#
Commands for managing Python packages.
Command |
Description |
Example |
---|---|---|
|
Build Python packages |
|
|
Test Python packages |
|
Command Aliases#
Quick shortcuts for common operations:
Alias |
Full Command |
---|---|
|
|
|
|
|
|
|
|
|
|
Sacred Patterns#
Flexible Arguments with Positional Parameters#
# Test with any pytest arguments
just test -k "oauth" -v -s --pdb
# Build specific services
just build auth mcp-fetch
# Follow logs for specific service
just logs -f auth
Universal Script Runner#
# Run any script from scripts/ directory
just run analyze_oauth_logs
just run check_services_ready
just run generate_coverage_report
Service Operations#
# Execute commands in containers
just exec redis redis-cli
just exec auth python manage.py shell
# Rebuild specific services
just rebuild auth mcp-fetch
Environment Requirements#
The justfile requires:
.env
file present (enforced byset dotenv-required
)Pixi installed and configured
Docker and docker-compose available
Python environment via pixi
The Divine Flow#
A typical development workflow:
# Initial setup
just setup
just generate-all-secrets
# Development cycle
just up
just test
just logs -f auth
# OAuth management
just oauth-stats
just generate-github-token
# Cleanup
just down
just test-cleanup
Remember: If youβre not typing βjustβ, youβre typing BLASPHEMY!