chi is distributed as a standard Go module and requires no external dependencies beyond the Go standard library. Installation is a singleDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/go-chi/chi/llms.txt
Use this file to discover all available pages before exploring further.
go get command, and the module integrates cleanly into any existing Go project that uses Go modules (go.mod).
Requirements
chi v5 targets the four most recent major Go releases and currently requires Go 1.23 or later. Check your installed version with:github.com/go-chi/chi) supports earlier releases, but v5 is strongly recommended for all new projects.
Install
Inside your Go module project directory, run:go.mod, and writes the resolved checksum to go.sum. After the command completes, your go.mod will contain:
go.mod
If your project does not yet have a
go.mod file, initialize one first with go mod init your/module/name, then run the go get command above.Zero external dependencies
chi pulls in no third-party packages. Every feature — the router, the middleware package, URL parameter parsing — is implemented using the Go standard library only. You can verify this after installation:github.com/go-chi/chi/v5 with no transitive dependencies. This keeps your build reproducible and your go.sum minimal.
Import path
Once installed, import chi and its middleware sub-package in your Go source files:main.go
Upgrading from v4 to v5
chi v5 introduced Go module Semantic Import Versioning (SIV). The only breaking change between v4 and v5 is the import path — the entire public API is identical.- Before (v4)
- After (v5)
Update all import paths
Use your editor’s find-and-replace, or run the following command to update all Go files at once:
Remove the old v4 dependency
go mod tidy will drop the github.com/go-chi/chi (v4) entry from go.mod and go.sum once no import paths reference it anymore.Optional ecosystem packages
After installing the core router, you can add any of chi’s first-party companion packages the same way — each is an independent module with its own versioning:The full list of official chi ecosystem packages is maintained at https://github.com/go-chi.