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.

16 stars

Best use case

aria2-json-rpc is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

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.

Teams using aria2-json-rpc should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/aria2-json-rpc/SKILL.md --create-dirs "https://raw.githubusercontent.com/diegosouzapw/awesome-omni-skill/main/skills/backend/aria2-json-rpc/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/aria2-json-rpc/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How aria2-json-rpc Compares

Feature / Agentaria2-json-rpcStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

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.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

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

```bash
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:

```bash
# 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:**
```bash
# 1. Check configuration
python3 scripts/config_loader.py test
```

If test passes:
```bash
# 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](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:**
- **[references/aria2-methods.md](references/aria2-methods.md)** - Detailed aria2 RPC method documentation

## 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 <GID>` |
| 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 <GID>` |
| Resume download | `python3 scripts/rpc_client.py aria2.unpause <GID>` |
| 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](references/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**
```bash
python3 scripts/config_loader.py show
```

**Step 2: Initialize configuration if needed**

User config (recommended - survives updates):
```bash
python3 scripts/config_loader.py init --user
```

Local config (project-specific):
```bash
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**
```bash
python3 scripts/config_loader.py test
```

Example config file content:
```json
{
  "host": "localhost",
  "port": 6800,
  "secret": "your-secret-token",
  "secure": false,
  "timeout": 30000
}
```

### Configuration Management (For AI Agents)

**Available Python scripts for configuration management:**

```bash
# 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:

```json
{
  "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?

- **Execution details:** [references/execution-guide.md](references/execution-guide.md)
- **Method reference:** [references/aria2-methods.md](references/aria2-methods.md)
- **Troubleshooting:** [references/troubleshooting.md](references/troubleshooting.md)
- **aria2 official docs:** https://aria2.github.io/

Related Skills

json-yaml

16
from diegosouzapw/awesome-omni-skill

Process JSON, YAML, CSV, and XML data (jq, yq, awk).

json-visualization-dev

16
from diegosouzapw/awesome-omni-skill

Develop and maintain the JSON Visualization web application - a Next.js tool for visualizing JSON/YAML/CSV/XML data as interactive graphs. Use when working with this codebase, adding features, fixing bugs, or understanding the graph visualization, data conversion, or type generation systems.

json-canvas

16
from diegosouzapw/awesome-omni-skill

Create and edit JSON Canvas files (.canvas) with nodes, edges, groups, and connections. Use when working with .canvas files, creating visual canvases, mind maps, flowcharts, or when the user mentions Canvas files in Obsidian.

file-to-json-parsing

16
from diegosouzapw/awesome-omni-skill

Use AgentPMT external API to run the File To JSON Parsing tool with wallet signatures, credits purchase, or credits earned from jobs.

ash-json-api

16
from diegosouzapw/awesome-omni-skill

AshJsonApi guidelines for exposing Ash resources as JSON:API compliant REST endpoints. Use when adding JSON:API extensions to domains/resources, configuring routes, or implementing filtering, sorting, pagination, and includes. Supports full JSON:API specification.

adf-json-example

16
from diegosouzapw/awesome-omni-skill

Fetch raw ADF JSON data from a Confluence page URL. Use this skill when you need to see real-world ADF examples, understand how Confluence represents specific elements, debug ADF parsing, or create test samples.

adf-format-json-schema

16
from diegosouzapw/awesome-omni-skill

Query Atlassian Document Format (ADF) JSON schema definitions to understand ADF node and mark types. Use this skill when implementing ADF dataclass nodes/marks, or when user asks about ADF structure, ADF nodes, ADF marks, or Atlassian Document Format implementation.

bgo

10
from diegosouzapw/awesome-omni-skill

Automates the complete Blender build-go workflow, from building and packaging your extension/add-on to removing old versions, installing, enabling, and launching Blender for quick testing and iteration.

Coding & Development

moai-lang-r

16
from diegosouzapw/awesome-omni-skill

R 4.4+ best practices with testthat 3.2, lintr 3.2, and data analysis patterns.

moai-lang-python

16
from diegosouzapw/awesome-omni-skill

Python 3.13+ development specialist covering FastAPI, Django, async patterns, data science, testing with pytest, and modern Python features. Use when developing Python APIs, web applications, data pipelines, or writing tests.

moai-icons-vector

16
from diegosouzapw/awesome-omni-skill

Vector icon libraries ecosystem guide covering 10+ major libraries with 200K+ icons, including React Icons (35K+), Lucide (1000+), Tabler Icons (5900+), Iconify (200K+), Heroicons, Phosphor, and Radix Icons with implementation patterns, decision trees, and best practices.

moai-foundation-trust

16
from diegosouzapw/awesome-omni-skill

Complete TRUST 4 principles guide covering Test First, Readable, Unified, Secured. Validation methods, enterprise quality gates, metrics, and November 2025 standards. Enterprise v4.0 with 50+ software quality standards references.