How otto-rs/otto works
Otto is a Rust CLI for defining and running Make-like tasks from YAML ottofiles. Its main workflow discovers and parses a configuration, resolves task parameters and dependencies, then schedules task actions and records the run. The README also documents task-graph visualization, task listing, Makefile conversion, run cleanup/history/statistics, an interactive TUI, and upgrades. The sampled code confirms the application’s scheduler and state-completion calls; links between unsampled subsystems are limited to documented capabilities or omitted where ownership is unclear.
Main entry points: app.rs Application · scheduler.rs Task scheduler · parser.rs CLI parser · manager.rs Run state
Components 26
CLI and UI
- CLI entry
src/main.rs - Application
src/app.rs - TUI dashboard
src/tui/app.rs
Task configuration
- CLI parser
src/cli/parser.rs - Config model
src/cfg/config.rs - Foreach resolver
src/cfg/resolver.rs
Task execution
- Executor tasks
src/executor/task.rs - Dependency graph
src/executor/graph.rs - Task scheduler
src/executor/scheduler.rs - Action processor
src/executor/action.rs - Task output
src/executor/output.rs - Run workspace
src/executor/workspace.rs
Run history
- Run state
src/executor/state/manager.rs - SQLite database
src/executor/state/db.rs
Built-in commands
- Makefile converter
src/makefile/converter.rs - Graph command
src/cli/commands/graph.rs - Task listing
src/cli/commands/tasks.rs - Clean command
src/cli/commands/clean.rs - Convert command
src/cli/commands/convert.rs - History command
src/cli/commands/history.rs - Stats command
src/cli/commands/stats.rs - Upgrade command
src/cli/commands/upgrade.rs
Other components
- Engineer
- Release service
- Ottofile
- Task processes
Connections 28
- Engineer → CLI entry: invokes
- CLI entry → Application: runs
- Application → CLI parser: parses arguments
- CLI parser → Ottofile: discovers and reads
- CLI parser → Config model: builds config
- CLI parser → Foreach resolver: resolves foreach
- Application → Executor tasks: builds executor tasks
- Application → Task scheduler: executes plan
- Task scheduler → Dependency graph: orders dependencies
- Task scheduler → Action processor: runs actions
- Action processor → Task processes: spawns processes
- Task scheduler → Task output: streams output
- Application → Run workspace: manages run
- Application → Run state: records completion
- Run state → SQLite database: reads and writes
- Application → TUI dashboard: starts dashboard
- Task scheduler → TUI dashboard: publishes task updates
- Application → Graph command: dispatches builtin
- Application → Task listing: lists tasks
- Application → Clean command: dispatches builtin
- Application → Convert command: dispatches builtin
- Convert command → Makefile converter: converts input
- Application → History command: dispatches builtin
- History command → Run state: queries history
- Application → Stats command: dispatches builtin
- Stats command → Run state: queries statistics
- Application → Upgrade command: dispatches builtin
- Upgrade command → Release service: downloads upgrade