DGF (Direct Git Fetch) is a powerful tool for downloading files and folders directly from GitHub repositories. Version 2.0 introduces an interactive terminal UI (TUI) with visual file browsing, search, and multi-select capabilities, while maintaining full backward compatibility with the CLI interface.
- π₯οΈ Interactive TUI - Beautiful terminal UI with Tokyo Night theme
- π Real-time Search - Filter files instantly with
/key - π Visual Selection - Multi-select with intuitive keyboard controls
- ποΈ File Preview - Preview text files with syntax highlighting and line numbers
- β‘ Parallel Downloads - Fast concurrent downloads with progress tracking
- π§ Config Management - Persistent settings with
dgf configcommand - π€ Agent/JSON Mode - Machine-readable output for automation
- π¦ Git LFS Support - Automatic detection and download of LFS files
- π¨ Enhanced UX - Smooth animations, improved navigation, comprehensive help
- π― Smart Navigation - Vim-like keybindings with j/k/l/h alternatives
# Launch the interactive TUI
dgf
# Or start with a URL
dgf https://github.com/user/repo# Download files with CLI flags
dgf https://github.com/user/repo -f code -o ./output
# Using component flags
dgf -s github -u user -r repo -p src/| Key | Action |
|---|---|
β/β |
Navigate up/down |
j / J / β |
Navigate back to parent folder |
l / L / β |
Enter folder |
k / K / Space |
Toggle selection |
i / I |
Inverse selection (requires confirmation) |
Enter |
Download selected items |
a |
Select all |
u |
Unselect all |
/ |
Search/filter files |
p |
Preview file |
o / O |
Toggle icons (emoji/ASCII) |
r |
Refresh current view |
? |
Show help screen |
Esc |
Cancel/Back |
q / Ctrl+C |
Quit |
# Show all config
dgf config show
# Get a specific value
dgf config get token
# Set values
dgf config set token ghp_xxxxx
dgf config set download_path ./downloads
dgf config set workers 10
dgf config set ascii_mode true
# Show config file location
dgf config path# Get repository tree as JSON
dgf agent tree https://github.com/user/repo
# Download specific files programmatically
dgf agent download https://github.com/user/repo README.md src/main.go --out ./output- bash (Linux, macOS, or WSL on Windows)
- curl and jq (required for the installer script)
- sudo privileges for system-wide install (optional)
# Download installer
curl -LO https://raw.githubusercontent.com/NeerajCodz/dgf/main/dgf-installer.sh
chmod +x dgf-installer.sh
# Install latest version
sudo ./dgf-installer.sh
# Install specific version
sudo ./dgf-installer.sh -v 2.0.0sudo ./dgf-installer.sh --uninstalldgf Launch interactive TUI
dgf <URL> Download from URL (CLI mode)
dgf -s <site> -u <user> -r <repo> Download using components (CLI mode)
dgf config <get|set|show> [key] [val] Manage configuration
dgf agent <tree|download> <url> ... JSON API mode for scripts
| Flag | Short | Description |
|---|---|---|
--site |
-s |
Platform ID (e.g., github) |
--username |
-u |
Repository owner |
--repo |
-r |
Repository name |
--token |
-t |
GitHub token |
--branch |
-b |
Branch name |
--commit |
-c |
Commit SHA |
--path |
-p |
Path in repository |
--output |
-o |
Output directory |
--format |
-f |
File formats |
--no-print |
-n |
Silent mode |
--print-tree |
Print directory tree | |
--check |
Check if path exists | |
--print-info |
-i |
Print repo info as JSON |
--help |
-h |
Show help |
For private repositories:
# Using environment variable (recommended)
export GITHUB_TOKEN=your_token_here
dgf https://github.com/user/private-repo
# Using --token flag
dgf https://github.com/user/private-repo -t your_token_here
# Using config (persisted)
dgf config set token your_token_hereThe --format option accepts categories or comma-separated extensions:
- image: jpg, jpeg, png, gif, svg, webp, ...
- video: mp4, avi, mkv, mov, webm, ...
- audio: mp3, wav, aac, flac, ...
- document: pdf, doc, docx, txt, md, ...
- code: html, css, js, ts, py, go, rs, ...
- archive: zip, rar, tar, gz, ...
Example:
# Download only images
dgf https://github.com/user/repo -f image
# Download specific extensions
dgf https://github.com/user/repo -f [jpg,png,svg]# Browse a repository interactively
dgf https://github.com/golang/go
# Browse and search for specific files
# Press / and type "readme" to filter# Download all Go source files
dgf -s github -u golang -r go -p src -f go
# Download specific folder
dgf https://github.com/user/repo/tree/main/docs -o ./local-docs
# Check if a path exists
dgf -s github -u user -r repo -p src/main.go --check# Get file list as JSON
files=$(dgf agent tree https://github.com/user/repo)
# Download files programmatically
dgf agent download https://github.com/user/repo README.md LICENSE --out ./deps- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing - Commit changes:
git commit -m 'Add amazing feature' - Push:
git push origin feature/amazing - Open a Pull Request
MIT License - see LICENSE file.
- GitHub: @NeerajCodz
- Issues: github.com/NeerajCodz/dgf/issues