A visually polished CLI tool for quickly cloning git repositories to /tmp for exploration.
- GitHub shorthand -
rails/railsexpands tohttps://github.com/rails/rails - Shallow clone (
--depth 1) for fast downloads - Branch support - clone specific branches with
-b - Organized storage at
/tmp/tmp-git-clone/{owner}/{repo} - Beautiful UI with animated spinners and progress tracking
- Real-time progress parsing (Counting → Compressing → Receiving)
- Auto-cleanup - re-cloning removes existing directory first
- Copy to clipboard - automatically copy the cloned path
- Clone history - track recently cloned repositories
- Config file - set default behaviors
- Quiet mode for scripting
curl -fsSL https://raw.githubusercontent.com/wdavidturner/tmp-git-clone/main/install.sh | bashThis installs to ~/.local/share/tmp-git-clone and creates a symlink at ~/.local/bin/tmp-git-clone.
Make sure ~/.local/bin is in your PATH:
export PATH="$HOME/.local/bin:$PATH"# Clone this repo
git clone https://github.com/wdavidturner/tmp-git-clone.git
cd tmp-git-clone
# Install dependencies and build
npm install
npm run build
# Link globally
npm linkcurl -fsSL https://raw.githubusercontent.com/wdavidturner/tmp-git-clone/main/uninstall.sh | bash# Clone using GitHub shorthand
tmp-git-clone rails/rails
# Clone a repository with full URL
tmp-git-clone https://github.com/rails/rails
# SSH URLs work too
tmp-git-clone git@github.com:rails/rails.git
# Clone a specific branch
tmp-git-clone -b 7-2-stable rails/rails
# Custom clone depth
tmp-git-clone --depth 10 rails/rails
# Copy path to clipboard after clone
tmp-git-clone -c rails/rails
# Quiet mode (outputs only the path)
tmp-git-clone -q rails/railsThe tool provides a clean, boxed output with real-time progress:
╭────────────────────────────────────────────────╮
│ │
│ rails/rails │
│ github.com │
│ │
╰────────────────────────────────────────────────╯
⠋ Receiving 67% 12.4 MiB
╭────────────────────────────────────────────────╮
│ │
│ ✔ Cloned successfully │
│ │
│ → /tmp/tmp-git-clone/rails/rails │
│ │
╰────────────────────────────────────────────────╯
This tool pairs well with AI coding assistants. Slash commands are included for Claude Code, Codex, and GitHub Copilot.
Copy the included command to your Claude commands directory:
cp claude-clone-git-repo.md ~/.claude/commands/clone-git-repo.mdAuto-Approve Permissions (Optional)
To skip permission prompts, add this to your ~/.claude/settings.json:
{
"permissions": {
"allow": [
"Bash(tmp-git-clone:*)",
"Glob(/tmp/tmp-git-clone/**)",
"Read(/tmp/tmp-git-clone/**)"
]
}
}Usage:
/clone-git-repo rails/rails
Copy the included command to your Codex commands directory:
cp codex-clone-git-repo.md ~/.codex/commands/clone-git-repo.mdUsage:
/clone-git-repo rails/rails
For Copilot Chat in VS Code, add the instructions to your workspace settings or use as a custom instruction:
# View the prompt template
cat copilot-clone-git-repo.mdThen in Copilot Chat, you can reference it or paste the instructions into your custom instructions settings.
Usage in Copilot Chat:
Clone and explore rails/rails using tmp-git-clone
All commands will:
- Clone the repository
- Read the README
- Show the directory structure
- Provide a summary of the project
| Option | Description |
|---|---|
-d, --depth <n> |
Clone depth (default: 1) |
-b, --branch <name> |
Branch to clone |
-c, --copy |
Copy path to clipboard after clone |
-q, --quiet |
Suppress output, print only the cloned path |
-V, --version |
Show version number |
-h, --help |
Show help |
| Command | Description |
|---|---|
tmp-git-clone list |
List all cloned repositories in /tmp/tmp-git-clone |
tmp-git-clone clean |
Remove all cloned repositories (use --yes to skip confirmation) |
tmp-git-clone history |
Show clone history (use --clear to clear) |
tmp-git-clone config |
Show current configuration |
tmp-git-clone upgrade |
Upgrade to the latest version |
# List all clones
tmp-git-clone list
# Clean all clones (with confirmation)
tmp-git-clone clean
# Clean all clones (skip confirmation)
tmp-git-clone clean --yes
# Show clone history
tmp-git-clone history
# Clear clone history
tmp-git-clone history --clear
# Show config
tmp-git-clone config
# Upgrade to latest version
tmp-git-clone upgradeConfiguration is stored at ~/.tmp-git-clone/config.json. Create this file to set default behaviors:
{
"copy": true,
"depth": 1,
"defaultBranch": null
}| Setting | Type | Description |
|---|---|---|
copy |
boolean | Always copy path to clipboard after clone |
depth |
number | Default clone depth |
defaultBranch |
string | null | Default branch to clone |
CLI flags always override config file settings.
Clone history is stored at ~/.tmp-git-clone/history.json. The tool tracks the last 50 cloned repositories with timestamps.
- Fast SSD-backed storage on most systems
- Auto-cleaned on reboot
- Keeps your workspace uncluttered
- Perfect for quick code exploration
- Node.js 18+
- Git
MIT