Skip to content

makt00/bunkrr-cli

Repository files navigation

🚀 Bunkrr CLI

A powerful command-line file uploader for bunkr.cr written in Go.

Go Version Platform Build

✨ Features

  • Parallel Uploads — Upload multiple files simultaneously with configurable workers
  • Chunked Uploads — Automatic file chunking for large files
  • Album Support — Create new albums or upload to existing ones
  • Interactive Mode — User-friendly interactive prompts for album selection
  • Progress Bar — Real-time upload progress with speed and ETA
  • Auto-Retry — Automatic retry with node switching on failure
  • Token Management — Save and reuse your API token securely

📦 Installation

Prerequisites

Build from Source

# Clone the repository
git clone https://github.com/makt00/bunkrr-cli.git
cd bunkrr-cli

# Build the binary
go build -o bunkrr-cli.exe .

# Or for Linux/macOS
go build -o bunkrr-cli .

🔧 Usage

Basic Command

# Upload a single file
./bunkrr-cli path/to/file.zip

# Upload a directory
./bunkrr-cli path/to/folder/

Command Line Flags

Flag Type Default Description
-token string "" Your Bunkr API token
-node string "" Manually specify upload node URL
-workers int 2 Number of parallel uploads
-album int 0 Album ID to upload to (0 = no album)

Examples

# Upload with API token
./bunkrr-cli -token YOUR_TOKEN file.zip

# Upload with 4 parallel workers
./bunkrr-cli -workers 4 path/to/folder/

# Upload to a specific album
./bunkrr-cli -album 12345 file.zip

# Specify a custom upload node
./bunkrr-cli -node https://n1.bunkr.cr/ file.zip

# Combine multiple options
./bunkrr-cli -token YOUR_TOKEN -workers 4 -album 12345 path/to/folder/

🔐 Token Management

The CLI supports multiple ways to provide your API token:

  1. Command Line — Use the -token flag
  2. Interactive Prompt — Enter when prompted and optionally save
  3. Stored Token — Automatically loads from ~/.bunkr-token

When you enter a token interactively, you'll be asked if you want to save it for future use. The token is stored securely in your home directory.

📁 Album Management

When authenticated with a token, you can:

Interactive Mode (default)

If no -album flag is provided, you'll see an interactive menu:

? Album Selection
  ▸ No Album
    Select Existing Album
    Create New Album

Select Existing Album

  • Browse your existing albums with search functionality
  • Use arrow keys to navigate, type to filter

Create New Album

You'll be prompted for:

  • Album Name — Required
  • Description — Optional
  • Enable Download — Allow others to download files
  • Public Link — Make the album publicly accessible

📊 Upload Progress

During upload, you'll see real-time progress:

[W1] [1/5] ▶ video.mp4 (1.2 GB, 12 chunk(s))
[W1]   [████████████░░░░░░░░░░░░░░░░░░] 40.5% | 8.2 MB/s | ETA: 2m35s | Chunk 5/12
[W1] [1/5] ✓ Done: https://bunkr.cr/v/abc123

Progress includes:

  • Worker ID[W1], [W2], etc.
  • File Counter[1/5] current/total files
  • Visual Progress Bar — Percentage complete
  • Upload Speed — Current transfer speed
  • ETA — Estimated time remaining
  • Chunk Progress — Current chunk / total chunks

🔄 Auto-Retry Mechanism

The CLI automatically handles upload failures:

  1. Retry on Same Node — Up to 3 attempts per node
  2. Switch Nodes — Tries up to 5 different nodes
  3. Total Attempts — Maximum 15 attempts per file

Failed uploads are reported in the final summary:

══════════════════════════════════════════
  ✓ Successful: 4   ✗ Failed: 1
══════════════════════════════════════════

🏗️ Project Structure

bunkrr-cli/
├── main.go           # CLI entry point and upload orchestration
├── go.mod            # Go module definition
├── go.sum            # Dependency checksums
└── bunkr/
    ├── client.go     # HTTP client and API methods
    └── types.go      # API request/response types

🔌 API Endpoints Used

Endpoint Method Description
/api/check GET Check API status and configuration
/api/node GET Get an available upload node
/api/albums GET List user's albums
/api/albums POST Create a new album
{node}/ POST Upload file chunks
{node}/finishchunks POST Finalize multi-chunk uploads

About

A bunkr.cr CLI file uploader written in Go

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages