CLI Overview
The pidgn CLI is the companion tool for the pidgn web framework. It handles project scaffolding, code generation, database migrations, a development server with auto-reload, and utility commands for inspecting routes, running tests, and exporting OpenAPI specs.
Installation
Section titled “Installation”The quickest way to install on macOS or Linux:
curl -fsSL https://pidgn.seemsindie.com/install.sh | shTo install a specific version:
PIDGN_VERSION=v0.3.0-beta.1 curl -fsSL https://pidgn.seemsindie.com/install.sh | shDownload a pre-built binary for your platform from the Releases page.
Binaries are available for:
- macOS (arm64, x86_64)
- Linux (x86_64, aarch64)
Clone the repository and build with Zig:
git clone https://github.com/seemsindie/pidgn_cli.gitcd pidgn_clizig build# Binary is at zig-out/bin/pidgnRequires Zig 0.16.0-dev.2535+b5bd49460 or later.
Available commands
Section titled “Available commands”| Command | Alias | Description |
|---|---|---|
pidgn new <name> | Create a new pidgn project with full directory structure | |
pidgn server | pidgn s | Start a development server with auto-reload |
pidgn gen controller <Name> | Generate a RESTful controller | |
pidgn gen model <Name> [field:type ...] | Generate a database model and migration | |
pidgn gen channel <Name> | Generate a WebSocket channel | |
pidgn gen mailer <Name> [--template] | Generate an email mailer module | |
pidgn migrate | Run pending database migrations | |
pidgn migrate rollback | Roll back the last migration | |
pidgn migrate status | Show current migration status | |
pidgn routes | List all application routes | |
pidgn swagger | Export the OpenAPI specification as JSON | |
pidgn test | Run project tests via zig build test | |
pidgn deps | List workspace dependencies | |
pidgn version | Print the CLI version |
Quick-start workflow
Section titled “Quick-start workflow”pidgn new blogcd blogpidgn gen model Post title:string content:text published:booleanpidgn gen controller Postspidgn gen channel Commentspidgn migratepidgn serverAfter running these commands you will have a working project with a Post model, a RESTful Posts controller, a Comments WebSocket channel, and a development server listening on http://127.0.0.1:4000.
Project requirements
Section titled “Project requirements”The pidgn CLI and generated projects require:
- Zig 0.16.0-dev.2535+b5bd49460 or later
- pidgn.zig framework (pulled in automatically via
build.zig.zon)
Next steps
Section titled “Next steps”- Create a new project with
pidgn new - Generate code with
pidgn gen - Run migrations with
pidgn migrate - Start the dev server with
pidgn server