Justfile Quick Reference

This project uses just for task automation. Think of it as a modern, improved version of make.

Installation

# macOS
brew install just
 
# Linux
cargo install just
 
# Or download from https://github.com/casey/just/releases

Quick Start

# List all available commands
just --list
just
 
# Run a command
just build
just test
just dev

Common Workflows

Development

just dev           # Start development server with hot reload
just build         # Build TypeScript
just test          # Run tests
just check         # Run all code quality checks

Before Committing

just pre-commit    # Runs: check + test + build

Before Pushing

just pre-push      # Runs: check + test:coverage + build + docker-build

Docker Development

just docker-build        # Build Docker image
just docker-run          # Run in container
just docker-run-gpu      # Run with GPU support
just docker-shell        # Interactive shell

Production Deployment

sudo just install        # Install as systemd service
just service-start       # Start the service
just service-status      # Check status
just service-logs        # View logs

Maintenance

sudo just update         # Update to latest version
sudo just rollback       # Rollback to previous version
just health             # Check health endpoint
just metrics            # View Prometheus metrics

All Commands by Category

Build Commands

CommandDescription
just buildCompile TypeScript
just cleanRemove build artifacts
just rebuildClean and rebuild
just docs-buildBuild documentation index

Test Commands

CommandDescription
just testRun all tests
just test-watchWatch mode testing
just test-coverageCoverage reports
just test-integrationIntegration tests only
just test-mockTests with mocked hardware
just test-benchmarkPerformance benchmarks

Development

CommandDescription
just devHot-reload development server
just startProduction server

Code Quality

CommandDescription
just lintRun ESLint
just lint-fixAuto-fix linting issues
just formatFormat code with Prettier
just format-checkCheck formatting
just typecheckTypeScript type checking
just checkRun all checks

Docker

CommandDescription
just docker-buildBuild Docker image
just docker-runRun container
just docker-run-gpuRun with GPU support
just docker-stopStop container
just docker-cleanRemove image
just docker-shellInteractive shell

Deployment

CommandDescription
just installInstall systemd service
just updateUpdate to latest version
just rollbackRollback to previous version
just service-startStart service
just service-stopStop service
just service-restartRestart service
just service-statusView service status
just service-logsFollow service logs
just service-enableEnable on boot
just service-disableDisable on boot

Monitoring

CommandDescription
just healthCheck health endpoint
just metricsFetch Prometheus metrics
just logsTail application logs
just logs-errorTail error logs

Utilities

CommandDescription
just validate-configValidate configuration
just docs-search <query>Search documentation
just hardware-reportGenerate hardware report
just test-sparkTest Spark intelligence
just depsInstall dependencies
just deps-updateUpdate dependencies
just deps-outdatedCheck outdated deps
just deps-auditSecurity audit
just deps-audit-fixFix vulnerabilities

Releases

CommandDescription
just release-patchCreate patch release
just release-minorCreate minor release
just release-majorCreate major release

CI/CD

CommandDescription
just ci-testRun CI tests locally
just ci-buildRun build workflow locally
just ci-verifyVerify all workflows

Complete Workflows

CommandDescription
just pre-commitFull pre-commit check
just pre-pushFull pre-push check
just pre-releaseRelease preparation

Examples

Typical Development Session

# Start development server
just dev
 
# In another terminal, run tests in watch mode
just test-watch
 
# Make changes, then check before committing
just pre-commit
 
# If all passes, commit and push
git add .
git commit -m "feat: add new feature"
just pre-push
git push

Production Deployment

# First-time installation
sudo just install
 
# Check if running
just service-status
 
# View real-time logs
just service-logs
 
# Update to new version
sudo just update
 
# If issues occur
sudo just rollback

Docker Workflow

# Build image
just docker-build
 
# Test locally
just docker-run
 
# Enter container for debugging
just docker-shell
 
# With GPU support (requires nvidia-docker)
just docker-run-gpu

Monitoring

# Check if service is healthy
just health
 
# View Prometheus metrics
just metrics
 
# Check application logs
just logs
 
# Check error logs only
just logs-error

Tips

  1. Tab Completion: Many shells support tab completion for just commands
  2. Help: Run just or just --list to see all commands
  3. Chaining: You can chain commands: just clean build test
  4. Dry Run: Use just --dry-run <command> to see what would be executed
  5. Verbose: Use just --verbose <command> to see command output

Why Just?

  • Simpler than Make: No weird syntax quirks
  • Cross-platform: Works on Linux, macOS, Windows
  • Fast: Written in Rust
  • Developer-friendly: Better error messages
  • Modern: Built for today’s development workflows

Getting Started

If you’re new to the project, run these commands in order:

# 1. Install dependencies
just deps
 
# 2. Build the project
just build
 
# 3. Run tests to verify everything works
just test
 
# 4. Start development server
just dev

Advanced Usage

Custom Commands with Parameters

# Search documentation
just docs-search "GPU optimization"
 
# You can add your own commands in the justfile!

Environment Variables

# Run tests with mocked hardware
MOCK_HARDWARE=true just test
 
# Or use the shortcut
just test-mock

Troubleshooting

”just: command not found”

Install just using the instructions at the top of this document.

”Permission denied”

Some commands require sudo:

sudo just install
sudo just update
sudo just rollback

“Service commands not working”

Make sure the service is installed:

sudo just install

More Information

  • Just Documentation: https://just.systems/
  • Project Documentation: See /home/beengud/raibid-labs/dgx-spark-mcp/docs/
  • DevOps Guide: See WS6-DEVOPS-COMPLETION-REPORT.md

Quick tip: Add alias j=just to your shell rc file for even faster commands!