# Developer Tools

IDE, debugging, profiling, and CLI tools for productive development.

---

## IDEs / Editors

| Language | Primary | Alternative |
|---|---|---|
| **TypeScript/JS** | VS Code | WebStorm |
| **Python** | VS Code + Pylance | PyCharm |
| **Go** | GoLand | VS Code + gopls |
| **Rust** | VS Code + rust-analyzer | CLion + Rust |
| **JVM** | IntelliJ IDEA Ultimate | VS Code + Extensions |
| **Polyglot** | VS Code | IntelliJ IDEA |

### VS Code Extensions (Essential)
```json
// .vscode/extensions.json
{
  "recommendations": [
    "dbaeumer.vscode-eslint",           // ESLint
    "esbenp.prettier-vscode",           // Prettier
    "bradlc.vscode-tailwindcss",        // Tailwind
    "ms-python.python",                 // Python
    "ms-python.pylance",                // Pylance
    "golang.go",                        // Go
    "rust-lang.rust-analyzer",          // Rust
    "redhat.java",                      // Java
    "vscjava.vscode-java-pack",         // Java pack
    "scala-lang.scala",                 // Scala (Metals)
    "kotlin.kotlin",                    // Kotlin
    "ms-azuretools.vscode-docker",      // Docker
    "hashicorp.terraform",              // Terraform
    "redhat.vscode-yaml",               // YAML
    "github.vscode-github-actions",     // GitHub Actions
    "ms-vscode-remote.remote-containers", // Dev Containers
    "usernamehw.errorlens",             // Inline errors
    "streetsidesoftware.code-spell-checker" // Spell check
  ]
}
```

### IntelliJ IDEA Plugins
- **Key Promoter X** — Learn shortcuts
- **Rainbow Brackets** — Nested bracket colors
- **String Manipulation** — Text transformations
- **GitToolBox** — Enhanced Git UI
- **SonarLint** — Real-time code quality

---

## Debugging

### General Principles
- **Reproduce first** — Minimal failing case
- **Binary search** — Narrow down location
- **Log strategically** — Structured logs > printf
- **Use debugger** — Breakpoints, watch expressions, conditional breakpoints

### Language-Specific

#### VS Code Debug Configurations (`.vscode/launch.json`)
```json
{
  "version": "0.2.0",
  "configurations": [
    {
      "name": "Launch Node/TS",
      "type": "node",
      "request": "launch",
      "runtimeExecutable": "pnpm",
      "runtimeArgs": ["dev"],
      "console": "integratedTerminal"
    },
    {
      "name": "Python: FastAPI",
      "type": "python",
      "request": "launch",
      "module": "uvicorn",
      "args": ["main:app", "--reload"],
      "jinja": true
    },
    {
      "name": "Go: Launch",
      "type": "go",
      "request": "launch",
      "mode": "auto",
      "program": "${workspaceFolder}/cmd/api"
    },
    {
      "name": "Rust: Debug",
      "type": "lldb",
      "request": "launch",
      "program": "${workspaceFolder}/target/debug/my-app",
      "args": [],
      "cwd": "${workspaceFolder}"
    }
  ]
}
```

#### Remote Debugging
- **Java**: `-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005`
- **Node**: `--inspect=0.0.0.0:9229`
- **Python**: `python -m debugpy --listen 0.0.0.0:5678 --wait-for-client -m uvicorn main:app`
- **Go**: `dlv debug --headless --listen=:2345 --api-version=2 --accept-multiclient`

---

## Profiling

### CPU / Memory Profilers

| Language | Tool | Usage |
|---|---|---|
| **Node/TS** | `--inspect` + Chrome DevTools | `node --inspect app.js` |
| **Python** | `py-spy`, `scalene`, `cProfile` | `py-spy record -o profile.svg -- python app.py` |
| **Go** | `pprof` | `go tool pprof http://localhost:6060/debug/pprof/profile` |
| **Rust** | `perf`, `flamegraph`, `tracy` | `cargo flamegraph` |
| **JVM** | `async-profiler`, JFR, VisualVM | `./profiler.sh -d 60 -f profile.html <pid>` |

### Continuous Profiling (Production)
- **Pyroscope** — Open source continuous profiling
- **Datadog / Grafana Pyroscope** — Managed
- **Google Cloud Profiler** — GCP native

---

## CLI Productivity

### Modern CLI Replacements
| Legacy | Modern | Why |
|---|---|---|
| `ls` | `eza` / `lsd` | Colors, git status, tree view |
| `cat` | `bat` | Syntax highlighting, paging |
| `grep` | `ripgrep` (`rg`) | Faster, respects `.gitignore` |
| `find` | `fd` | Faster, simpler syntax |
| `top`/`htop` | `btop` / `bpytop` | Better UI |
| `du` | `dust` / `ncdu` | Visual disk usage |
| `ps` | `procs` | Modern process viewer |
| `curl` | `httpie` / `xh` | Better UX, JSON |
| `ssh` | `mosh` | Roaming, intermittent connectivity |

### Terminal Multiplexers
- **tmux** — Sessions, windows, panes; persistent
- **zellij** — Modern, plugins, layouts
- **screen** — Legacy, ubiquitous

### Shell Enhancements
- **Starship** — Cross-shell prompt (fast, configurable)
- **zoxide** — Smart `cd` (learns your directories)
- **fzf** — Fuzzy finder (files, history, git, processes)
- **direnv** — Per-directory env vars (auto-load `.envrc`)
- **atuin** — Shell history sync + search (encrypted)

### Git CLI
- **lazygit** — TUI for git (commit, stage, rebase visually)
- **gitui** — Rust-based TUI alternative
- **git-delta** — Better diffs (`git config --global core.pager delta`)
- **commitizen** — Conventional commit wizard (`cz commit`)

---

## API Development

### REST Clients
- **Bruno** — Open source, Git-friendly (stores as plain text)
- **Insomnia** — Feature-rich, team sync
- **HTTPie** — CLI (`http GET :8080/users`)
- **VS Code REST Client** — `.http` files in editor
- **curl / xh** — Scriptable

### GraphQL
- **GraphiQL** — In-browser IDE
- **Altair** — Desktop client
- **Postman** — Also supports GraphQL

### gRPC
- **grpcurl** — CLI (`grpcurl -plaintext localhost:5005 list`)
- **BloomRPC** — GUI for gRPC
- **Postman** — gRPC support

---

## Database Tools

| Tool | Type | Best For |
|---|---|---|
| **DBeaver** | Universal GUI | Multi-DB, ER diagrams |
| **DataGrip** | JetBrains IDE | SQL intelligence, refactoring |
| **pgAdmin** | Postgres-specific | Postgres admin |
| **TablePlus** | Native Mac/Win/Linux | Fast, clean UI |
| **usql** | CLI universal | `usql postgres://...` |
| **pgcli / mycli** | REPL | Auto-complete, syntax highlight |

### Migration Tools
- **golang-migrate** — Go, CLI, multiple DBs
- **Atlas** — Declarative schema (Terraform-like)
- **Liquibase** — XML/YAML/SQL, Java ecosystem
- **Flyway** — SQL/Java migrations, Spring Boot default

---

## Container / K8s Tools

| Tool | Purpose |
|---|---|
| **docker / podman** | Build, run containers |
| **dive** | Analyze image layers |
| **ctop** | Container metrics (htop for containers) |
| **lazydocker** | TUI for Docker |
| **kubectl** | K8s CLI |
| **k9s** | TUI for K8s (essential) |
| **stern** | Multi-pod log tailing |
| **kubectx/kubens** | Context/namespace switching |
| **helm** | Package manager |
| **kustomize** | Template-free customization |
| **tilt / garden** | Live dev on K8s |
| **telepresence** | Local ↔ remote intercept |

---

## Documentation / Diagrams

### Diagrams as Code
- **Mermaid** — Markdown-embedded (GitHub, GitLab, Notion, Obsidian)
- **PlantUML** — UML, C4, more diagram types
- **Structurizr** — C4 model DSL (Java/Kotlin/Go/JS)
- **GraphViz (dot)** — General graph visualization
- **d2** — Modern declarative diagrams

### Architecture Documentation
- **C4 Model** — Context, Container, Component, Code
- **ADR** — Architecture Decision Records (`adr-tools`)

---

## Related Notes

- [[Tools/Build-Tools]] — Build systems, bundlers
- [[Tools/Static-Analysis]] — Linting, type checking
- [[Tools/Package-Management]] — Dependencies, registries
- [[Languages/*]] — Language-specific tooling
- [[DevOps/CI-CD-Best-Practices]] — CI integration
- [[DevOps/Observability]] — Production profiling

---

*Sources: VS Code Docs, JetBrains Guides, Language-specific debugging guides, CNCF Landscape, Thoughtworks Radar*