switchdev 0.1.0

A fast CLI to instantly switch between development projects and run their startup commands
# 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)

```bash
cargo install switchdev
```

### From source

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

## πŸ§ͺ Usage

### Add project

```bash
switchdev add api ~/dev/api
```

### List

```bash
switchdev list
```

### Switch

```bash
switchdev api
```

## βš™οΈ Custom Commands

```bash
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

```bash
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:

```text
~/.switchdev/config.json
```

Example:

```json
{
  "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