class
AmberCLI::Documentation::DevelopmentTools
- AmberCLI::Documentation::DevelopmentTools
- Reference
- Object
Overview
Development Tools
Amber CLI provides several tools to streamline development workflow.
Watch Mode
The watch command starts a development server that automatically rebuilds
and restarts your application when files change.
Usage
amber watch [options]
Options
-n, --name=NAME- Application process name-b, --build=BUILD- Custom build command-r, --run=RUN- Custom run command-w, --watch=FILES- Files to watch (comma-separated)-i, --info- Show current configuration
Examples
Basic watch mode:
amber watch
Custom build and run commands:
amber watch --build "crystal build src/my_app.cr --release" --run "./my_app"
Show current configuration:
amber watch --info
Code Execution
The exec command allows you to execute Crystal code within your
application's context, similar to Rails console.
Usage
amber exec [CODE_OR_FILE] [options]
Options
-e, --editor=EDITOR- Preferred editor (vim, nano, etc.)-b, --back=TIMES- Run previous command files
Examples
Execute inline code:
amber exec 'puts "Hello from Amber!"'
Execute a Crystal file:
amber exec my_script.cr
Open editor for interactive session:
amber exec --editor nano