A terminal user interface (TUI) tool that helps developers build structured prompts with code context for AI assistants like Claude, ChatGPT, and Gemini.
This tool allows you to:
- Browse your project files in an interactive file tree
- Select specific files to include in your prompt
- Write custom user prompts in a dedicated chat area
- Generate XML-formatted prompts with file context for better AI interactions
- Three-Panel Grid Layout: File tree, selected files, and chat input areas
- Interactive File Selection: Browse directories and select individual files
- Tab Navigation: Seamless switching between interface panels
- XML Output: Structured prompts with file tree, file contents, system prompts, and user input
- Smart File Filtering: Automatically ignores common build artifacts and hidden files
- Go 1.21 or later
- Terminal with color support
-
Clone or download this repository:
git clone <repository-url> cd coding-prompts-tui
-
Build the application:
go build -o prompter main.go
-
(Optional) Install globally:
go install .
The application uses the following Go modules:
github.com/charmbracelet/bubbletea- TUI frameworkgithub.com/charmbracelet/bubbles- TUI componentsgithub.com/charmbracelet/lipgloss- Styling and layout
Dependencies will be automatically downloaded when you run go build or go mod tidy.
Run the application with a target directory:
./prompter <directory>Examples:
# Use current directory
./prompter .
# Use specific project directory
./prompter /path/to/your/project
# Use relative path
./prompter ../my-projectThe TUI consists of three main panels:

- Tab - Move to next panel (File Tree → Selected Files → Chat → File Tree)
- Shift+Tab - Move to previous panel
- ↑/↓ Arrow Keys - Navigate up/down through files and folders
- Enter - Expand/collapse folders
- Space - Select/deselect files (files only, not folders)
- ↑/↓ Arrow Keys - Navigate through selected files
- x or Delete/Backspace - Remove file from selection
- Type - Enter your prompt text
- Ctrl+S - Generate XML prompt (future feature)
- Ctrl+C or q - Quit the application
- Navigate to files using arrow keys in the File Tree panel
- Expand folders by pressing Enter on directory items
- Select files by pressing Space on file items (not directories)
- View selections in the Selected Files panel
- Remove files from selection using x/Delete in the Selected Files panel
The application generates XML-structured prompts in this format:
<filetree>
[Complete directory tree structure]
</filetree>
<file name="path/to/selected/file.go">
[File contents]
</file>
<file name="path/to/another/file.js">
[Another file's contents]
</file>
<SystemPrompt>
[Content from personas/default.md]
</SystemPrompt>
<UserPrompt>
[Your custom prompt text]
</UserPrompt>The application automatically ignores common files and directories:
- Hidden files (starting with
.) node_modules/.git/- Build artifacts (
build/,dist/,target/) - Package caches (
__pycache__/,vendor/) - OS files (
.DS_Store,Thumbs.db)
- Operating System: Linux, macOS, Windows
- Terminal: Any terminal with ANSI color support
- Memory: Minimal (typically < 50MB)
- Disk Space: < 10MB for the binary
If you encounter build errors:
-
Verify Go version:
go version # Should be 1.21+ -
Clean and rebuild:
go clean go mod tidy go build -o prompter main.go
"No such file or directory" error:
- Ensure the target directory exists
- Use absolute paths if relative paths don't work
- Check directory permissions
Display issues:
- Ensure your terminal supports ANSI colors
- Try a different terminal if the interface appears garbled
- Resize terminal window if layout seems cramped
Performance issues with large projects:
- The application filters common build artifacts automatically
- For very large codebases, consider targeting specific subdirectories
.
├── main.go # Application entry point
├── go.mod # Go module definition
├── internal/
│ ├── tui/ # TUI components
│ │ ├── app.go # Main application model
│ │ ├── filetree.go # File tree panel
│ │ ├── selected.go # Selected files panel
│ │ └── chat.go # Chat input panel
│ └── filesystem/
│ └── scanner.go # Directory scanning utilities
├── personas/
│ └── default.md # Default system prompt
└── README.md # This file
# Run all tests
go test ./...
# Run with coverage
go test -cover ./...- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
[Add your license information here]
- XML prompt generation and export
- Custom system prompt selection
- File content preview
- Search functionality
- Configuration file support
- Multiple export formats
- Syntax highlighting in file preview