Quick Start
This page walks from a fresh repo to a running posh shell in under a minute.
Prerequisites
poshon your$PATH— see Installation- Go 1.26+ for building the project shell binary
- Git —
posh initinfers your Go module path from the git remote
1. Initialise
$ cd path/to/your/project
$ posh initThis renders the scaffold into your repo. The notable additions:
.
├── .posh.yaml # configuration
├── .posh/
│ ├── main.go # your shell's entrypoint
│ ├── go.mod
│ ├── internal/
│ │ ├── plugin.go # the Plugin implementation
│ │ ├── command/ # custom commands (welcome.go is the seed)
│ │ └── config/ # typed config snippets
│ └── scripts/ownbrew/example.sh
└── Makefile # gains shell / shell.build targets if absentYou can re-run posh init --override to re-render after upgrading; --dry prints the file list without writing anything.
TIP
posh init must run inside a Go module. If you don't have one yet:
git init && git remote add origin <YOUR_REMOTE>
go mod init github.com/you/your-project
posh init2. Build the project shell
$ make shell.buildThis compiles .posh/main.go into bin/posh. From here on, bin/posh is your project's shell binary — distinct from the global posh you ran for init.
3. Open the shell
$ make shellYou should see a banner and prompt:
┓
┏┓┏┓┏┣┓
┣┛┗┛┛┛┗
┛
posh ›Try the built-ins:
posh › help
posh › welcome
Hi, thanks for using POSH!
posh › exit4. Add your first command
Edit .posh/internal/command/welcome.go (rename it to taste) or create a new file alongside. The minimum a command needs is Name, Description and Execute. Wire it up in .posh/internal/plugin.go:
inst.commands.MustAdd(
icommand.NewWelcome(l, icommand.WelcomeWithConfigKey("welcome")),
)
// add yours
inst.commands.MustAdd(
icommand.NewMyCommand(l),
)Rebuild and run:
$ make shell.build
$ make shell
posh › my-commandFor the full command authoring guide, see Writing Commands.
5. Pin your tools
.posh.yaml has an ownbrew.packages section. Add an entry for each external tool your project depends on:
ownbrew:
binDir: bin
tapDir: .posh/scripts/ownbrew
tempDir: .posh/tmp
cellarDir: .posh/bin
packages:
- name: gotsrpc
tap: foomo/tap/foomo/gotsrpc
version: 2.6.2Then in your shell:
posh › brewownbrew downloads, version-checks and symlinks the binary into bin/. The shell's PATH already includes ${PROJECT_ROOT}/bin, so the tool is immediately available.
Where next
- The Interactive Prompt — completion, history, aliases
- Configuration — every key in
.posh.yaml - Plugin Overview — how the pieces connect once you start customising
