Thanks to visit codestin.com
Credit goes to github.com

Skip to content

feat(cli): add --detailed flag to ix subsystems --list#209

Open
jcorn925 wants to merge 1 commit into
ix-infrastructure:mainfrom
jcorn925:feat/subsystems-detailed
Open

feat(cli): add --detailed flag to ix subsystems --list#209
jcorn925 wants to merge 1 commit into
ix-infrastructure:mainfrom
jcorn925:feat/subsystems-detailed

Conversation

@jcorn925
Copy link
Copy Markdown

Summary

  • Adds --detailed to ix subsystems --list, calling GET /v1/subsystems?detailed=true
  • Returns full score payloads including member_files and enriched calls_* / imports_* edges
  • Bumps CLI version to 0.6.1

Type

  • Feature

Changes

  • ix-cli/src/cli/commands/subsystems.ts — new flag, validation, JSON output paths
  • ix-cli/src/client/api.tslistSubsystems({ detailed }) query param

Validation

  • curl "http://localhost:8090/v1/subsystems?detailed=true" returns member_files, calls_*, imports_*
  • node ix-cli/dist/cli/main.js subsystems --list --detailed --format json matches API shape
  • ix subsystems --detailed without --list errors as expected

Checklist

  • CLI output follows Ix format
  • ix-cli/package.json version bumped to 0.6.1
  • After merge: tag v0.6.1 on upstream to trigger release workflow

Made with Cursor

Pass detailed=true to GET /v1/subsystems for member_files and enriched
call/import edges. Bump CLI version to 0.6.1.

Co-authored-by: Cursor <[email protected]>
@josephismikhail
Copy link
Copy Markdown
Contributor

Re-reviewed against the updated server side (reapply/subsystems-detailed-api-v2 at 5165246). The memory-layer half is good. OOM fix shipped, response is bounded at ~6 MB worst case, schema includes new *_total fields for truncation indicators, and 400s are returned on invalid params.

However, the CLI side hasn't been updated to match the new server contract, which causes a real UX regression:

Repro

Fresh ingest of guava (178 scored regions) against the updated memory-layer:

$ ix subsystems --list           # baseline, no flag
→ 178 regions

$ ix subsystems --list --detailed
→ 50 regions (silently truncated by server default limit)

The CLI calls GET /v1/subsystems?detailed=true with no query params, so it gets the server's default page (50 regions, default caps). There is no indication to the user that 128 more regions exist, no way to access pages 2+, and no way to scope the request to specific regions.

Cause

listSubsystems({ detailed }) in ix-cli/src/client/api.ts doesn't pass through any of the new server-side query params (limit, offset, regions, edge_cap, member_file_cap). The subsystems --list --detailed command in ix-cli/src/cli/commands/subsystems.ts has no
flags for them either.

Suggested fixes, pick whichever fits your taste

  1. Auto-paginate. CLI loops with offset += returned until returned < limit, stitches the result. User sees the full set with no new flags. Simplest UX, but issues N HTTP calls for large maps.
  2. Pass-through flags. Add --limit, --offset, --regions, --edge-cap, --member-file-cap to subsystems --list. Maximum control; matches REST contract verbatim. Requires user to know about pagination.
  3. Default to max limit (200) and warn on truncation. Send ?limit=200 by default; if response's pagination.returned < total_regions (or however the server signals truncation), print a one-line warning telling the user to use --regions or page manually. Cheapest middle
    ground.

My vote is (1) + (2). Auto-paginate by default for the common case, plus expose flags for power users / scripts that want to scope or stream.

Other small notes from the re-review

  • The CLI's text-format --detailed path falls through to a raw JSON dump (no printScores formatter). Same as before — acceptable, but now that responses can have pagination metadata, it's worth either including that in the JSON dump or omitting it deliberately.
  • Version bump to 0.6.1 in package.json still applies cleanly; no rebase needed against current main.

Memory-layer side LGTM, CLI side blocked on this. Once the CLI is wired up, both can ship together as 0.6.1.

Adjust the "my vote" line if you have a strong preference different from mine.

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