rConfig V8 Core CLI Commands Reference - Network Automation Guide
rConfig V8 Core CLI Commands Reference
Section titled “rConfig V8 Core CLI Commands Reference”rConfig V8 Core includes a comprehensive set of command-line interface (CLI) commands for managing your network configuration platform. These commands enable automation, scripting, and system administration tasks directly from the command line.
Why Use CLI Commands?
Section titled “Why Use CLI Commands?”CLI commands are essential for several key use cases:
- Automation & Orchestration: Integrate rConfig operations into Infrastructure as Code platforms like Ansible, Terraform, or Chef
- Custom Scripting: Build your own automation workflows and scheduled tasks that interact with rConfig
- System Administration: Perform maintenance tasks, clear caches, and troubleshoot issues directly from the command line
- CI/CD Pipelines: Incorporate network configuration management into your DevOps workflows
- Remote Management: Execute operations on rConfig without requiring access to the web interface
- Performance: Bypass UI overhead for bulk operations and scheduled tasks
Getting Started with CLI Commands
Section titled “Getting Started with CLI Commands”All rConfig CLI commands must be run from the rConfig installation directory and require root privileges.
Prerequisites
Section titled “Prerequisites”- SSH access to your rConfig server
- Root user privileges (or use
sudo) - Navigate to the rConfig installation directory:
cd /var/www/html/rconfigDiscovering Available Commands
Section titled “Discovering Available Commands”To view all available rConfig-specific commands:
php artisan rconfig:listThis command displays a list of all available rConfig commands with their descriptions.
Tip: Use the documentation search feature to quickly find detailed information about any command by searching for its name (e.g., “rconfig:download-device”).
Available Commands
Section titled “Available Commands”┌──────────────────────────────────┬─────────────────────────────────────────────────────────────────────────────┐│ Command │ Description │├──────────────────────────────────┼─────────────────────────────────────────────────────────────────────────────┤│ rconfig:archive-logs │ Will archive x amount of activity log rows or days ││ rconfig:clear-all │ Clear all cache and config elements for Laravel, NPM and other dependencies ││ rconfig:clear-horizon │ Clear Horizon Queue History ││ rconfig:clone-templates │ Clone templates from git repo https://github.com/rconfig/rconfig-templates ││ rconfig:config-summaries-sync │ Sync Config Summaries ││ rconfig:download-category │ Download configurations for one or multiple categories of devices ││ rconfig:download-device │ Download configurations for one or multiple devices via the CLI ││ rconfig:download-tag │ Download configurations for devices with one or multiple tags ││ rconfig:download-task │ Download configurations for devices with one or multiple tasks ││ rconfig:list │ List all rconfig:* commands with their descriptions ││ rconfig:list-categories │ List all category IDs and names in rConfig ││ rconfig:list-devices │ List all Device IDs and names in rConfig ││ rconfig:list-tags │ List all tag IDs and names in rConfig ││ rconfig:list-tasks │ List all task IDs and names in rConfig ││ rconfig:oxidized-device-mappings │ Manage device type mappings for Oxidized import ││ rconfig:oxidized-import-devices │ Import devices from JSON file to rConfig database ││ rconfig:oxidized-load-devices │ Import devices from Oxidized to rConfig ││ rconfig:purge-failedconfigs │ Purge failed configs for some or all devices ││ rconfig:rancid-device-mappings │ Manage device type mappings for RANCID import ││ rconfig:rancid-import-devices │ Import devices from RANCID JSON file to rConfig database ││ rconfig:rancid-load-devices │ Load devices from RANCID to create rConfig import JSON ││ rconfig:report-lastDownload │ Output report of all devices latest downloaded configs ││ rconfig:search-configs │ Search all config files for a given string ││ rconfig:sync-tasks │ Sync the schedule of the app with the schedule monitor │└──────────────────────────────────┴─────────────────────────────────────────────────────────────────────────────┘All commands must be run from within the rconfig directory in the following format:
php artisan [command-name] [arguments] [options]Command Reference
Section titled “Command Reference”rconfig:archive-logs
Section titled “rconfig:archive-logs”Archives a specified number of activity log rows or days worth of logs. Helps maintain database performance by moving old logs to archive storage.
# Archive logs older than 90 daysphp artisan rconfig:archive-logs --days=90
# Archive specific number of rowsphp artisan rconfig:archive-logs --rows=10000Options:
--days: Number of days to keep (archive older logs)--rows: Number of rows to archive
rconfig:clear-all ⭐
Section titled “rconfig:clear-all ⭐”Clears all cache and config elements for Laravel, NPM, and other dependencies. This is an essential command for resolving application issues after updates or configuration changes.
php artisan rconfig:clear-allUse cases:
- After updating rConfig
- When encountering 500 errors
- After modifying configuration files
- When the UI behaves unexpectedly
rconfig:clear-horizon
Section titled “rconfig:clear-horizon”Clears Horizon queue history and failed jobs from the database.
php artisan rconfig:clear-horizonUse cases:
- Database cleanup
- Resolving queue processing issues
- After clearing failed job backlogs
rconfig:clone-templates
Section titled “rconfig:clone-templates”Clones vendor device templates from the official rConfig templates repository on GitHub. This ensures you have the latest device support templates.
php artisan rconfig:clone-templatesWhat it does:
- Downloads latest templates from https://github.com/rconfig/rconfig-templates
- Updates existing templates
- Adds new vendor support
Best practice: Run this command periodically to keep templates updated with the latest device support.
rconfig:config-summaries-sync
Section titled “rconfig:config-summaries-sync”Syncs configuration count summaries to the database for faster UI load times. This command is run automatically daily at 3AM.
php artisan rconfig:config-summaries-syncWhen to run manually:
- After bulk configuration imports
- When dashboard statistics appear incorrect
- After database maintenance
rconfig:download-category
Section titled “rconfig:download-category”Downloads configurations for all devices in specified categories (Command Groups).
# Download from one or more categoriesphp artisan rconfig:download-category 1 2 3
# With debug outputphp artisan rconfig:download-category 1 -dArguments:
- Category IDs (space-separated for multiple)
Options:
-d: Enable debug output
Example:
# Download all routers (category ID 1) and switches (category ID 2)php artisan rconfig:download-category 1 2rconfig:download-device ⭐
Section titled “rconfig:download-device ⭐”Downloads configurations for specified devices. This is one of the most commonly used commands for on-demand config retrieval and debugging.
# Download from specific devicesphp artisan rconfig:download-device 1002 1003 1004
# Enable debug output for troubleshootingphp artisan rconfig:download-device 1002 -dArguments:
- Device IDs (space-separated for multiple)
Options:
-d: Enable debug output (shows connection details, commands executed, output received)
Use cases:
- On-demand configuration backups
- Testing device connectivity
- Troubleshooting connection issues
- Immediate backup before changes
Example:
# Backup router before making changes, with debug outputphp artisan rconfig:download-device 1002 -drconfig:download-tag
Section titled “rconfig:download-tag”Downloads configurations for all devices with specified tags.
# Download all devices tagged with specific tagsphp artisan rconfig:download-tag 1001 1002
# With debug outputphp artisan rconfig:download-tag 1001 -dArguments:
- Tag IDs (space-separated for multiple)
Example:
# Backup all devices tagged "production" (tag ID 1001)php artisan rconfig:download-tag 1001rconfig:download-task
Section titled “rconfig:download-task”Downloads configurations for all devices associated with specified tasks.
# Download configs for devices in specific tasksphp artisan rconfig:download-task 555555 666666
# With debug outputphp artisan rconfig:download-task 555555 -dArguments:
- Task IDs (space-separated for multiple)
rconfig:list
Section titled “rconfig:list”Lists all rconfig:* commands with their descriptions. Provides a quick reference to available commands.
php artisan rconfig:listrconfig:list-categories
Section titled “rconfig:list-categories”Lists all category (Command Group) IDs and names in rConfig. Useful for finding category IDs for use with other commands.
php artisan rconfig:list-categoriesOutput example:
ID | Category Name------|---------------1 | Routers2 | Switches3 | Firewallsrconfig:list-devices
Section titled “rconfig:list-devices”Lists all device IDs and names in rConfig. Essential for finding device IDs for backup commands.
php artisan rconfig:list-devicesOutput example:
ID | Device Name | IP Address------|--------------------|--------------1001 | core-router-01 | 10.0.0.11002 | access-switch-02 | 10.0.1.10rconfig:list-tags
Section titled “rconfig:list-tags”Lists all tag IDs and names in rConfig.
php artisan rconfig:list-tagsOutput example:
ID | Tag Name------|----------1001 | production1002 | staging1003 | datacenter-1rconfig:list-tasks
Section titled “rconfig:list-tasks”Lists all task IDs and names in rConfig.
php artisan rconfig:list-tasksrconfig:oxidized-device-mappings
Section titled “rconfig:oxidized-device-mappings”Manages device type mappings for Oxidized import. Used to map Oxidized device types to rConfig vendor templates.
php artisan rconfig:oxidized-device-mappingsSee also: Oxidized Migration Guide
rconfig:oxidized-import-devices
Section titled “rconfig:oxidized-import-devices”Imports devices from Oxidized JSON file to rConfig database.
php artisan rconfig:oxidized-import-devices /path/to/devices.jsonSee also: Oxidized Migration Guide
rconfig:oxidized-load-devices
Section titled “rconfig:oxidized-load-devices”Imports devices from Oxidized to rConfig. This command connects to an Oxidized instance and imports its device inventory.
php artisan rconfig:oxidized-load-devicesPrerequisites:
- Oxidized integration configured in rConfig settings
- Network access to Oxidized instance
See also: Oxidized Migration Guide
rconfig:purge-failedconfigs
Section titled “rconfig:purge-failedconfigs”Purges failed configuration download attempts for specified or all devices. Helps clean up failed backup records.
# Purge failed configs for specific devicesphp artisan rconfig:purge-failedconfigs 1001 1002
# Purge all failed configsphp artisan rconfig:purge-failedconfigs --allArguments:
- Device IDs (space-separated for multiple)
Options:
--all: Purge failed configs for all devices
rconfig:rancid-device-mappings
Section titled “rconfig:rancid-device-mappings”Manages device type mappings for RANCID import. Used to map RANCID device types to rConfig vendor templates.
php artisan rconfig:rancid-device-mappingsSee also: RANCID Migration Guide
rconfig:rancid-import-devices
Section titled “rconfig:rancid-import-devices”Imports devices from RANCID JSON file to rConfig database.
php artisan rconfig:rancid-import-devices /path/to/rancid-devices.jsonSee also: RANCID Migration Guide
rconfig:rancid-load-devices
Section titled “rconfig:rancid-load-devices”Loads devices from RANCID installation to create rConfig import JSON file.
php artisan rconfig:rancid-load-devicesPrerequisites:
- Access to RANCID installation and configuration files
See also: RANCID Migration Guide
rconfig:report-lastDownload
Section titled “rconfig:report-lastDownload”Generates a CLI report of all devices’ latest downloaded configurations. Useful for auditing backup status.
php artisan rconfig:report-lastDownloadOutput includes:
- Device name
- Last successful backup date
- Days since last backup
- Backup status
Use cases:
- Identifying devices with stale backups
- Backup compliance auditing
- Troubleshooting backup schedules
rconfig:search-configs
Section titled “rconfig:search-configs”Searches all configuration files for a given string. Powerful tool for finding specific configurations across your entire network.
# Search for a specific stringphp artisan rconfig:search-configs "ntp server"
# Search with regex patternphp artisan rconfig:search-configs --pattern="ip route.*192.168"Arguments:
- Search string or pattern
Options:
--pattern: Use regex pattern for advanced searching--case-sensitive: Perform case-sensitive search
Use cases:
- Finding all devices with specific configuration
- Security audits (finding weak passwords, old protocols)
- Compliance checking
- Configuration standardization verification
Example:
# Find all devices configured with a specific NTP serverphp artisan rconfig:search-configs "ntp server 10.0.0.1"rconfig:sync-tasks
Section titled “rconfig:sync-tasks”Syncs the application schedule with the schedule monitor. Ensures scheduled tasks are properly registered.
php artisan rconfig:sync-tasksWhen to run:
- After creating new scheduled tasks
- When scheduled tasks aren’t running
- After system updates
Related Documentation
Section titled “Related Documentation”- Device Management - Managing devices in rConfig
- Connectivity Process - How rConfig connects to devices
- Quick Start Guide - Getting started with V8 Core
- RANCID Migration - Migrating from RANCID
- Oxidized Migration - Migrating from Oxidized