8000 GitHub - shuymn/phantom: A powerful CLI tool for seamless parallel development with Git worktrees.
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

shuymn/phantom

ย 
ย 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ‘ป phantom-rs

A powerful CLI tool for seamless parallel development with Git worktrees

License: MIT Rust Version

ๆ—ฅๆœฌ่ชž โ€ข Installation โ€ข Why Phantom? โ€ข Basic Usage โ€ข Documentation

Phantom demo

โœจ What is Phantom?

Phantom is a powerful CLI tool that dramatically boosts your development productivity by making Git worktrees simple and intuitive. Run multiple tasks in isolated environments simultaneously and achieve true multitask development. Built for the next generation of parallel development workflows, including AI-powered coding with multiple agents.

Key Features

  • ๐Ÿš€ Simple worktree management - Create and manage Git worktrees with intuitive commands
  • ๐Ÿ”„ True multitasking - Create separate working directories per branch and run multiple tasks simultaneously
  • ๐ŸŽฏ Execute commands from anywhere - Run commands in any worktree with phantom exec <worktree> <command>
  • ๐ŸชŸ Terminal multiplexer integration - Built-in support for tmux and kitty terminal
  • ๐Ÿ” Interactive selection with fzf - Use built-in fzf option for worktree selection
  • ๐ŸŽฎ Shell completion - Full autocomplete support for Fish, Zsh, and Bash
  • โšก Zero runtime dependencies - Single static binary
  • ๐Ÿฆ€ Memory safe - Written in Rust for reliability and performance

๐Ÿš€ Installation

From Source (Clone and Build)

git clone https://github.com/shuymn/phantom-rs.git
cd phantom-rs
cargo build --release
sudo cp target/release/phantom /usr/local/bin/

Using Cargo

cargo install --git https://github.com/shuymn/phantom-rs

Pre-built Binaries

Download pre-built binaries from the Releases page.

๐Ÿค” Why Phantom?

Git worktrees are powerful but require manual management of paths and branches. Also, navigating between multiple worktrees is cumbersome. Phantom eliminates these problems:

# Without Phantom
git worktree add -b feature-awesome ../project-feature-awesome origin/main
cd ../project-feature-awesome

# With Phantom
phantom create feature-awesome --shell

How Phantom Works

When you run phantom create feature-awesome, a new Git worktree named feature-awesome is created in .git/phantom/worktrees/. All worktrees created with phantom are centrally managed in this location.

your-project/    # Git repository
โ”œโ”€โ”€ .git/
โ”‚   โ””โ”€โ”€ phantom/
โ”‚       โ””โ”€โ”€ worktrees/        # Phantom-managed directory
โ”‚           โ”œโ”€โ”€ feature-awesome/  # branch name = worktree name
โ”‚           โ”œโ”€โ”€ bugfix-login/     # another worktree
โ”‚           โ””โ”€โ”€ hotfix-critical/  # yet another worktree
โ””โ”€โ”€ ...

This convention means you never need to remember worktree paths - just use the branch name for easy worktree operations.

โœˆ๏ธ Features for a Comfortable Development Experience

Phantom provides perfect functionality as a command-line tool. Developers feel the trust and comfort of flying first class.

Shell Completion

Phantom supports full shell completion for fish and zsh. Use tab key to complete commands and worktree names.

Terminal Multiplexer Integration

Phantom supports both tmux and kitty terminal for advanced window management. This allows you to manage multiple work environments simultaneously.

tmux Integration:

# Create and open worktree in new window
phantom create feature-x --tmux
# Create with split panes
phantom create feature-y --tmux-vertical
phantom create feature-z --tmux-horizontal

# Open existing worktrees in tmux
phantom shell feature-x --tmux
phantom shell feature-y --tmux-v

Phantom tmux integration

Kitty Integration:

# Open in new tab
phantom shell feature-xyz --kitty

# Split vertically
phantom shell feature-xyz --kitty-vertical

# Execute command in horizontal split
phantom exec feature-xyz --kitty-horizontal npm run dev

Editor Integration

Phantom works seamlessly with editors like VS Code and Cursor. You can specify an editor to open worktrees.

# Open with VS Code
phantom create feature --exec "code ."

# Or open existing worktree
phantom exec feature code .

# Open with Cursor
phantom create feature --exec "cursor ."
phantom exec feature cursor .

Phantom VS Code integration

fzf Integration

Interactive search with fzf allows quick worktree selection.

# Open shell with fzf selection
phantom shell --fzf

# Delete with fzf selection
phantom delete --fzf

๐Ÿ” Basic Usage

Create a new worktree

phantom create feature-awesome

phantom list

Start a new shell in the worktree

phantom shell featu
7545
re-awesome

# Start development work

# Exit the shell when done
exit

Run commands in any worktree

phantom exec feature-awesome {command to run}
# Example: phantom exec feature-awesome npm run build

Clean up when done

phantom delete feature-awesome

๐Ÿ“š Documentation

๐Ÿค Contributing

Contributions are welcome! See our Contributing Guide for:

  • Development setup
  • Code style guidelines
  • Testing requirements
  • Pull request process

โš ๏ธ Disclaimer

phantom-rs is an unofficial Rust port created as a personal learning project. While it aims to provide similar functionality to the original phantom:

  • No guarantee of feature parity with the original TypeScript version
  • No promise of identical behavior for equivalent features
  • Breaking changes may occur as the project evolves
  • Use at your own risk in production environments

This project serves as both a functional tool and a Rust learning exercise.

๐Ÿ“„ License

MIT License - see LICENSE

๐Ÿ™ Acknowledgments

phantom-rs is a Rust port of the original phantom by @aku11i. The demonstration GIFs and core functionality remain faithful to the original implementation.

  • Original TypeScript implementation: @aku11i
  • Rust port and enhancements: @shuymn

About

A powerful CLI tool for seamless parallel development with Git worktrees.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Rust 99.7%
  • Other 0.3%
0