Skip to content

Refactor --list command to --list-wide and add a compact --list variant #69

@dapi

Description

@dapi

Summary

The current --list command displays a wide table with many columns. We need to:

  1. Rename the current --list command to --list-wide
  2. Create a new compact --list command that only displays essential columns

Current Behavior

The current --list command displays 9 columns:

  • PORT
  • DIRECTORY
  • NAME
  • STATUS
  • LOCKED
  • USER
  • PID
  • PROCESS
  • ASSIGNED

Current output example:

PORT  DIRECTORY                         NAME   STATUS  LOCKED  USER  PID  PROCESS       ASSIGNED
3000  ~/code/merchantly/main            main   free    yes     -     -    -             2026-01-03 20:53
3001  ~/code/valera                     main   free    yes     -     -    -             2026-01-03 21:08
3005  ~/code/worktrees/feature/dashboard       busy            root  -    docker-proxy  2026-01-04 22:32

Desired Behavior

1. New --list-wide command (replacement for current --list)

Should show the same output as the current --list command.

Example:

$ port-selector --list-wide

Output:

PORT  DIRECTORY                         NAME   STATUS  LOCKED  USER  PID  PROCESS       ASSIGNED
3000  ~/code/merchantly/main            main   free    yes     -     -    -             2026-01-03 20:53
3001  ~/code/valera                     main   free    yes     -     -    -             2026-01-03 21:08
3005  ~/code/worktrees/feature/dashboard       busy            root  -    docker-proxy  2026-01-04 22:32

2. New compact --list command

Should display only these 5 columns:

  • PORT
  • DIRECTORY
  • NAME
  • STATUS
  • LOCKED

Example:

$ port-selector --list

Output:

PORT  DIRECTORY                      NAME  STATUS  LOCKED
3000  ~/code/merchantly/main         main  free    yes  
3001  ~/code/valera                  main  free    yes  
3005  ~/code/worktrees/feature/dashboard     busy    -    
3022  ~/tmp/test-project             web   free    -    
3023  ~/tmp/test-project             api   free    -    

Rationale

  1. Better UX: The current --list output can be overwhelming with many columns. Most common use cases only need essential port information.
  2. Backward compatibility: Moving current behavior to --list-wide preserves full information access for those who need it.
  3. Consistency: Compact table is more readable and follows Unix principle of providing simple output by default with detailed options available via explicit flags.

Technical Implementation

Complete technical specification with implementation details is available in the repository at:

  • File: GITHUB_ISSUE_LIST_RENAME.md

Key Changes:

  • Rename runList() to runListWide() in cmd/port-selector/main.go
  • Create new runListCompact() function
  • Update flag parsing: -l and --list-wide for wide format, --list for compact
  • Update help text to reflect new behavior

Related Files

  • cmd/port-selector/main.go
  • README.md (needs updating)
  • CLAUDE.md (needs updating)
  • CHANGELOG.md (document this change)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions