Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

DevHub

Multi-project development environment manager - Start, stop, and monitor all your local development services from one place.

The Problem

Working on multiple projects means juggling multiple terminals:

# Project A
cd ~/work/project-a && npm run dev        # Terminal 1
cd ~/work/project-a && cargo run          # Terminal 2

# Project B
cd ~/work/project-b && docker compose up  # Terminal 3
cd ~/work/project-b && npm start          # Terminal 4

# Which ports? Which commands? Where's that README again?

The Solution

devhub start project-a    # Starts all services
devhub start project-b    # Starts all services
devhub status             # See everything at a glance

# Or open http://devhub.localhost for the dashboard

Key Features

  • One command to rule them all - devhub start launches your entire stack
  • Bulk discovery - Scan directories and register 100+ projects at once
  • Web dashboard - Visual status, start/stop buttons, real-time updates
  • Auto-discovery - Detects Rust, Node, Python, Go, Docker, Flutter projects
  • Port conflict detection - Know before you crash
  • PM2 integration - Node.js services managed properly
  • Docker Compose support - First-class container orchestration
  • Health checks - Wait for services to be truly ready
  • Reverse proxy integration - Pretty URLs like http://myproject.localhost
  • Shell completions - Tab completion for bash, zsh, and fish
  • Developer shortcuts - devhub code, devhub open, devhub path
  • Zero lock-in - Simple TOML config, works with any stack

Architecture

┌─────────────────────────────────────────────────────────────────────┐
│                        DevHub Dashboard (SvelteKit)                 │
│                    http://devhub.localhost:5173                     │
│  Features: Project grid, Start/Stop buttons, Search, Status polling │
└─────────────────────────────────────────────────────────────────────┘
                              │ HTTP (proxied)
┌─────────────────────────────┴───────────────────────────────────────┐
│                      DevHub Daemon (Rust/Axum)                      │
│                    http://localhost:9876                            │
│   - REST API (/api/projects, /api/projects/:name/start, etc.)       │
│   - Registry management (~/.devhub/registry.json)                   │
│   - Process spawning (native + PM2 for Node)                        │
│   - Docker Compose integration                                      │
│   - Health check polling                                            │
│   - Caddy config generation                                         │
└─────────────────────────────────────────────────────────────────────┘
                              │
┌─────────────────────────────┴───────────────────────────────────────┐
│                      Caddy Reverse Proxy (Docker)                   │
│   http://project.localhost → localhost:PORT                         │
└─────────────────────────────────────────────────────────────────────┘

“Stop remembering. Start building.”

Installation

There are several ways to install DevHub.

curl -fsSL https://raw.githubusercontent.com/moinsen-dev/devhub/main/install/install.sh | bash

This will:

  • Detect your OS and architecture
  • Download the latest release
  • Install to ~/.local/bin
  • Provide instructions for shell completions

Homebrew (macOS)

brew tap moinsen-dev/tap
brew install devhub

Cargo (From Source)

If you have Rust installed:

cargo install devhub

Or build from source:

git clone https://github.com/moinsen-dev/devhub.git
cd devhub
cargo build --release
cp target/release/devhub ~/.local/bin/

Pre-built Binaries

Download from GitHub Releases:

PlatformDownload
macOS (Apple Silicon)devhub-aarch64-apple-darwin.tar.gz
macOS (Intel)devhub-x86_64-apple-darwin.tar.gz
Linux (x64)devhub-x86_64-unknown-linux-gnu.tar.gz
Linux (ARM64)devhub-aarch64-unknown-linux-gnu.tar.gz

Verify Installation

devhub --version
# devhub 0.1.0

devhub --help
# Shows all available commands

Shell Completions

For the best experience, install shell completions:

Zsh (macOS default)

# Create completions directory if needed
mkdir -p ~/.zfunc

# Generate completions
devhub completions zsh > ~/.zfunc/_devhub

# Add to ~/.zshrc if not already there
echo 'fpath=(~/.zfunc $fpath)' >> ~/.zshrc
echo 'autoload -Uz compinit && compinit' >> ~/.zshrc

# Reload shell
source ~/.zshrc

Bash

mkdir -p ~/.local/share/bash-completion/completions
devhub completions bash > ~/.local/share/bash-completion/completions/devhub

Fish

devhub completions fish > ~/.config/fish/completions/devhub.fish

Next Steps

Quick Start Guide

Get DevHub running in under 5 minutes.

Step 1: Discover Your Projects

DevHub can automatically scan your directories and find projects:

# Preview what would be discovered (dry run)
devhub scan --dry-run ~/work

# Example output:
# Scanning for projects...
#   → Scanning /Users/you/work...
#
# Scan Results:
#   Rust (23):
#     • my-api - api:8080
#     • cli-tool - no services
#   Node (45):
#     • frontend - web:3000
#     • dashboard - dev:5173
#   Docker (12):
#     • postgres-stack - postgres:5432

Happy with what you see? Register them all:

devhub scan --auto-register ~/work

Step 2: Check Your Projects

# List all registered projects
devhub list

# Check what's running
devhub status

Step 3: Start a Project

# Start all services for a project
devhub start my-project

# Watch the output:
#   → Starting my-project...
#   → Starting api on port 8080...
#   ✓ api started (port 8080)
#   → Starting frontend on port 3000...
#   ✓ frontend started (port 3000)

Step 4: Developer Shortcuts

# Jump to project directory
cd $(devhub path my-project)

# Open in VS Code
devhub code my-project

# Open in browser (if running)
devhub open my-project

Step 5: Check for Port Conflicts

devhub ports --check

# Port Allocations:
#   Web Frontends (3000-3099)
#     ● 3000 → project-a/frontend
#     ○ 3001 → project-b/frontend
#   APIs (8000-8099)
#     ● 8080 → my-api/api
#
# ✓ No port conflicts detected

Step 6: Launch the Dashboard (Optional)

# Start the API daemon in background
devhub daemon &

# Start the UI (in devhub-ui directory)
cd devhub-ui && npm install && npm run dev

# Open http://localhost:5173

Common Workflows

Morning Startup

devhub start my-main-project
devhub status
devhub open my-main-project

Switch Projects

devhub stop current-project
devhub start other-project
devhub code other-project

End of Day

devhub status        # See what's running
devhub stop --all    # Stop everything (coming soon)

Next Steps

Your First Project

This guide walks you through manually setting up a project with DevHub.

Option 1: Auto-Discovery (Easiest)

cd ~/work/my-project

# Let DevHub detect your project type
devhub discover

# Output:
# Discovered: my-project (node)
# Services:
#   - frontend (port 3000): npm run dev
#   - api (port 8080): npm run api
#
# Generated devhub.toml

# Register with DevHub
devhub register

Option 2: Manual Setup

Step 1: Initialize Config

cd ~/work/my-project
devhub init

This creates a devhub.toml template.

Step 2: Edit devhub.toml

[project]
name = "my-project"
description = "My awesome full-stack application"
tags = ["web", "api", "docker"]

# API service
[[services]]
name = "api"
type = "node"
command = "npm run api"
port = 8080
health_check = "/health"
subdomain = "api"              # → http://api.my-project.localhost

# Frontend service
[[services]]
name = "frontend"
type = "node"
command = "npm run dev"
cwd = "frontend"               # Run from subdirectory
port = 3000
main = true                    # → http://my-project.localhost
depends_on = ["api"]           # Start after API

# Database (Docker)
[[services]]
name = "postgres"
type = "docker-compose"
command = "docker compose up -d"
port = 5432

# Environment variables for all services
[environment]
NODE_ENV = "development"
DATABASE_URL = "postgres://localhost:5432/myapp"

Step 3: Register

devhub register

# Output:
# ✓ Registered my-project at /Users/you/work/my-project

Step 4: Start

devhub start my-project

# Output:
#   → Starting my-project...
#   → Starting postgres...
#   ✓ postgres started (port 5432)
#   → Starting api on port 8080...
#   ✓ api started (port 8080)
#     Health check ✓
#   → Starting frontend on port 3000...
#   ✓ frontend started (port 3000)

Understanding Service Types

DevHub supports several service types:

TypeUse CaseExample
nodeNode.js appsnpm run dev, yarn start
rust-binaryRust projectscargo run
pythonPython appsuvicorn main:app
goGo applicationsgo run .
docker-composeDocker servicesdocker compose up
shellCustom commandsAny shell command

Service Options

Each service supports these options:

[[services]]
name = "my-service"           # Required: unique identifier
type = "node"                 # Required: service type
command = "npm run dev"       # Required: start command
port = 3000                   # Required: port to listen on
cwd = "."                     # Optional: working directory
main = false                  # Optional: is this the main service?
subdomain = "api"             # Optional: subdomain for proxy
health_check = "/health"      # Optional: health check endpoint
depends_on = ["db", "cache"]  # Optional: start after these services

[services.env]                # Optional: per-service environment
API_KEY = "secret"

Verify Your Setup

# Check registration
devhub list
# my-project    /Users/you/work/my-project

# Check status
devhub status
# my-project
#   ○ api (8080)
#   ○ frontend (3000)
#   ○ postgres (5432)

# View configuration
cat devhub.toml

Next Steps

Configuration

DevHub uses two configuration files:

  1. devhub.toml - Per-project configuration (in each project directory)
  2. ~/.devhub/config.toml - Global configuration

Configuration Hierarchy

~/.devhub/config.toml     (global defaults)
    ↓
project/devhub.toml       (project-specific)
    ↓
.env files                (environment variables)
    ↓
runtime environment       (system env vars)

Environment Variable Loading

DevHub automatically loads .env files with the following priority (later sources override earlier):

  1. System environment variables
  2. Project root .env file
  3. Project root .env.local file
  4. Files listed in env_files in devhub.toml
  5. [environment] section in devhub.toml
  6. Service-specific env_file
  7. Service cwd/.env file
  8. Service cwd/.env.local file
  9. Service env = {} section

Variable Interpolation

Variables can reference other variables:

# .env file
DB_HOST=localhost
DB_PORT=5432
DATABASE_URL=postgres://${DB_HOST}:${DB_PORT}/mydb

View Resolved Environment

Use devhub env to see the final resolved environment:

# Show all services
devhub env my-project

# Show specific service
devhub env my-project -s api

# Export format for sourcing
devhub env my-project -s api -f export

devhub.toml Reference

The devhub.toml file is the project manifest that tells DevHub how to manage your project’s services.

Basic Structure

[project]
name = "my-project"
description = "My awesome project"
tags = ["rust", "web", "api"]
env_files = [".env", ".env.local"]

[[services]]
name = "api"
type = "rust-binary"
command = "cargo run --release"
port = 8080
health_check = "/health"
subdomain = "api"
env_file = "api/.env"

[[services]]
name = "frontend"
type = "node"
command = "npm run dev"
cwd = "frontend"
port = 3000
main = true
depends_on = ["api"]

[environment]
RUST_LOG = "info"
DATABASE_URL = "postgres://localhost/mydb"

[project] Section

Project-level metadata.

FieldTypeRequiredDescription
namestringYesUnique project identifier
descriptionstringNoHuman-readable description
tagsarrayNoTags for organization/filtering
env_filesarrayNoEnvironment files to load for all services

Example

[project]
name = "my-fullstack-app"
description = "Full-stack application with API and frontend"
tags = ["typescript", "react", "node", "postgres"]
env_files = [".env", ".env.local"]

[[services]] Section

Define one or more services. Each service represents a runnable process.

FieldTypeRequiredDefaultDescription
namestringYes-Service identifier
typestringYes-Service type (see below)
commandstringYes-Command to run
portintegerYes-Port the service listens on
cwdstringNoproject rootWorking directory (relative)
health_checkstringNo-HTTP endpoint for health checks
subdomainstringNo-Subdomain for reverse proxy
mainbooleanNofalsePrimary service (no subdomain)
depends_onarrayNo[]Services to start first
envtableNo{}Service-specific env vars
env_filestringNo-Service-specific env file path

Service Types

TypeDetectionDefault Behavior
rust-binaryCargo.tomlNative process
nodepackage.jsonPM2 if available, otherwise native
pythonpyproject.tomlNative process
gogo.modNative process
docker-composedocker-compose.ymlDocker Compose commands
shellAnyNative process

Example Service

[[services]]
name = "api"
type = "rust-binary"
command = "cargo run --bin api --release"
port = 8080
health_check = "/api/health"
subdomain = "api"
env = { "RUST_LOG" = "debug", "DATABASE_URL" = "postgres://localhost/mydb" }
env_file = "api/.env"

[environment] Section

Global environment variables applied to all services.

[environment]
NODE_ENV = "development"
RUST_LOG = "info"
DATABASE_URL = "postgres://localhost/mydb"
API_KEY = "dev-key-123"

Environment Loading Priority

Environment variables are loaded in this order (later sources override earlier):

  1. System environment variables
  2. Project root .env file
  3. Project root .env.local file
  4. Files listed in env_files
  5. [environment] section in manifest
  6. Service-specific env_file
  7. Service cwd/.env file
  8. Service cwd/.env.local file
  9. Service env = {} section
  10. DevHub service URL injection
  11. Service reference expansion

Variable Interpolation

Variables can reference other variables using $VAR or ${VAR} syntax:

[environment]
DB_HOST = "localhost"
DB_PORT = "5432"
DB_NAME = "myapp"
DATABASE_URL = "postgres://${DB_HOST}:${DB_PORT}/${DB_NAME}"

Service URL Environment Variables

DevHub automatically injects environment variables for service-to-service communication. This eliminates the need to hardcode localhost:PORT in your .env files.

Auto-Injected Variables

For every service in your project, DevHub injects:

VariableExampleDescription
DEVHUB_<SERVICE>_URLhttp://api.myapp.localhostExternal URL via Caddy reverse proxy
DEVHUB_<SERVICE>_INTERNAL_URLhttp://myapp-api:8080Internal URL for container-to-container
DEVHUB_<SERVICE>_PORT8080Service port

Service names are converted to uppercase with hyphens replaced by underscores (e.g., my-apiMY_API).

View all injected variables with:

devhub env my-project --service frontend | grep DEVHUB_

Service Reference Syntax

You can reference other services in your devhub.toml using the ${service.property} syntax:

[[services]]
name = "frontend"
type = "node"
command = "npm run dev"
port = 3000
main = true

[services.env]
# These get auto-expanded by DevHub:
NEXT_PUBLIC_API_URL = "${backend.url}"        # → http://backend.myapp.localhost
INTERNAL_API_URL = "${backend.internal}"      # → http://myapp-backend:8080
API_PORT = "${backend.port}"                  # → 8080

Available properties:

PropertyDescription
${service.url}External URL via Caddy (for browser/client-side requests)
${service.internal}Internal URL for container-to-container communication
${service.port}Service port number

Use Case: Frontend + Backend

A common pattern is a Next.js frontend calling a Python/Node/Rust backend:

[project]
name = "my-fullstack-app"

[[services]]
name = "backend"
type = "python"
command = "uvicorn main:app --host 0.0.0.0 --port 8081"
port = 8081
subdomain = "api"

[[services]]
name = "frontend"
type = "node"
command = "npm run dev"
port = 3000
main = true
depends_on = ["backend"]

[services.env]
# Client-side API calls go through Caddy
NEXT_PUBLIC_API_URL = "${backend.url}"

The frontend automatically receives NEXT_PUBLIC_API_URL=http://api.my-fullstack-app.localhost.

Benefits:

  • No hardcoded localhost:PORT in .env files
  • Works consistently across native and container modes
  • URLs update automatically based on project name
  • Supports both browser requests (external URLs) and server-side requests (internal URLs)

Monorepo Configuration

For projects with multiple services in subdirectories:

[project]
name = "my-monorepo"
description = "Fullstack monorepo"
env_files = [".env"]

[[services]]
name = "api"
type = "python"
command = "uvicorn app:app --host 0.0.0.0 --port 8000"
cwd = "backend"
port = 8000
subdomain = "api"

[[services]]
name = "web"
type = "node"
command = "npm run dev"
cwd = "frontend"
port = 3000
main = true
depends_on = ["api"]

[[services]]
name = "admin"
type = "node"
command = "npm run dev"
cwd = "admin-panel"
port = 3001
subdomain = "admin"
depends_on = ["api"]

Service Dependencies

Use depends_on to control startup order:

[[services]]
name = "database"
type = "docker-compose"
command = "docker compose up -d postgres"
port = 5432

[[services]]
name = "api"
type = "rust-binary"
command = "cargo run"
port = 8080
depends_on = ["database"]

[[services]]
name = "frontend"
type = "node"
command = "npm run dev"
port = 3000
depends_on = ["api"]

Services start in dependency order: database → api → frontend

Complete Example

[project]
name = "ecommerce-platform"
description = "Full-stack e-commerce application"
tags = ["typescript", "rust", "postgres", "redis"]
env_files = [".env", ".env.local"]

[[services]]
name = "postgres"
type = "docker-compose"
command = "docker compose up -d postgres"
port = 5432

[[services]]
name = "redis"
type = "docker-compose"
command = "docker compose up -d redis"
port = 6379

[[services]]
name = "api"
type = "rust-binary"
command = "cargo run --bin api --release"
cwd = "services/api"
port = 8080
health_check = "/health"
subdomain = "api"
depends_on = ["postgres", "redis"]
env_file = "services/api/.env"

[[services]]
name = "worker"
type = "rust-binary"
command = "cargo run --bin worker --release"
cwd = "services/worker"
port = 8081
depends_on = ["postgres", "redis"]

[[services]]
name = "storefront"
type = "node"
command = "npm run dev"
cwd = "apps/storefront"
port = 3000
main = true
depends_on = ["api"]

[[services]]
name = "admin"
type = "node"
command = "npm run dev"
cwd = "apps/admin"
port = 3001
subdomain = "admin"
depends_on = ["api"]

[environment]
NODE_ENV = "development"
RUST_LOG = "info"
DATABASE_URL = "postgres://localhost:5432/ecommerce"
REDIS_URL = "redis://localhost:6379"

global-config

Documentation coming soon.

commands

Documentation coming soon.

commands-project

Documentation coming soon.

commands-service

Documentation coming soon.

commands-bulk

Documentation coming soon.

commands-shortcuts

Documentation coming soon.

dashboard

Documentation coming soon.

reverse-proxy

Documentation coming soon.

Auto-Start Daemon on macOS

You can configure DevHub’s daemon to start automatically when you log in to your Mac.

Using Homebrew Service (Easiest)

If you installed via Homebrew:

# Start and enable auto-start
brew services start devhub

# Stop
brew services stop devhub

# Check status
brew services list

Manual LaunchAgent Setup

Step 1: Download the LaunchAgent

# Create LaunchAgents directory if needed
mkdir -p ~/Library/LaunchAgents

# Download the plist file
curl -fsSL https://raw.githubusercontent.com/moinsen-dev/devhub/main/install/com.moinsen.devhub.plist \
  -o ~/Library/LaunchAgents/com.moinsen.devhub.plist

Step 2: Verify the Binary Path

The default plist assumes devhub is at /usr/local/bin/devhub. If you installed elsewhere, edit the file:

# Check where devhub is installed
which devhub

# Edit the plist if needed
nano ~/Library/LaunchAgents/com.moinsen.devhub.plist

Update the ProgramArguments section:

<key>ProgramArguments</key>
<array>
    <string>/path/to/your/devhub</string>
    <string>daemon</string>
    <string>--port</string>
    <string>9876</string>
</array>

Step 3: Load the LaunchAgent

# Load (start now and on future logins)
launchctl load ~/Library/LaunchAgents/com.moinsen.devhub.plist

# Verify it's running
launchctl list | grep devhub
# com.moinsen.devhub should show with PID

# Check if daemon is responding
curl http://localhost:9876/api/projects

Step 4: Managing the Service

# Stop the daemon
launchctl stop com.moinsen.devhub

# Start the daemon
launchctl start com.moinsen.devhub

# Unload (disable auto-start)
launchctl unload ~/Library/LaunchAgents/com.moinsen.devhub.plist

# Reload after config changes
launchctl unload ~/Library/LaunchAgents/com.moinsen.devhub.plist
launchctl load ~/Library/LaunchAgents/com.moinsen.devhub.plist

Viewing Logs

# Stdout
tail -f /tmp/devhub.out.log

# Stderr
tail -f /tmp/devhub.err.log

# Or use Console.app and search for "devhub"

Troubleshooting

Daemon Not Starting

  1. Check the error log:

    cat /tmp/devhub.err.log
    
  2. Verify binary path:

    ls -la /usr/local/bin/devhub
    
  3. Test manual start:

    /usr/local/bin/devhub daemon --port 9876
    

Port Already in Use

If port 9876 is in use:

  1. Find what’s using it:

    lsof -i :9876
    
  2. Either stop that process or edit the plist to use a different port.

Permission Issues

# Ensure correct permissions
chmod 644 ~/Library/LaunchAgents/com.moinsen.devhub.plist

Linux systemd Setup

For Linux users, create a systemd user service:

mkdir -p ~/.config/systemd/user

cat > ~/.config/systemd/user/devhub.service << 'EOF'
[Unit]
Description=DevHub Daemon
After=network.target

[Service]
Type=simple
ExecStart=/usr/local/bin/devhub daemon --port 9876
Restart=always
RestartSec=10
Environment=RUST_LOG=info

[Install]
WantedBy=default.target
EOF

# Enable and start
systemctl --user enable devhub
systemctl --user start devhub

# Check status
systemctl --user status devhub

pm2

Documentation coming soon.

docker-compose

Documentation coming soon.

completions

Documentation coming soon.

CLI Reference

Complete reference for all DevHub commands.

Global Options

devhub [OPTIONS] <COMMAND>

Options:
  -h, --help     Print help
  -V, --version  Print version

Commands

Project Management

devhub init

Create a new devhub.toml in the current directory.

devhub init [--force]

Options:
  --force, -f  Overwrite existing devhub.toml

devhub discover

Auto-detect project type and generate devhub.toml. For monorepos without a root project type, automatically scans subdirectories for services.

devhub discover [PATH] [--dry-run]

Arguments:
  PATH  Project path (default: current directory)

Options:
  --dry-run  Preview what would be discovered without writing files

Monorepo Support:

When no project type is detected at the root level, discover automatically scans subdirectories for project signatures (Cargo.toml, package.json, pubspec.yaml, etc.) and generates a multi-service manifest.

devhub register

Register a project with DevHub.

devhub register [PATH]

Arguments:
  PATH  Project path (default: current directory)

devhub unregister

Remove a project from DevHub registry.

devhub unregister <NAME>

Arguments:
  NAME  Project name to unregister

devhub list

List all registered projects.

devhub list

Service Control

devhub start

Start project services.

devhub start [PROJECT] [--service <SERVICE>] [--all] [--favorites]

Arguments:
  PROJECT  Project name (optional if in project directory)

Options:
  --service, -s   Start only this service
  --all           Start all registered projects
  --favorites     Start all favorite projects

devhub stop

Stop project services.

devhub stop [PROJECT] [--service <SERVICE>] [--all] [--favorites]

Arguments:
  PROJECT  Project name (optional if in project directory)

Options:
  --service, -s   Stop only this service
  --all           Stop all registered projects
  --favorites     Stop all favorite projects

devhub restart

Restart project services.

devhub restart [PROJECT] [--service <SERVICE>] [--all] [--favorites]

Arguments:
  PROJECT  Project name (optional if in project directory)

Options:
  --service, -s   Restart only this service
  --all           Restart all registered projects
  --favorites     Restart all favorite projects

devhub status

Show status of all projects and services.

devhub status

devhub logs

View project logs.

devhub logs <PROJECT> [SERVICE] [--follow]

Arguments:
  PROJECT  Project name
  SERVICE  Service name (optional)

Options:
  --follow, -f  Follow log output (like tail -f)

Bulk Operations

devhub scan

Scan directories for projects.

devhub scan [PATHS...] [OPTIONS]

Arguments:
  PATHS  Directories to scan (default: ~/work/moinsen/{ideas,opensource,apps})

Options:
  --depth, -d <N>     Maximum scan depth (default: 2)
  --auto-register, -a  Register discovered projects automatically
  --dry-run           Show what would be discovered without registering

Port Management

devhub ports

Show port allocations across all projects.

devhub ports [--check] [--resolve]

Options:
  --check, -c    Detect and report port conflicts
  --resolve, -r  Suggest fixes for port conflicts

Fuzzy search for projects by name.

devhub search <QUERY> [--limit <N>]

Arguments:
  QUERY  Search query (fuzzy matched against project names)

Options:
  --limit, -l  Maximum results to show (default: 10)

devhub recent

Show recently used projects.

devhub recent [--limit <N>]

Options:
  --limit, -l  Maximum results to show (default: 10)

Favorites

devhub fav

Manage favorite projects.

devhub fav <SUBCOMMAND>

Subcommands:
  add <PROJECT>     Add project to favorites
  remove <PROJECT>  Remove project from favorites
  list              List all favorite projects
  toggle <PROJECT>  Toggle favorite status

Developer Shortcuts

devhub open

Open project in browser.

devhub open <PROJECT> [--service <SERVICE>]

Arguments:
  PROJECT  Project name

Options:
  --service, -s  Open specific service (default: main service)

devhub code

Open project in VS Code.

devhub code <PROJECT>

Arguments:
  PROJECT  Project name

devhub path

Print project path (for shell integration).

devhub path <PROJECT>

Arguments:
  PROJECT  Project name

# Usage with cd:
cd $(devhub path my-project)

Environment

devhub env

Show resolved environment variables for a project or service.

devhub env <PROJECT> [--service <SERVICE>] [--format <FORMAT>]

Arguments:
  PROJECT  Project name

Options:
  --service, -s  Show environment for specific service
  --format, -f   Output format: table (default) or export

Output Formats:

  • table (default): Displays variables in a readable table format
  • export: Outputs in shell export format for sourcing (export VAR='value')

Example:

# Show all services' environment
devhub env my-project

# Show specific service environment
devhub env my-project -s api

# Export format (for sourcing)
devhub env my-project -s api -f export
eval "$(devhub env my-project -s api -f export)"

Utilities

devhub daemon

Run the API server for the dashboard.

devhub daemon [--port <PORT>]

Options:
  --port, -p  Port to listen on (default: 9876)

devhub completions

Generate shell completions.

devhub completions <SHELL>

Arguments:
  SHELL  Shell type: bash, zsh, fish, elvish, powershell

Exit Codes

CodeMeaning
0Success
1General error
2Invalid arguments

Environment Variables

VariableDescription
RUST_LOGLog level (error, warn, info, debug, trace)
DEVHUB_CONFIGCustom config directory

Examples

# Discover and register all projects
devhub scan --auto-register ~/work

# Start a project and follow logs
devhub start my-project
devhub logs my-project -f

# Quick project switch
cd $(devhub path other-project)
devhub code other-project
devhub start other-project

# Check for port conflicts before starting
devhub ports --check
devhub start my-project

# Generate completions
devhub completions zsh > ~/.zfunc/_devhub

# Fuzzy search for projects
devhub search graph     # Find projects with "graph" in name

# Manage favorites
devhub fav add my-project
devhub fav list
devhub start --favorites  # Start all favorited projects

# Batch operations
devhub start --all       # Start everything
devhub stop --favorites  # Stop only favorites

# View recent projects
devhub recent            # Shows last 10 used projects

service-types

Documentation coming soon.

api

Documentation coming soon.

troubleshooting

Documentation coming soon.

Contributing

Thank you for your interest in contributing to DevHub!

Getting Started

  1. Fork the repository
  2. Clone your fork
  3. Create a feature branch

Development Setup

# Build CLI
cargo build

# Run tests
cargo test

# Build UI
cd devhub-ui && npm install && npm run dev

Code Style

  • Use cargo fmt before committing
  • Run cargo clippy and fix warnings
  • Write tests for new features

License

By contributing, you agree that your contributions will be licensed under the MIT License.

Changelog

[0.3.0] - 2025-12-16

Added

  • Environment File Loading

    • Automatic .env and .env.local file support
    • Variable interpolation with $VAR and ${VAR} syntax
    • env_files field in project config for explicit env file list
    • env_file field per service for service-specific env files
    • devhub env command to show resolved environment variables
  • Monorepo Auto-Discovery

    • Automatic subdirectory scanning when no root project type found
    • Detects multiple project types in subdirectories
    • Generates multi-service devhub.toml with correct cwd settings
    • Smart port allocation for discovered services
  • Discovery Enhancements

    • devhub discover --dry-run - Preview without writing files

[0.2.0] - 2025-12-16

Added

  • Fuzzy Search - devhub search <query> for finding projects
  • Favorites System - devhub fav commands to star projects
  • Recent Projects - devhub recent to show recently used projects
  • Batch Operations - --all and --favorites flags for start/stop/restart
  • Port Management - devhub ports --check and --resolve for conflict detection
  • Dashboard Enhancements - Log viewer, service-level controls

[0.1.0] - 2025-12-16

Added

  • Core CLI commands (init, discover, register, list, status, start, stop, restart, logs)
  • Bulk operations (scan, ports)
  • Developer shortcuts (open, code, path)
  • Service support: Rust, Node.js, Python, Go, Docker Compose, Shell
  • PM2 integration for Node.js
  • Docker Compose support
  • Health check endpoint polling
  • SvelteKit dashboard with real-time polling
  • Caddy reverse proxy integration
  • Shell completions (bash, zsh, fish)