← Demos

Getting started

Write an extension in Go

pig extension init creates a Go extension; pig -e builds and loads it.

0:22 · pig 0.7.0 · recorded 2026-11-08 · model replies are scripted; tool calls and commands are real · captions in English, under the clip

What you are seeing

  • pig extension init ./hello --lang go creates two files: extension.go and go.mod.
  • pig -e ./hello builds the extension (pig builds Go extensions on first use) and loads it. The wait for the build is shown at 4x speed.
  • The extension adds a /hello command. Running it prints the extension's reply.

Try it yourself

  1. Create a Go extension

    pig extension init ./hello --lang go
  2. Load it

    pig -e ./hello

Files: MP4 · WebM · Captions (VTT) · PiG source

Next: Script pig: print and JSON modes