Everything you need to know about using getctx to aggregate code context for AI tools.
getctx (Get Context) is a CLI tool written in Go that allows you to interactively select files and folders from your filesystem and concatenate their contents into a single output file. The primary use case is aggregating source code context for AI coding assistants, LLMs, bug reports, or documentation.
↑ / ↓EnterBackspaceSpaceCTRL+A/CTRL+PEscqCTRL+Cgetctx in your project directoryPress CTRL+P to type or paste paths directly. This is useful when you know exactly where you want to go.
Press / to activate filter mode and search through files instantly.
Specify a custom output file with the -o flag:
getctx automatically excludes common directories and files. The exclusion lists are defined in internal/config/config.go:
Ensure $GOPATH/bin is in your PATH:
Run with the --debug flag to generate debug.log:
Ensure your terminal supports ANSI colors and has sufficient dimensions. Minimum recommended size is 80x24.
Check out the GitHub repository for issues, discussions, and contributions.
View on GitHub