CLI Reference

Usage

gogo [options] [task...] [-- args...]

Multiple task names run in sequence. Each task is executed as if it were a separate gogo invocation — dependencies are not deduplicated across tasks, so gogo clean install runs clean, then install (including install’s own clean dep, if any).

Options

Flag Description
-l, --list List available tasks (only tasks with descriptions)
-w, --watch Watch sources and re-run on changes
-f, --force Ignore sources / generates and always run the task
-n, --dry Print commands without executing them
-y, --yes Auto-confirm task prompts (see Prompts)
--completion <shell> Print a shell completion script (bash, zsh, or fish)
--help Show help

Arguments

Argument Description
task... One or more tasks to run in sequence (default: default)
args... Extra arguments passed as {{.CLI_ARGS}} to every task (after --)

Examples

# Run the default task
gogo

# Run a specific task
gogo build

# Run several tasks in sequence
gogo clean install

# Run a namespaced task
gogo backend:test

# List tasks
gogo -l

# Dry run — see what would execute
gogo -n build

# Watch and re-run
gogo -w test

# Pass arguments to a task
gogo test -- -v -run TestFoo

Dry Run (-n, --dry)

gogo -n <task> prints every command that would run, in order, without executing it. Output looks like a normal task run minus the command’s own stdout/stderr:

$ gogo -n build
[build] go build -trimpath -ldflags "-s -w" -o bin/gogo .

Dry run skips command execution only — everything that decides whether a command should run still happens for real. In particular:

Dry run pairs naturally with -f to see the full plan after a clean: gogo -n -f build.

Force (-f, --force)

gogo -f <task> ignores sources: and generates: and runs the task even when its checksum (or output timestamps) say it’s up to date. The flag propagates through dependencies — gogo -f test re-runs build even if its sources are unchanged — so it’s the right hammer when you suspect the cache is stale.

-f does not affect:

Combine with -w to disable the up-to-date short-circuit during a watch loop, or with -n to dump the full plan as if from a clean state.

Task File Discovery

gogo walks up the directory tree from the current working directory and stops at the nearest ancestor that contains a gogo.yaml file. That directory becomes the project root, so you can run gogo from any subdirectory of your project.

Shell Completion

gogo can print completion scripts for bash, zsh, and fish. Source the script in your shell startup file:

bash

# ~/.bashrc
source <(gogo --completion bash)

zsh

# ~/.zshrc
source <(gogo --completion zsh)

Or drop the script into a directory on $fpath (e.g. ~/.zfunc/_gogo).

fish

gogo --completion fish > ~/.config/fish/completions/gogo.fish

Completion suggests every visible task name in the current gogo.yaml, including namespaced tasks like backend:build. Internal tasks (names starting with _) are excluded.

Edit this page on GitHub