JSPM

@approximate/capable

2.0.0
    • ESM via JSPM
    • ES Module Entrypoint
    • Export Map
    • Keywords
    • License
    • Repository URL
    • TypeScript Types
    • README
    • Created
    • Published
    • Downloads 11
    • Score
      100M100P100Q52891F
    • License MIT

    The Swiss Army Knife for development servers - auto port resolution, browser opening, process management, and more

    Package Exports

      This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@approximate/capable) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

      Readme

      Capable 🚀

      The Swiss Army Knife for Development Servers

      Stop memorizing different dev commands. Just type capable.

      The Problem

      Every project has different commands:

      • npm start
      • npm run dev
      • npm run serve
      • npm run server
      • python manage.py runserver
      • And dozens more...

      Plus, you constantly get port conflicts:

      • "Port 3000 is already in use"
      • Kill the process manually
      • Try a different port
      • Update your config
      • Repeat...

      You shouldn't need to deal with this.

      The Solution

      npm install -g capable
      cd your-project
      capable

      That's it. One command to rule them all. Automatic port conflict resolution included.

      Installation

      npm install -g capable

      Usage

      1. Start Any Dev Server

      cd my-react-app
      capable

      Auto-detects your framework and:

      • ✅ Finds the right npm script
      • ✅ Resolves port conflicts
      • ✅ Opens your browser automatically

      2. Kill Processes on Ports

      # Kill specific port
      capable kill 3000
      
      # Kill default port for this project
      capable kill

      No more:

      • Manually finding PIDs
      • Using lsof/netstat
      • Google searching "how to kill port 3000"

      3. See What's Running

      capable ps

      Shows all dev servers on common ports:

      ✓ Found 3 active port(s):
      
        • Port 3000 - http://localhost:3000
        • Port 3001 - http://localhost:3001
        • Port 5173 - http://localhost:5173

      4. Install Dependencies

      capable install

      Smart dependency installation:

      • Detects npm vs yarn
      • Uses lockfile if present
      • Auto-prompts if missing before starting

      5. Frontend vs Backend

      If you have a monorepo or fullstack project:

      # Start frontend
      capable front
      
      # Start backend
      capable back

      Examples

      # Next.js project
      cd my-nextjs-app
      capable
      # → Runs: npm run dev
      
      # React app
      cd my-react-app
      capable
      # → Runs: npm start
      
      # Express backend
      cd my-api
      capable back
      # → Runs: npm run server
      
      # Django project
      cd my-django-app
      capable
      # → Runs: python manage.py runserver

      What It Detects

      Frontend Commands (Priority Order)

      1. dev
      2. start:dev
      3. develop
      4. start
      5. serve
      6. vite

      Backend Commands (Priority Order)

      1. server
      2. start:server
      3. dev:server
      4. backend
      5. start:backend
      6. serve:api
      7. api

      Frameworks Detected

      • ✅ Next.js
      • ✅ React (CRA, Vite)
      • ✅ Vue
      • ✅ Angular
      • ✅ Svelte
      • ✅ Express
      • ✅ Django
      • ✅ Flask
      • ✅ FastAPI
      • ✅ And any project with package.json scripts!

      The Difference

      dev (auto-detect)

      • Scans your package.json
      • Looks for common dev scripts (dev, start, serve)
      • Runs the most appropriate one
      • Works for 95% of projects

      dev front

      • Specifically looks for frontend-related scripts
      • Useful in monorepos with both frontend and backend
      • Prioritizes client-side development commands

      dev back

      • Specifically looks for backend-related scripts
      • Perfect for API servers, backend services
      • Prioritizes server-side development commands

      Examples in Different Projects

      Standard React App

      cd my-react-app
      dev
      # Automatically runs: npm start

      Next.js App

      cd my-nextjs-app
      dev
      # Automatically runs: npm run dev

      Fullstack Monorepo

      cd my-fullstack-app
      
      # Terminal 1 - Start frontend
      dev front
      
      # Terminal 2 - Start backend
      dev back

      Django Project

      cd my-django-project
      dev
      # Automatically runs: python manage.py runserver

      Help

      dev --help

      Automatic Port Conflict Resolution

      No more "Port 3000 is already in use" errors!

      # First project
      cd project-1
      capable
      # ✓ Starting on port 3000
      
      # Second project (in another terminal)
      cd project-2
      capable
      # ⚠ Port 3000 is in use, using port 3001 instead
      # ✓ Starting on port 3001
      
      # Third project
      cd project-3
      capable
      # ⚠ Port 3000 is in use, using port 3002 instead
      # ✓ Starting on port 3002

      How it works:

      1. Detects your framework's default port (Next.js → 3000, Vite → 5173, etc.)
      2. Checks if the port is available
      3. If busy, automatically finds the next available port
      4. Sets the PORT environment variable
      5. Starts your server with zero config

      Run multiple projects simultaneously without conflicts!

      Complete Command Reference

      # Start dev server (auto-detect)
      capable
      
      # Start with browser auto-open (default)
      capable
      
      # Start frontend specifically
      capable front
      
      # Start backend specifically
      capable back
      
      # Kill process on port
      capable kill 3000
      capable kill          # Uses project default port
      
      # Show running servers
      capable ps
      capable status        # Alias for ps
      
      # Install dependencies
      capable install
      capable i             # Short alias
      
      # Help
      capable --help
      capable -h

      Why Capable?

      1. No More Context Switching - Your brain shouldn't waste energy remembering different commands
      2. No Port Conflicts - Automatically finds available ports, run multiple projects at once
      3. Auto Browser - Opens localhost automatically when ready
      4. Port Management - Kill processes with simple commands
      5. Dependency Smart - Auto-detects missing node_modules
      6. Works Everywhere - One command for all your projects
      7. Smart Detection - Understands your project structure and framework defaults
      8. Saves Time - No more checking package.json or killing processes
      9. Simple - One word: capable

      Contributing

      Found a bug or want to add support for more frameworks? PRs welcome!

      License

      MIT


      Made for developers who are tired of typing npm run dev --help to figure out the right command.

      Be capable. Type capable.