Installation
Prerequisites
Section titled “Prerequisites”- Zig 0.16.0 or later — Install Zig
- Git — for fetching dependencies via
build.zig.zon
Install the CLI
Section titled “Install the CLI”The pidgn CLI provides project scaffolding, code generation, a dev server, and database migrations.
curl -fsSL https://pidgn.seemsindie.com/install.sh | shInstall a specific version:
PIDGN_VERSION=v0.3.0-beta.1 curl -fsSL https://pidgn.seemsindie.com/install.sh | shgit clone https://github.com/seemsindie/pidgn_cli.gitcd pidgn_clizig build# Binary at zig-out/bin/pidgnPre-built binaries for macOS (arm64, x86_64) and Linux (x86_64, aarch64) are available on the Releases page.
Verify the installation:
pidgn versionCreate a new project
Section titled “Create a new project”-
Scaffold the project
Terminal window pidgn new my_appThis creates a full project structure:
my_app/build.zigbuild.zig.zon.gitignoresrc/main.zigcontrollers/templates/public/css/style.cssjs/app.js -
Build and run
Terminal window cd my_appzig build runYour server is now running at
http://127.0.0.1:4000. -
Start the dev server (with auto-reload)
Terminal window pidgn server
Add to an existing project
Section titled “Add to an existing project”If you already have a Zig project and want to add pidgn as a dependency:
- Add the dependency to your
build.zig.zon:
.dependencies = .{ .pidgn = .{ .url = "https://github.com/seemsindie/pidgn/archive/refs/tags/v0.1.0.tar.gz", .hash = "...", // zig build will tell you the expected hash },},- Wire it up in
build.zig:
const pidgn_dep = b.dependency("pidgn", .{ .target = target, .optimize = optimize,});
exe.root_module.addImport("pidgn", pidgn_dep.module("pidgn"));- Import and use:
const pidgn = @import("pidgn");Optional dependencies
Section titled “Optional dependencies”| Package | What it adds | How to enable |
|---|---|---|
| pidgn_db | Database (SQLite & PostgreSQL) | Add pidgn_db dependency |
| pidgn_jobs | Background job processing | Add pidgn_jobs dependency |
| pidgn_mailer | Email sending | Add pidgn_mailer dependency |
| pidgn_template | Template engine | Add pidgn_template dependency |
Next steps
Section titled “Next steps”- Follow the Quick Start tutorial
- Learn about Project Structure
- Explore Routing and Middleware