npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@adbjs/cli

v1.1.1

Published

Command-line interface for AllDebrid API

Readme

@adbjs/cli

Command-line interface for AllDebrid API v4.1 - manage your torrents, links, and account from the terminal.

✨ Features

  • 🔥 Complete API Coverage - Magnets, links, user management, hosts, and vouchers
  • 🎨 Interactive Mode - User-friendly prompts with beautiful TUI
  • 📊 Real-time Monitoring - Watch torrent progress with live updates
  • 🔧 JSON Output - --json flag for shell scripting and automation
  • Delta Sync - Efficient polling with session-based updates
  • 🔐 Secure Auth - PIN-based authentication with local config storage
  • 💻 Cross-platform - Works on Windows, macOS, and Linux

📦 Installation

Via npm (requires Node.js)

npm install -g @adbjs/cli
# or
bun add -g @adbjs/cli
# or
pnpm add -g @adbjs/cli

Standalone executables (no runtime required)

Download the latest binary for your platform from GitHub Releases:

| Platform | Download | | --------------------------- | --------------------- | | Windows x64 | adb-windows-x64.exe | | Linux x64 | adb-linux-x64 | | Linux ARM64 | adb-linux-arm64 | | macOS x64 | adb-darwin-x64 | | macOS ARM64 (Apple Silicon) | adb-darwin-arm64 |

# Linux/macOS: Make executable and run
chmod +x adb-linux-x64
./adb-linux-x64 --version

# Windows: Just run
adb-windows-x64.exe --version

🚀 Quick Start

# Authenticate with AllDebrid
adb auth login

# Upload a magnet link
adb magnet upload "magnet:?xt=urn:btih:..."

# Check magnet status
adb magnet list

# Get download links
adb magnet files 12345

🔐 Authentication

The CLI uses PIN-based authentication. Run the login command and follow the instructions:

adb auth login

This will:

  1. Generate a PIN code
  2. Display a URL to visit
  3. Wait for you to authorize the application
  4. Save the API key securely

You can also use an environment variable:

export ALLDEBRID_API_KEY=your-api-key
adb user info

Or pass it directly:

adb --api-key your-api-key user info

Priority order: CLI flag > Environment variable > Saved config

Auth Commands

adb auth login     # Interactive PIN-based login
adb auth logout    # Clear saved credentials
adb auth status    # Check authentication status

📖 Commands

Magnet Commands

# Upload magnet or torrent file
adb magnet upload <magnet-link>
adb magnet upload ./file.torrent

# List all magnets
adb magnet list
adb magnet list --status active    # Filter by status: active, ready, expired, error

# Get status of a specific magnet
adb magnet status <id>

# Monitor all magnets with delta sync (for scripting)
adb magnet status --live
adb magnet status --live --session 123 --counter 5

# Watch magnet progress in real-time
adb magnet watch <id>

# Get download links for completed magnet
adb magnet files <id>

# Delete a magnet
adb magnet delete <id>

# Restart a failed magnet
adb magnet restart <id>

# Interactive mode
adb magnet

Link Commands

# Unlock a premium link
adb link unlock <url>
adb link unlock <url> --password secret

# Get link information
adb link info <url>

# Get streaming link
adb link stream <id> <quality>

# Extract links from redirector
adb link redirector <url>

# Interactive mode
adb link

User Commands

# Display account information
adb user info

# List saved links
adb user saved list

# Save a link
adb user saved add <url>

# Delete saved link(s)
adb user saved delete <url>

# View download history
adb user history

# Clear download history
adb user history clear

# Interactive mode
adb user

Host Commands

# List all supported hosts
adb host list
adb host list --hosts-only    # Only show hosts (no streams/redirectors)

# List all supported domains
adb host domains

Voucher Commands (Reseller)

# Check voucher balance
adb voucher balance

# List vouchers
adb voucher list
adb voucher list --quantity 10

# Generate vouchers
adb voucher generate <quantity> <days>

# Interactive mode
adb voucher

⚙️ Global Options

--api-key <key>    # Override API key
--json             # Output in JSON format (for scripting)
--help             # Show help
--version          # Show version

🔧 JSON Output

Use the --json flag for machine-readable output, perfect for shell scripting:

# Get magnet list as JSON
adb --json magnet list

# Parse with jq
adb --json magnet status 12345 | jq '.status'

# Use in scripts
STATUS=$(adb --json magnet status 12345 | jq -r '.status')
if [ "$STATUS" = "Ready" ]; then
  echo "Download complete!"
fi

JSON mode:

  • Outputs raw API responses as formatted JSON
  • Disables spinners and colored output
  • Skips confirmation prompts (for delete operations)
  • Outputs errors as {"error": "message"}

⚡ Delta Sync for Monitoring

The --live flag uses AllDebrid's delta sync API for efficient polling:

# First call - gets full list
adb --json magnet status --live
# Returns: { "magnets": [...], "session": 123456, "counter": 1, "fullsync": true }

# Subsequent calls - only changed magnets
adb --json magnet status --live --session 123456 --counter 1
# Returns: { "magnets": [...], "counter": 2, "fullsync": false }

This is more bandwidth-efficient than polling the full list repeatedly.

🎨 Interactive Mode

Run any command group without arguments to enter interactive mode:

adb magnet    # Interactive magnet management
adb link      # Interactive link management
adb user      # Interactive user management
adb voucher   # Interactive voucher management
adb auth      # Interactive authentication

🗂️ Configuration

The CLI stores its configuration in:

  • Linux/macOS: ~/.config/alldebrid/config.json
  • Windows: %APPDATA%\alldebrid\config.json

💡 Examples

Download a torrent

# Upload magnet
adb magnet upload "magnet:?xt=urn:btih:..."

# Watch progress
adb magnet watch 12345

# Get download links when ready
adb magnet files 12345

Batch unlock links

# Using a file with URLs
cat urls.txt | while read url; do
  adb --json link unlock "$url" | jq -r '.link'
done

Monitor all active downloads

#!/bin/bash
SESSION=""
COUNTER=0

while true; do
  if [ -z "$SESSION" ]; then
    RESULT=$(adb --json magnet status --live)
  else
    RESULT=$(adb --json magnet status --live --session $SESSION --counter $COUNTER)
  fi

  SESSION=$(echo $RESULT | jq -r '.session')
  COUNTER=$(echo $RESULT | jq -r '.counter')

  echo $RESULT | jq '.magnets[] | "\(.id): \(.status)"'

  sleep 5
done

📋 Requirements

  • Node.js >= 20.0.0 (for npm installation)
  • OR download standalone executable (no Node.js required)
  • AllDebrid account with API access

🔗 Related

📝 License

MIT