Implement qbit list (installed packages) #31

Open
opened 2026-01-03 23:40:25 +00:00 by KofTwentyTwo · 0 comments
KofTwentyTwo commented 2026-01-03 23:40:25 +00:00 (Migrated from github.com)

Part of #11

User Story

As a developer, I want to list installed qbit packages so I can see what dependencies my project has.

Design

Command Interface

qctl qbit list

# Options:
qctl qbit list --json           # JSON output for scripting
qctl qbit list --outdated       # Only show packages with updates

Output Format (Table)

Installed packages:

Package              Version   Registry
@qrun/auth-sso       2.0.1     https://voyage.qrun.io
@qrun/reports        1.3.0     https://voyage.qrun.io
@qrun/data-import    0.9.0     https://voyage.qrun.io

3 packages installed

Output Format (JSON)

{
  "packages": [
    {
      "name": "@qrun/auth-sso",
      "version": "2.0.1",
      "registry": "https://voyage.qrun.io",
      "integrity": "sha512-..."
    }
  ],
  "count": 3
}

Workflow

  1. Read lockfile
  2. Format output (table or JSON)
  3. If --outdated, filter to packages with available updates

Files to Create/Modify

File Action Description
qctl-qbit/src/main/java/io/qrun/qctl/qbit/ListCommand.java Create Picocli command for qbit list
qctl-qbit/src/main/java/io/qrun/qctl/qbit/QbitCommand.java Modify Register ListCommand

Edge Cases

Scenario Behavior
No lockfile Print "No packages installed"
Empty lockfile Print "No packages installed"
Missing vendor dir Warn but still list from lockfile

Implementation Tasks

  • Create ListCommand with Picocli annotations
  • Add --json flag for JSON output
  • Add --outdated flag to filter to updatable packages
  • Read packages from lockfile
  • Format as aligned table (reuse table formatter from #27)
  • Format as JSON when --json specified
  • Handle missing/empty lockfile gracefully
  • Register ListCommand in QbitCommand.subcommands
  • Add unit tests for output formatting
  • Add integration test

Acceptance Criteria

  • qbit list shows installed packages in table format
  • qbit list --json outputs valid JSON
  • qbit list --outdated shows only updateable packages
  • Handles empty/missing lockfile gracefully
  • Table columns are aligned
Part of #11 ## User Story As a developer, I want to list installed qbit packages so I can see what dependencies my project has. ## Design ### Command Interface ```bash qctl qbit list # Options: qctl qbit list --json # JSON output for scripting qctl qbit list --outdated # Only show packages with updates ``` ### Output Format (Table) ``` Installed packages: Package Version Registry @qrun/auth-sso 2.0.1 https://voyage.qrun.io @qrun/reports 1.3.0 https://voyage.qrun.io @qrun/data-import 0.9.0 https://voyage.qrun.io 3 packages installed ``` ### Output Format (JSON) ```json { "packages": [ { "name": "@qrun/auth-sso", "version": "2.0.1", "registry": "https://voyage.qrun.io", "integrity": "sha512-..." } ], "count": 3 } ``` ### Workflow 1. Read lockfile 2. Format output (table or JSON) 3. If `--outdated`, filter to packages with available updates ### Files to Create/Modify | File | Action | Description | |------|--------|-------------| | `qctl-qbit/src/main/java/io/qrun/qctl/qbit/ListCommand.java` | Create | Picocli command for `qbit list` | | `qctl-qbit/src/main/java/io/qrun/qctl/qbit/QbitCommand.java` | Modify | Register `ListCommand` | ### Edge Cases | Scenario | Behavior | |----------|----------| | No lockfile | Print "No packages installed" | | Empty lockfile | Print "No packages installed" | | Missing vendor dir | Warn but still list from lockfile | ## Implementation Tasks - [ ] Create `ListCommand` with Picocli annotations - [ ] Add `--json` flag for JSON output - [ ] Add `--outdated` flag to filter to updatable packages - [ ] Read packages from lockfile - [ ] Format as aligned table (reuse table formatter from #27) - [ ] Format as JSON when `--json` specified - [ ] Handle missing/empty lockfile gracefully - [ ] Register `ListCommand` in `QbitCommand.subcommands` - [ ] Add unit tests for output formatting - [ ] Add integration test ## Acceptance Criteria - [ ] `qbit list` shows installed packages in table format - [ ] `qbit list --json` outputs valid JSON - [ ] `qbit list --outdated` shows only updateable packages - [ ] Handles empty/missing lockfile gracefully - [ ] Table columns are aligned
Sign in to join this conversation.