Init Command
Quick Start with Init
The rustywatch init command creates a configuration file interactively, making it easy to get started with RustyWatch.
Basic Usage
rustywatch initThis launches an interactive wizard that:
- Detects your project type automatically
- Prompts for watch directory, build commands, and binary path
- Asks about ignore patterns
- Shows a preview of the configuration
- Writes the
rustywatch.yamlfile
Command Options
| Flag | Description |
|---|---|
-o, --output <FILE> | Config file path (default: rustywatch.yaml) |
--yes | Skip prompts and use auto-detected defaults |
-f, --force | Overwrite existing config file |
Auto-Detection
RustyWatch automatically detects your project type and suggests appropriate defaults:
| Project Type | Detection File | Default Command | Default Binary |
|---|---|---|---|
| Rust | Cargo.toml | cargo build | target/debug/{name} |
| Go | go.mod | go build | ./{name} |
| Node.js | package.json | npm run dev | - |
| Python | pyproject.toml, setup.py, requirements.txt | python main.py | - |
| Bun | bun.lockb | bun run start | - |
Examples
Interactive mode (recommended for first-time setup):
rustywatch initQuick setup with auto-detected defaults:
rustywatch init --yesCustom output path:
rustywatch init -o .rustywatch.yamlForce overwrite existing config:
rustywatch init --forceInteractive Prompts
When running rustywatch init, you’ll be asked:
- Watch Directory - Which directory should RustyWatch monitor for changes?
- Build Command - What command should run when files change?
- Binary Path - Where is the compiled binary located? (for compiled languages)
- Ignore Patterns - Which files/directories should be ignored?
After answering, you’ll see a preview of the generated YAML configuration before it’s written to disk.