Skip to content

feat(list): add --all flag to list commands for cross-project listing#6

Open
tupe12334 wants to merge 1 commit into
mainfrom
claude/add-all-flag-to-list-commands
Open

feat(list): add --all flag to list commands for cross-project listing#6
tupe12334 wants to merge 1 commit into
mainfrom
claude/add-all-flag-to-list-commands

Conversation

@tupe12334

Copy link
Copy Markdown
Member

Summary

This PR adds a -a/--all flag to all list commands (issues, docs, prs, users) that enables listing entities across all tracked projects in the organization. This addresses the need for users to check entities across all projects when they are not in a centy-initialized folder.

Key Features

  • Cross-project listing: Use -a or --all to list entities from all tracked projects
  • Grouped output: Human-readable output groups results by project name for clarity
  • Project context in JSON: JSON output includes projectName and projectPath for each entity
  • Graceful error handling: Individual project errors don't fail the entire operation
  • Filter compatibility: All existing filters (status, assignee, labels, etc.) work seamlessly with --all
  • Comprehensive tests: New utility functions include full test coverage

Changes

Modified files:

  • src/commands/list/docs.ts - Added --all flag and listAll() method
  • src/commands/list/issues.ts - Added --all flag and listAll() method
  • src/commands/list/prs.ts - Added --all flag and listAll() method
  • src/commands/list/users.ts - Added --all flag and listAll() method

New files:

  • src/utils/list-across-projects.ts - Core utility for cross-project listing
  • src/utils/list-across-projects.spec.ts - Tests for cross-project utility
  • src/utils/group-by-project.ts - Helper for grouping entities by project
  • src/utils/group-by-project.spec.ts - Tests for grouping utility

Test Plan

  • Run centy list issues --all outside a centy folder
  • Run centy list docs --all and verify grouping by project
  • Run centy list prs --all --json and verify project context is included
  • Run centy list users --all and verify all tracked projects are queried
  • Test with filters: centy list issues --all --status open
  • Verify graceful error handling when one project fails
  • Run existing tests: pnpm test
  • Verify backward compatibility: commands without --all work as before

Related Issue

Closes #98

🤖 Generated with Claude Code

Add -a/--all flag to list commands (issues, docs, prs, users) that enables
listing entities across all tracked projects. This is particularly useful when
users are not in a centy-initialized folder but want to check across all projects.

Features:
- Results grouped by project name in human-readable output
- JSON output includes project context (projectName, projectPath)
- Individual project errors are gracefully handled and don't fail the entire operation
- All existing filters (status, assignee, etc.) work with the --all flag
- New utility functions for cross-project operations with comprehensive tests

Closes #98

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
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.

1 participant