Skip to content

feat(cli): redesign route output as multi-line indented format#1934

Open
fanyang89 wants to merge 2 commits intomainfrom
cli-show-route
Open

feat(cli): redesign route output as multi-line indented format#1934
fanyang89 wants to merge 2 commits intomainfrom
cli-show-route

Conversation

@fanyang89
Copy link
Member

@fanyang89 fanyang89 commented Feb 24, 2026

Summary

  • Redesign easytier-cli route output to use tabled table format instead of multi-line text
  • Add --wide/-w global option to show extended route information
  • Implement intelligent table wrapping to adapt to terminal width
  • Remove Version column for cleaner display

Default output (6 columns):

| Hostname | IPv4          | Via     | Hops | Latency | Proxy          |
|----------|---------------|---------|------|---------|----------------|
| node-1   | 10.10.10.1/24 | (local) | -    | -       | 192.168.1.0/24 |
| peer-a   | 10.10.10.2/24 | DIRECT  | 1    | 12ms    |                |
| peer-c   | 10.10.10.3/24 | peer-b  | 2    | 45ms    |                |

Wide output (-w flag, 7 columns):

| Hostname | IPv4          | Via     | Hops | Latency | Lat-First                      | Proxy          |
|----------|---------------|---------|------|---------|--------------------------------|----------------|
| node-1   | 10.10.10.1/24 | (local) | -    | -       | -                              | 192.168.1.0/24 |
| peer-a   | 10.10.10.2/24 | DIRECT  | 1    | 12ms    | -                              |                |
| peer-c   | 10.10.10.3/24 | peer-b  | 2    | 45ms    | via: peer-d                    |                |
|          |               |         |      |         | hops: 3                        |                |
|          |               |         |      |         | latency: 30ms                  |                |

Changes

  • RouteTableItem and RouteTableItemWide structures using tabled::Tabled
  • print_output() function enhanced with wrapping support:
    • table.modify(Rows::new(1..), Width::wrap(terminal_width)) for data rows only
    • Headers remain unwrapped for clarity
  • Version column removed from wide mode to improve display
  • JSON output format includes all fields (including version)
  • Verbose mode (-v) behavior unchanged

Breaking Changes

  • --no-trunc flag renamed to --wide/-w
  • Default output format changed from multi-line text to table

Copilot AI review requested due to automatic review settings February 24, 2026 13:19
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 534e9995ff

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request redesigns the route command output from a wide 13-column table to a more readable multi-line indented format inspired by the ip route command style. The change makes the output more terminal-friendly by eliminating horizontal scrolling and presenting each route entry across multiple lines with clear key-value labeling.

Changes:

  • Replaced RouteTableItem (with tabled::Tabled trait) with RouteItem (only serde::Serialize) to support custom text formatting
  • Implemented multi-line output format with 2-4 lines per route entry, showing identifier, hostname/version, routing info, and optional latency-first path
  • Modified next_hop logic to prefer hostname over IP address for better readability

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@chatgpt-codex-connector
Copy link

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@KKRainbow
Copy link
Member

感觉新的格式也不好看

@fanyang89
Copy link
Member Author

感觉新的格式也不好看

收到,已紧急召开 codex / claude-code / kimi 联席会议讨论解决此问题

@fanyang89 fanyang89 added the enhancement New feature or request label Feb 28, 2026
@chatgpt-codex-connector
Copy link

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@chatgpt-codex-connector
Copy link

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@chatgpt-codex-connector
Copy link

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

Replace multi-line text format with table output:
- Default: 6 columns (Hostname, IPv4, Via, Hops, Latency, Proxy)
- --wide/-w: 8 columns (+ Lat-First, Version)
- Rename global --no-trunc to --wide
- Proxy column uses newline for multiple items
- Lat-First column shows via/hops/latency in 3 lines when different
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants