Skip to content

milisp/treepick

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TreePick 🌲

Interactive file tree picker for AI CLI tools like Claude Code, OpenAI Codex, and Google Gemini CLI.

Features

  • 🌲 Interactive File Tree - Beautiful terminal-based file picker
  • Multi-select - Choose multiple files and folders easily
  • 🚀 AI Integration - Automatically passes selected files to AI tools
  • 🎯 Smart Filtering - Ignores common non-essential directories
  • Fast & Lightweight - Built with Node.js and blessed

Quick Start

npm

# Install dependencies
npm install

# Run the tool
npm start

# Or use directly
node bin/fselect.js

bun

# Install dependencies
bun i

# Link for global usage
bun link treepick

Usage

Basic Usage

# Start with default settings (scans current directory for Claude)
treepick

# Specify a different directory  
treepick -d /path/to/your/project

# Use with different AI tools
treepick -t codex    # OpenAI Codex
treepick -t gemini   # Google Gemini CLI

# Dry run (see selected files without executing)
treepick --dry-run

Interactive Controls

Key Action
↑/↓ Navigate through files
Space Select/deselect file or folder
Enter Confirm selection and start AI tool
Ctrl+A Select all files
Ctrl+D Clear all selections
Esc or Q Cancel and exit

How It Works

  1. File Tree Display - Shows your project structure in an interactive tree
  2. Multi-Select - Use spacebar to select files and folders you want to work with
  3. AI Integration - Automatically starts your chosen AI tool (Claude, Codex, etc.)
  4. File Context - Selected files are automatically added using the tool's syntax (e.g., @file.js)
  5. Interactive Session - You can then chat with the AI about your selected files

Example Workflow

$ treepick
# Interactive file tree appears
# Select src/components/Header.jsx
# Select src/utils/api.js  
# Select README.md
# Press Enter

🚀 Starting claude...
📎 Adding 3 files to claude...
✅ Files added successfully!

# Claude starts with: @src/components/Header.jsx @src/utils/api.js @README.md 
# You can now type: "Please review these files for potential bugs"

Configuration

The tool automatically ignores common directories:

  • node_modules
  • .git
  • .next
  • target
  • dist
  • build
  • .venv
  • __pycache__

Supported AI Tools

  • Claude Code (claude) - Anthropic's terminal coding assistant
  • OpenAI Codex (codex) - OpenAI's CLI coding tool
  • Google Gemini (gemini) - Google's CLI tool
  • Easily extensible for other tools

Requirements

  • Node.js 16+
  • The AI tool you want to use must be installed and accessible in PATH
    • For Claude Code: Follow installation guide
    • For OpenAI Codex: npm install -g @openai/codex
    • For Google Gemini: Install Google AI CLI

Installation

# Install globally from npm
npm install -g treepick

# Or for development
cd /path/to/treepick
npm install
npm link

Development

# Run in development mode
npm run dev

# Test with dry run
npm start -- --dry-run

License

MIT License - feel free to use and modify!

Contributing

This is an MVP - contributions welcome! Areas for improvement:

  • Better error handling
  • Configuration file support
  • More AI tool integrations
  • Performance optimizations
  • Tests

Made for developers who want to work smarter with AI tools 🚀

About

Interactive file tree picker for Claude Code and Gemini cli, codex and more

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published