Aria2 Json Rpc
by @azzgo
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.
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
localhost)6800)null). Set to /jsonrpc for standard aria2, or custom path for reverse proxynull)false)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 showInitialize user config (recommended - update-safe)
python3 scripts/config_loader.py init --userInitialize local config (project-specific)
python3 scripts/config_loader.py init --localTest 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: HostnameARIA2_RPC_PORT: Port numberARIA2_RPC_PATH: URL pathARIA2_RPC_SECRET: Secret tokenARIA2_RPC_SECURE: "true" or "false"Note: Use Python scripts for configuration management. Environment variables are documented here for reference only.
clawhub install aria2-json-rpc