Skip to content

Add device list command to ares-device CLI#9

Merged
mariotaku merged 1 commit into
mainfrom
claude/ares-device-list
Jun 14, 2026
Merged

Add device list command to ares-device CLI#9
mariotaku merged 1 commit into
mainfrom
claude/ares-device-list

Conversation

@mariotaku

Copy link
Copy Markdown
Member

Summary

This PR adds a new --device-list flag to the ares-device CLI that displays all available devices in a formatted table.

Key Changes

  • Added -D, --device-list command-line argument to show available devices
  • Implemented list_devices() function to retrieve and display devices from the DeviceManager
  • Implemented device_row() helper to format device information into table rows
  • Implemented print_table() generic function to render left-aligned, space-padded tables with dashed header underlines
  • Updated imports to include the Device type from ares_device_lib
  • Added early return in main() when --device-list flag is provided

Notable Implementation Details

  • The table formatting mirrors the reference CLI's device list output with consistent spacing and alignment
  • Device names are annotated with "(default)" when the device is marked as the default
  • Device connection info is displayed as username@host:port in the deviceinfo column
  • Connection type is hardcoded as "ssh" for all devices
  • Passphrases are displayed as empty strings if not set
  • The print_table() function is generic over the number of columns, automatically calculating column widths based on content

https://claude.ai/code/session_017vAGzSSYNcgdQzJRLWfX47

The Rust ares-device only resolved and printed a single device name; it
had none of the original CLI's operations. Add the simplest of them,
-D/--device-list, which prints the configured devices in the same
columnar layout as the reference tool: name (with a "(default)" marker),
deviceinfo (user@host:port), connection, profile and passphrase.

https://claude.ai/code/session_017vAGzSSYNcgdQzJRLWfX47
@mariotaku mariotaku merged commit 40f53fa into main Jun 14, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants