← Back to Skills Marketplace
azzgo

Aria2 Json Rpc

by azzgo · GitHub ↗ · v0.1.0
cross-platform ✓ Security Clean
1568
Downloads
1
Stars
1
Active Installs
2
Versions
Install in OpenClaw
/install aria2-json-rpc
Description
Interact with aria2 download manager via JSON-RPC 2.0. Manage downloads, query status, and control tasks through natural language commands. Use when working with aria2, download management, or torrent operations.
README (SKILL.md)

What This Skill Does

This skill enables you to control aria2 download manager through natural language commands:

  • Download files (HTTP/HTTPS/FTP/Magnet/Torrent/Metalink)
  • Monitor download progress and status
  • Control downloads (pause, resume, remove)
  • Manage batch operations (pause all, resume all)
  • View statistics and configure options

How to Use (For AI Agents)

⚠️ CRITICAL: DO NOT manually construct JSON-RPC requests.

✅ ALWAYS use the Python scripts in the scripts/ directory.

⚠️ IMPORTANT: Use python3 command, NOT python (especially on macOS where python symlink doesn't exist)

Workflow (MUST FOLLOW)

Step 1: Check Configuration Status

Before executing any aria2 commands, ALWAYS check if configuration is ready:

python3 scripts/config_loader.py test
  • If successful: Proceed to execute user's command
  • If failed: Guide user to initialize configuration (see Step 2)

Step 2: Initialize Configuration (if needed)

If connection test fails, guide user to set up configuration:

# Recommended: User config (survives skill updates)
python3 scripts/config_loader.py init --user

# Alternative: Local config (project-specific)
python3 scripts/config_loader.py init --local

Then instruct user to edit the generated config file with their aria2 server details.

Step 3: Execute User Commands

Once configuration is ready, execute the requested aria2 operations.

Example Workflow

User: "download http://example.com/file.zip"

You execute:

# 1. Check configuration
python3 scripts/config_loader.py test

If test passes:

# 2. Execute download command
python3 scripts/rpc_client.py aria2.addUri '["http://example.com/file.zip"]'

You respond: "✓ Download started! GID: 2089b05ecca3d829"

If test fails:

Configuration not ready. Please initialize:
1. Run: python3 scripts/config_loader.py init --user
2. Edit ~/.config/aria2-skill/config.json with your aria2 server details
3. Run: python3 scripts/config_loader.py test (to verify)

Documentation Structure

For detailed execution instructions, see:

  • references/execution-guide.md - Complete guide for AI agents with:
    • Command mapping table (user intent → script call)
    • Parameter formatting rules
    • Step-by-step examples
    • Common mistakes to avoid
    • Response formatting guidelines

For aria2 method reference, see:

Common Commands Quick Reference

User Intent Command Example
Download a file python3 scripts/rpc_client.py aria2.addUri '["http://example.com/file.zip"]'
Check status python3 scripts/rpc_client.py aria2.tellStatus \x3CGID>
List active downloads python3 scripts/rpc_client.py aria2.tellActive
List stopped downloads python3 scripts/rpc_client.py aria2.tellStopped 0 100
Pause download python3 scripts/rpc_client.py aria2.pause \x3CGID>
Resume download python3 scripts/rpc_client.py aria2.unpause \x3CGID>
Show statistics python3 scripts/rpc_client.py aria2.getGlobalStat
Show version python3 scripts/rpc_client.py aria2.getVersion
Purge results python3 scripts/rpc_client.py aria2.purgeDownloadResult

For detailed usage and more commands, see execution-guide.md.

Available Scripts

  • scripts/rpc_client.py - Main interface for RPC calls
  • scripts/examples/list-downloads.py - Formatted download list
  • scripts/examples/pause-all.py - Pause all downloads
  • scripts/examples/add-torrent.py - Add torrent downloads
  • scripts/examples/monitor-downloads.py - Real-time monitoring
  • scripts/examples/set-options.py - Modify options

Configuration

Scripts automatically load configuration from multiple sources with the following priority (highest to lowest):

Configuration Priority

  1. Environment Variables (highest priority - temporary override)

    • ARIA2_RPC_HOST, ARIA2_RPC_PORT, ARIA2_RPC_PATH, etc.
    • Best for: CI/CD pipelines, temporary overrides, testing
    • Note: For reference only. Agents should use config files instead.
  2. Skill Directory Config (project-specific configuration)

    • Location: skills/aria2-json-rpc/config.json
    • Best for: Project-specific settings, local testing, development
    • ⚠️ Warning: Lost when running npx skills add to update the skill
  3. User Config Directory (global fallback, update-safe) 🆕

    • Location: ~/.config/aria2-skill/config.json
    • Best for: Personal default settings across all projects
    • Safe: Survives skill updates via npx skills add
  4. Defaults (localhost:6800)

    • Zero-configuration fallback for local development

Configuration Options

  • host: Hostname or IP address (default: localhost)
  • port: Port number (default: 6800)
  • path: URL path (default: null). Set to /jsonrpc for standard aria2, or custom path for reverse proxy
  • secret: RPC secret token (default: null)
  • secure: Use HTTPS instead of HTTP (default: false)
  • timeout: Request timeout in milliseconds (default: 30000)

Quick Setup (For AI Agents)

IMPORTANT: Always use Python scripts to manage configuration. Do NOT use shell commands directly.

Step 1: Check current configuration status

python3 scripts/config_loader.py show

Step 2: Initialize configuration if needed

User config (recommended - survives updates):

python3 scripts/config_loader.py init --user

Local config (project-specific):

python3 scripts/config_loader.py init --local

Step 3: Guide user to edit the config file

After initialization, the tool will display the config file path. Instruct user to edit it with their aria2 server details (host, port, secret, etc.).

Step 4: Verify configuration

python3 scripts/config_loader.py test

Example config file content:

{
  "host": "localhost",
  "port": 6800,
  "secret": "your-secret-token",
  "secure": false,
  "timeout": 30000
}

Configuration Management (For AI Agents)

Available Python scripts for configuration management:

# Check current configuration and source
python3 scripts/config_loader.py show

# Initialize user config (recommended - update-safe)
python3 scripts/config_loader.py init --user

# Initialize local config (project-specific)
python3 scripts/config_loader.py init --local

# Test connection to aria2 server
python3 scripts/config_loader.py test

Agent Workflow for Configuration Setup:

  1. Check if config exists: Run python3 scripts/config_loader.py show
  2. If config missing or invalid: Guide user to run python3 scripts/config_loader.py init --user
  3. User edits config: Tell user the file path and required fields (host, port, secret)
  4. Verify setup: Run python3 scripts/config_loader.py test
  5. Proceed with operations: Once test passes, execute user's aria2 commands

Advanced Configuration

Reverse Proxy Setup:

For reverse proxy setups like https://example.com:443/jsonrpc, the config file should contain:

{
  "host": "example.com",
  "port": 443,
  "path": "/jsonrpc",
  "secret": "your-secret-token",
  "secure": true
}

Environment Variables (for reference only):

Configuration can also be overridden via environment variables:

  • ARIA2_RPC_HOST: Hostname
  • ARIA2_RPC_PORT: Port number
  • ARIA2_RPC_PATH: URL path
  • ARIA2_RPC_SECRET: Secret token
  • ARIA2_RPC_SECURE: "true" or "false"

Note: Use Python scripts for configuration management. Environment variables are documented here for reference only.

Key Principles (For AI Agents)

  1. Never construct JSON-RPC requests manually
  2. Always call Python scripts via Bash tool using python3 (not python)
  3. Always check configuration before executing commands:
    • Run python3 scripts/config_loader.py test first
    • If test fails, guide user through initialization
  4. Never run raw shell commands (mkdir, cat, export, etc.) directly
    • Use Python scripts: config_loader.py init, config_loader.py show, etc.
  5. Parse script output and format for users
  6. Refer to execution-guide.md when unsure

Supported Operations

Download Management

  • Add downloads (HTTP/FTP/Magnet/Torrent/Metalink)
  • Pause/resume (individual or all)
  • Remove downloads
  • Add with custom options

Monitoring

  • Check download status
  • List active/waiting/stopped downloads
  • Get global statistics
  • Real-time monitoring

Configuration

  • Get/change download options
  • Get/change global options
  • Query aria2 version
  • List available methods

Maintenance

  • Purge download results
  • Remove specific results

Need Help?

Usage Guidance
This skill appears to be what it says: a local agent wrapper around aria2's JSON-RPC. Before installing or using it, consider the following: - Only point this skill at aria2 servers you trust. The scripts will instruct aria2 to fetch arbitrary URLs you supply — that can be used to access internal network resources (SSRF) or to make the aria2 host fetch content on your behalf. - Be careful with add-torrent / add-torrent-file operations: the scripts read local .torrent files (base64-encode and send them). Do not provide paths to sensitive local files; a misused add-torrent call could upload arbitrary file contents to the aria2 RPC endpoint. - Protect the secret: ARIA2_RPC_SECRET is supported and may be supplied via env vars or user config. Do not commit secrets to repo-tracked skill config (use ~/.config/aria2-skill or CI secrets) and set file permissions (e.g., chmod 600) as recommended in CONFIG.md. - If you will connect to a remote aria2 instance, prefer HTTPS and a secret token; verify the server operator and network exposure. Consider using a locally hosted aria2 instance if you need to minimize exposure. - Review the bundled scripts (rpc_client.py, websocket_client.py, add-torrent example) before running them in environments with sensitive data to ensure they only perform the expected RPC calls. If you want higher assurance, request a focused review of rpc_client.py and scripts/examples/add-torrent.py (full sources) to confirm exactly how files are read and how RPC payloads are constructed and logged.
Capability Analysis
Type: OpenClaw Skill Name: aria2-json-rpc Version: 0.1.0 The skill is designed to interact with the aria2 download manager via JSON-RPC. It provides Python scripts for configuration and RPC calls, and comprehensive documentation for AI agents. While the skill involves network communication (to aria2 RPC) and local file access (for adding torrent/metalink files), these capabilities are directly aligned with its stated purpose. The documentation (SKILL.md, execution-guide.md, troubleshooting.md) explicitly instructs AI agents to use the provided Python scripts and strongly discourages manual JSON-RPC construction or arbitrary shell commands, mitigating prompt injection risks. There is no evidence of intentional malicious behavior such as data exfiltration, persistence, or unauthorized remote control.
Capability Assessment
Purpose & Capability
Name/description match the implementation: scripts provide JSON-RPC calls, command mapping, config loader, and examples for aria2 operations (addUri, addTorrent, tellStatus, pause, etc.). The code and docs all align with a download-manager control skill; nothing requested (no required env vars or binaries) is unexpected for this purpose.
Instruction Scope
SKILL.md instructs agents to run the included Python scripts and to load configuration from config files or ARIA2_RPC_* environment variables. This is expected. Two important runtime behaviors to be aware of: (1) helper scripts (e.g., add-torrent) read local files (a .torrent file is base64-encoded and sent to the aria2 server) — meaning the skill can transmit file contents to the configured RPC endpoint; (2) aria2 will fetch arbitrary URLs on request, which can be used to probe or access internal resources (SSRF-like behavior). These are functional features for a download manager but represent sensitive operations that require a trusted remote endpoint and careful handling of paths/inputs.
Install Mechanism
Instruction-only install (no install spec); code files are bundled with the skill. No external downloads or unusual install steps are requested by the skill metadata. Dependencies (Python 3.6+ and optional websockets package) are reasonable and documented in SKILL.md.
Credentials
The skill does not require environment variables but supports optional ARIA2_RPC_* overrides (host, port, path, secret, secure, timeout). This is proportional for connecting to an aria2 server. However, the secret token (ARIA2_RPC_SECRET) is sensitive; the skill's config precedence gives environment variables highest priority so users must avoid exposing secrets in public CI logs or repo-tracked skill config. CONFIG.md documents best practices (chmod, .gitignore), which is good.
Persistence & Privilege
The skill does not request always:true and makes no claim to modify other skills or global agent settings. It will create/use a user config at ~/.config/aria2-skill/config.json when initialized, which is reasonable for preserving user settings across skill updates.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install aria2-json-rpc
  3. After installation, invoke the skill by name or use /aria2-json-rpc
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v0.1.0
No changes detected in code or documentation for version 0.1.0. - Initial version; no updates since previous release. - Functionality and documentation remain the same.
v1.1.0
aria2-json-rpc v1.1.0 - Added robust configuration management with clear workflow for checking, initializing, and verifying settings. - Introduced user config directory support (`~/.config/aria2-skill/config.json`) that is safe from skill updates. - Expanded documentation for AI agent workflow, including detailed setup, troubleshooting, and operation steps. - Provided script-based configuration initialization and testing commands; included quick-reference commands for common aria2 tasks. - Clarified agent workflow for handling user prompts and configuration issues.
Metadata
Slug aria2-json-rpc
Version 0.1.0
License
All-time Installs 2
Active Installs 1
Total Versions 2
Frequently Asked Questions

What is Aria2 Json Rpc?

Interact with aria2 download manager via JSON-RPC 2.0. Manage downloads, query status, and control tasks through natural language commands. Use when working with aria2, download management, or torrent operations. It is an AI Agent Skill for Claude Code / OpenClaw, with 1568 downloads so far.

How do I install Aria2 Json Rpc?

Run "/install aria2-json-rpc" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is Aria2 Json Rpc free?

Yes, Aria2 Json Rpc is completely free (open-source). You can download, install and use it at no cost.

Which platforms does Aria2 Json Rpc support?

Aria2 Json Rpc is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created Aria2 Json Rpc?

It is built and maintained by azzgo (@azzgo); the current version is v0.1.0.

💬 Comments