feat(cli): add org get and project get commands#16
Merged
Conversation
Add commands to retrieve detailed information about organizations and projects: - sentry org get [org-slug] - Get organization details with DSN auto-detection - sentry project get [project-slug] --org <org> - Get project details with DSN auto-detection Both commands support: - Positional slug argument or DSN-based auto-detection - --json flag for JSON output - Human-readable formatted output with key details Also adds formatOrgDetails() and formatProjectDetails() formatters with proper null checks for optional features array.
- Add formatFeaturesList() helper to eliminate duplicated features formatting - Add MAX_DISPLAY_FEATURES constant for configurable truncation limit - Improve JSDoc on writeHumanOutput helpers in org/project get commands
- Make features field optional in SentryOrganization and SentryProject types to match actual API behavior - Add formatDetailsHeader() helper to handle empty name/slug edge cases - Add test for partial flags error (--org without project slug)
Add a simple Writer interface ({ write(s: string): void }) to avoid
dependency on Node.js-specific types. This is more idiomatic for Bun
while maintaining testability through the context pattern.
Files updated:
- types/index.ts: Add Writer type
- formatters/json.ts: Use Writer
- All command files: Use Writer instead of NodeJS.WriteStream
3 tasks
betegon
added a commit
that referenced
this pull request
Mar 3, 2026
…ase caching (#307) ## Summary Two optimizations to reduce round-trips during the init wizard: 1. **Pre-computed directory listing** — sends a pre-computed directory listing with the first API call so the server can skip its initial `list-dir` suspend. Saves one full HTTP round-trip in the `discover-context` step. 2. **`_prevPhases` for cross-phase caching** — tracks per-step result history (`stepHistory`) and sends `_prevPhases` with each resume payload. This lets the server reuse results from earlier phases (e.g. the `read-files` phase can reuse data from `analyze`) without re-requesting them. ## Changes - Exports `precomputeDirListing` from `local-ops.ts` — reuses the existing `listDir` function with the same params the server would request (recursive, maxDepth 3, maxEntries 500). The wizard runner calls it before `startAsync` and includes the result as `dirListing` in `inputData`. - Adds a `stepHistory` map to track accumulated local-op results per step. Each resume payload now includes `_prevPhases` containing results from prior phases of the same step. Companion server change: getsentry/cli-init-api#16 ## Test plan - [x] Init tests pass (`bun test test/lib/init/`) - [x] Lint passes - [ ] End-to-end with local dev server 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
sentry org get [org-slug]command to retrieve detailed organization informationsentry project get [project-slug] --org <org>command to retrieve detailed project informationformatOrgDetails()andformatProjectDetails()formatters with human-readable outputfeaturesarray in formattersCommands
Testing