# macOS
brew tap gregwinn/winn && brew install winn
# Linux (curl)
curl -fsSL https://winn.ws/install.sh | bash
# Ubuntu / Debian
curl -fsSL https://winn.ws/gpg.key | sudo gpg --dearmor -o /usr/share/keyrings/winn.gpg
echo "deb [signed-by=/usr/share/keyrings/winn.gpg] https://gregwinn.github.io/apt.winn.ws stable main" \
| sudo tee /etc/apt/sources.list.d/winn.list
sudo apt update && sudo apt install winn
# Fedora / RHEL
sudo dnf config-manager --add-repo https://gregwinn.github.io/rpm.winn.ws/winn.repo
sudo dnf install winn| Command | Shortcut | Description |
|---|---|---|
winn new <name> |
Create a new project | |
winn run <file> |
r |
Compile and run a file |
winn start [module] |
s |
Start project (keeps VM alive) |
winn test [file] |
t |
Run tests |
winn watch [--start] |
w |
Watch + hot-reload |
winn console |
con |
Interactive REPL |
winn compile [file] |
c |
Compile .winn files |
winn fmt [file] |
f |
Format code (--check for CI) |
winn lint [file] |
l |
Static analysis linter |
winn docs [file] |
d |
Generate API docs |
winn lsp |
Start language server (stdio) | |
winn create <type> |
g |
Generate code (model, migration, ...) |
winn migrate |
Run database migrations | |
winn rollback |
Rollback migrations | |
winn task <name> |
Run a project task | |
winn add <package> |
Install a package | |
winn remove <package> |
Remove a package | |
winn packages |
List installed packages | |
winn install |
Install all from package.json | |
winn deps |
Manage Erlang dependencies | |
winn bench <file> |
Load testing | |
winn metrics |
Live metrics dashboard | |
winn release |
Build production release | |
winn version |
-v |
Print version |
winn help |
-h |
Show help |
Create a new project. Three modes available:
winn new my_app # full scaffold (default)
winn new my_app --api # API project with router + health endpoint
winn new my_app --minimal # just src/ and rebar.configDefault creates: src/, test/, config/, db/migrations/, README.md, .env.example, .gitignore, package.json.
--api adds a router with use Winn.Router, a /api/health endpoint, a health controller, and Server.start in main().
--minimal creates only src/<name>.winn, rebar.config, .gitignore, and package.json.
Compile .winn files to .beam bytecode in ebin/.
winn compile # all files in src/
winn compile src/my_app.winn # single fileCompile and run a single file. Calls main() and exits.
winn run src/hello.winnCompile all files, start OTP apps, call main(), keep the VM alive. Use for servers and long-running services.
winn start # auto-detect main module
winn start my_app # specify moduleRun tests written with use Winn.Test. Discovers test_* functions automatically.
winn test # all tests in test/
winn test test/math_test.winn # specific filemodule MathTest
use Winn.Test
def test_addition()
assert(1 + 1 == 2)
end
def test_equality()
assert_equal("hello", "hello")
end
end
Watch files for changes, hot-reload via BEAM code swap, show a live terminal dashboard.
winn watch # watch and recompile
winn watch --start # watch + start the appGenerate code from templates. winn c is shorthand.
winn create model User name:string email:string
# => src/models/user.winn
winn create migration CreateUsers name:string
# => db/migrations/TIMESTAMP_create_users.winn
winn create task db:seed
# => src/tasks/db_seed.winn
winn create router Api
# => src/controllers/api_controller.winn (module ApiController)
winn create scaffold Post title:string body:text
# => src/models/post.winn, src/controllers/post_controller.winn, test/post_test.winnScaffold generates model + CRUD controller + test file.
Run pending database migrations from db/migrations/*.winn.
winn migrate # run all pending
winn migrate --step 2 # run next 2
winn migrate --status # show applied vs pendingRollback database migrations.
winn rollback # rollback last
winn rollback --step 3 # rollback last 3Run project tasks. Rails-style colon syntax.
winn task db:seed
winn task db:migrateTasks are modules with use Winn.Task and a run/1 function in src/tasks/.
Install a Winn package.
winn add redis # from gregwinn/winn-redis
winn add github:user/winn-stripe # from any GitHub repoRemove an installed package.
winn remove redisList installed packages with version and module name.
Install all packages from package.json.
Available packages:
| Package | Install | Description |
|---|---|---|
| winn-redis | winn add redis |
Redis client |
| winn-mongodb | winn add mongodb |
MongoDB client |
| winn-amqp | winn add amqp |
RabbitMQ/AMQP client |
Format Winn source files for consistent code style.
winn fmt # format all .winn files in src/ (or current dir)
winn fmt src/app.winn # format a specific file
winn fmt --check # check formatting without modifying (exits 1 if unformatted)Run static analysis on Winn source files.
winn lint # lint all .winn files in src/ (or current dir)
winn lint src/app.winn # lint a specific fileRules checked:
| Rule | Category | Description |
|---|---|---|
unused_variable |
Correctness | Variable assigned but never referenced (prefix with _ to ignore) |
unused_import |
Correctness | Import directive with no calls to that module |
unused_alias |
Correctness | Alias directive with no calls using that alias |
function_name_convention |
Style | Function names must be snake_case (trailing ? allowed) |
module_name_convention |
Style | Module names must be PascalCase |
redundant_boolean |
Simplification | x == true can be simplified to x |
empty_function_body |
Correctness | Function with no body returns nil silently |
pipe_into_literal |
Correctness | Pipe |> into a non-callable value |
single_pipe |
Style | Single |> with no chain — consider a regular call |
large_function |
Complexity | Function body exceeds 50 expressions |
Exits with code 0 if no warnings, code 1 if warnings found.
Start the Language Server Protocol server on stdio. Provides IDE integration for editors that support LSP (VS Code, Neovim, Helix, etc.).
winn lsp # starts language server on stdioCapabilities:
- Diagnostics — inline compile errors from lexer, parser, semantic, and transform phases. Triggered on file open, change, and save.
- Autocomplete — dot-triggered completions for 14 modules: IO, String, Enum, List, Map, Server, HTTP, JSON, Logger, File, Repo, System, Task, Regex, Agent.
VS Code integration: In the Winn VS Code extension, set "winn.lsp.command": "winn lsp".
Generate Markdown API docs with a Mermaid module dependency graph.
winn docs # all src/*.winn → doc/api/
winn docs src/api.winn # single fileRun load tests with concurrent BEAM workers. Reports P50/P95/P99 latency.
winn bench bench/api_bench.winnLive terminal dashboard showing HTTP stats, BEAM health, and custom metrics.
Build a production OTP release.
winn release # build release
winn release --docker # generate DockerfileManage Erlang dependencies (lower-level than winn add).
winn deps list
winn deps add cowboy 2.12.0
winn deps remove cowboy
winn deps installInteractive REPL with variable persistence.
winn version # => winn 0.7.0
winn -v
winn --version| Code | Meaning |
|---|---|
| 0 | Success |
| 1 | Compilation error, runtime error, or unknown command |