Skip to content

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

Terminal window
rustywatch init

This launches an interactive wizard that:

  1. Detects your project type automatically
  2. Prompts for watch directory, build commands, and binary path
  3. Asks about ignore patterns
  4. Shows a preview of the configuration
  5. Writes the rustywatch.yaml file

Command Options

FlagDescription
-o, --output <FILE>Config file path (default: rustywatch.yaml)
--yesSkip prompts and use auto-detected defaults
-f, --forceOverwrite existing config file

Auto-Detection

RustyWatch automatically detects your project type and suggests appropriate defaults:

Project TypeDetection FileDefault CommandDefault Binary
RustCargo.tomlcargo buildtarget/debug/{name}
Gogo.modgo build./{name}
Node.jspackage.jsonnpm run dev-
Pythonpyproject.toml, setup.py, requirements.txtpython main.py-
Bunbun.lockbbun run start-

Examples

Interactive mode (recommended for first-time setup):

Terminal window
rustywatch init

Quick setup with auto-detected defaults:

Terminal window
rustywatch init --yes

Custom output path:

Terminal window
rustywatch init -o .rustywatch.yaml

Force overwrite existing config:

Terminal window
rustywatch init --force

Interactive Prompts

When running rustywatch init, you’ll be asked:

  1. Watch Directory - Which directory should RustyWatch monitor for changes?
  2. Build Command - What command should run when files change?
  3. Binary Path - Where is the compiled binary located? (for compiled languages)
  4. 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.