Improve CLI project and organization discovery - #1803
Merged
Conversation
Contributor
Greptile SummaryThe PR enriches organization and project discovery across OAuth, cookie, and self-hosted sessions while adding consistent pagination, filtering, rendering, and interactive hints.
Confidence Score: 5/5The PR appears safe to merge. The previously reported cross-region enrichment failure is resolved because project metadata clients now use the discovered regional endpoint, and no blocking failure remains. Important Files Changed
Reviews (3): Last reviewed commit: "address greptile review feedback (greplo..." | Re-trigger Greptile |
Member
Author
|
@greptile review |
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
list-organizationsandlist-projectslist-projects --organization-idand restore all-organization discovery for self-hosted session loginsLive verification
Built the generated CLI and ran it against an Appwrite Cloud account with 3 organizations and 224 projects.
Organization metadata
Enriched projects across organizations
Verified that enrichment also works for projects outside FRA:
Organization filtering and server-side pagination
The three organization totals were 5, 6, and 213 projects, matching the global total of 224.
Contextual hints
Ran the generated binary under a PTY to exercise the interactive-only path:
A filtered result suggests the matching detail command:
An empty search provides recovery guidance:
Also verified that these hints are absent from
--json,--raw, and piped output. JSON contains the normalized metadata:{ "$id": "63ef1792594ff4f50de2", "name": "Refetch", "organizationId": "6394ab479bf0a354e412", "organization": "Refetch", "region": "fra", "endpoint": "https://fra.cloud.appwrite.io/v1" }OSS self-hosted verification
Switched the generated CLI to an existing self-hosted session at
https://oss.appwrite.org/v1and exercised the console fallback rather than the Cloud-only OAuth2 discovery routes.Organization and project metadata
The normalized self-hosted JSON includes the configured endpoint and the same fields as Cloud:
{ "$id": "appwrite-self-hosted", "name": "Appwrite Self Hosted", "organizationId": "6a6c75b80022febbdc5f", "organization": "Appwrite Labs", "region": "default", "endpoint": "https://oss.appwrite.org/v1" }Filtering, hints, and detail commands
Verified both commands suggested by the discovery output against the self-hosted session:
Also verified self-hosted
--jsonand--raw, the empty-search recovery hint, and that piping the filtered command throughcatsuppresses hints. The active session was switched back to Appwrite Cloud after testing.Test plan
php example.php clicd examples/cli && go mod tidy && go build ./... && go vet ./... && go test ./...cd examples/cli && go test -race ./internal/app ./internal/output ./internal/sdktest -z "$(gofmt -l examples/cli)"composer lintcomposer lint-twigcomposer refactor:check