Skip to content

NeerajCodz/dgf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

48 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

DGF (Direct Git Fetch) v2.0

Overview

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.

What's New in v2.0

  • πŸ–₯️ 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 config command
  • πŸ€– 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

Quick Start

Interactive Mode (NEW!)

# Launch the interactive TUI
dgf

# Or start with a URL
dgf https://github.com/user/repo

CLI Mode (Backward Compatible)

# 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/

Features

Interactive TUI Controls

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

Config Management

# 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

Agent/JSON Mode

# 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

Installation

Prerequisites

  • bash (Linux, macOS, or WSL on Windows)
  • curl and jq (required for the installer script)
  • sudo privileges for system-wide install (optional)

Install or Update DGF

# 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.0

Uninstall

sudo ./dgf-installer.sh --uninstall

CLI Reference

dgf                                    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

Options

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

Token Usage

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_here

Supported File Formats

The --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]

Examples

Interactive Use Cases

# Browse a repository interactively
dgf https://github.com/golang/go

# Browse and search for specific files
# Press / and type "readme" to filter

CLI Use Cases

# 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

Scripting

# 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

Contributing

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature/amazing
  3. Commit changes: git commit -m 'Add amazing feature'
  4. Push: git push origin feature/amazing
  5. Open a Pull Request

License

MIT License - see LICENSE file.

Contact

About

Direct Git Fetch - Allows you to fetch git files and folder directly without cloning whole repo

Resources

License

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors