Skip to content

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.

The quickest way to install on macOS or Linux:

Terminal window
curl -fsSL https://pidgn.seemsindie.com/install.sh | sh

To install a specific version:

Terminal window
PIDGN_VERSION=v0.3.0-beta.1 curl -fsSL https://pidgn.seemsindie.com/install.sh | sh
CommandAliasDescription
pidgn new <name>Create a new pidgn project with full directory structure
pidgn serverpidgn sStart 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 migrateRun pending database migrations
pidgn migrate rollbackRoll back the last migration
pidgn migrate statusShow current migration status
pidgn routesList all application routes
pidgn swaggerExport the OpenAPI specification as JSON
pidgn testRun project tests via zig build test
pidgn depsList workspace dependencies
pidgn versionPrint the CLI version
Terminal window
pidgn new blog
cd blog
pidgn gen model Post title:string content:text published:boolean
pidgn gen controller Posts
pidgn gen channel Comments
pidgn migrate
pidgn server

After 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.

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)