ranoz-go

command module
v1.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 19, 2026 License: MIT Imports: 18 Imported by: 0

README

ranoz-go

CLI tool for uploading files to Ranoz.gg

Install

Via Go install
go install github.com/Drenzzz/ranoz-go@latest
Pre-built binaries

Download from GitHub Releases:

# Linux (amd64)
curl -LO https://github.com/Drenzzz/ranoz-go/releases/latest/download/ranoz-go-v1.1.0-linux-amd64.tar.gz
tar xzf ranoz-go-v1.1.0-linux-amd64.tar.gz
sudo mv ranoz-go /usr/local/bin/

# macOS (Apple Silicon)
curl -LO https://github.com/Drenzzz/ranoz-go/releases/latest/download/ranoz-go-v1.1.0-darwin-arm64.tar.gz
tar xzf ranoz-go-v1.1.0-darwin-arm64.tar.gz
sudo mv ranoz-go /usr/local/bin/

# Windows (PowerShell)
Invoke-WebRequest -Uri "https://github.com/Drenzzz/ranoz-go/releases/latest/download/ranoz-go-v1.1.0-windows-amd64.zip" -OutFile ranoz-go.zip
Expand-Archive ranoz-go.zip -DestinationPath C:\Users\$env:USERNAME\bin
From source
git clone https://github.com/Drenzzz/ranoz-go.git
cd ranoz-go
make build
sudo mv ranoz-go /usr/local/bin/

Usage

ranoz-go <file> [file2 ...]
ranoz-go --workers <1-32> <file> [file2 ...]
ranoz-go --retries <0-10> <file> [file2 ...]
ranoz-go --json <file> [file2 ...]
ranoz-go --info <file-id>
ranoz-go --help
ranoz-go --version

Examples

# Upload an image
ranoz-go image.png
# Output: https://ranoz.gg/file/ABC123

# Upload with 4 workers
ranoz-go --workers 4 image.png document.pdf archive.zip

# Upload with no retries
ranoz-go --retries 0 image.png

# Get file info by ID
ranoz-go --info ABC123

# JSON output for scripting
ranoz-go --json image.png
ranoz-go --json --info ABC123

# Pipe JSON to jq
ranoz-go --json *.png | jq '.summary'

Environment Variables

Variable Description Default
RANOZ_BASE_URL API base URL https://ranoz.gg/api/v1/files
RANOZ_WORKERS Default worker count 3
RANOZ_RETRIES Default retry count 2

CLI flags always take precedence over environment variables.

# Use a custom API endpoint
RANOZ_BASE_URL=https://my-instance.example.com/api/v1/files ranoz-go file.png

# Default 8 workers for all uploads
export RANOZ_WORKERS=8
ranoz-go *.png

Build

# Standard build
make build

# Run tests
make test

# Run linter
make lint

# Clean build artifacts
make clean

For release builds with version metadata:

go build -ldflags="-s -w \
  -X main.version=1.1.0 \
  -X main.commit=$(git rev-parse --short HEAD) \
  -X main.buildDate=$(date -u +%Y-%m-%dT%H:%M:%SZ)" \
  -o ranoz-go .

Tips

  • Batch upload: Loop through multiple files

    for f in *.png; do ranoz-go "$f"; done
    
  • Tune upload concurrency:

    ranoz-go --workers 1 bigfile.zip
    ranoz-go --workers 6 *.png
    

    Use lower workers for very large files, and higher workers for many small files.

  • Auto copy URL to clipboard:

    ranoz-go file.png | grep URL | cut -d' ' -f2 | xclip -selection clipboard
    
  • Upload from another directory:

    ranoz-go /path/to/file.pdf
    

Notes

  • Uploads are streamed directly from disk (no full file read into memory), so RAM usage stays more stable on large files.
  • The CLI gracefully handles Ctrl+C during uploads.
  • HTTP requests have a 30s timeout for API calls and 10min for uploads.

License

MIT License - see LICENSE for details.

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL