switchdev 0.1.0

A fast CLI to instantly switch between development projects and run their startup commands
switchdev-0.1.0 is not a library.

switchdev

Instantly switch between development projects.

πŸš€ Overview

switchdev is a small CLI for jumping into development projects and starting them quickly. It solves the repeated friction of remembering project paths, changing directories manually, and typing the same startup command every time.

The core idea is simple: take the usual cd + run workflow and automate it. Save a project once, then switch into it with a single command.

⚑ Features

  • Add projects
  • List projects
  • Switch instantly
  • Smart command detection
  • Custom commands
  • Dry run
  • Verbose mode

πŸ“¦ Installation

From crates.io (recommended)

cargo install switchdev

From source

git clone git https://github.com/s0r0j/switchdev.git
cd switchdev
cargo build --release

πŸ§ͺ Usage

Add project

switchdev add api ~/dev/api

List

switchdev list

Switch

switchdev api

βš™οΈ Custom Commands

switchdev add api ~/dev/api --cmd "npm run dev"

You can also provide multiple --cmd flags when a project needs more than one startup step.

πŸ” Dry Run

switchdev api --dry-run

This previews the final command without executing it.

🧠 How It Works

When no custom command is configured, switchdev tries to detect the right startup command automatically.

  • Node.js: reads package.json If scripts.dev exists, it runs npm run dev Otherwise, it falls back to npm start
  • Rust: if Cargo.toml exists, it runs cargo run
  • Python: if main.py exists, it runs python main.py If app.py exists, it runs python app.py

If custom commands are saved for a project, those take priority over auto-detection.

πŸ“ Config

Config is stored at:

~/.switchdev/config.json

Example:

{
  "projects": [
    {
      "name": "api",
      "path": "/home/user/dev/api",
      "commands": null
    }
  ]
}

🎯 Philosophy

The best tool is the one you don’t have to think about.

πŸ›£ Future Ideas

  • TUI selector
  • grouping
  • recent projects