feat: Command Line SDK update for version 17.1.0#284
Conversation
* Added `organizations` command group with multiple subcommands * Added `--raw` option for full raw JSON output in version command * Updated docs for `organizations` commands with new examples
WalkthroughThis release adds version 17.1.0 with three main components: a new Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Greptile SummaryThis PR delivers the CLI update for Appwrite SDK v17.1.0. The main additions are a new Key findings:
Confidence Score: 4/5Safe to merge after fixing the empty organizations command description and documenting the --json behavioral change in CHANGELOG; all other findings are minor copy-paste errors. No P0 or hard runtime-breaking issues found. The empty commandDescriptions["organizations"] entry means lib/commands/services/organizations.ts (copy-paste description errors, unused import, missing commandDescriptions entry) and lib/parser.ts (undocumented --json behavioral change) Important Files Changed
|
There was a problem hiding this comment.
Actionable comments posted: 7
🧹 Nitpick comments (1)
lib/commands/services/organizations.ts (1)
100-112: Minor typo in description: "it's" → "its"Line 102 has a grammatical error: "it's aggregation ID" should be "its aggregation ID" (possessive, not contraction).
📝 Proposed fix
organizations .command(`get-aggregation`) - .description(`Get a specific aggregation using it's aggregation ID.`) + .description(`Get a specific aggregation using its aggregation ID.`)🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@lib/commands/services/organizations.ts` around lines 100 - 112, Update the description string for the organizations.command(`get-aggregation`) entry to use the correct possessive "its" instead of the contraction "it's" (change "Get a specific aggregation using it's aggregation ID." to "Get a specific aggregation using its aggregation ID."). Locate the description passed to organizations.command(`get-aggregation`) in organizations.ts and edit that literal to fix the typo.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@docs/examples/organizations/create-key.md`:
- Line 5: Replace the literal scope values in the example command so it uses the
documented placeholder convention; specifically update the `--scopes` argument
from the literal "one two three" to a placeholder like `<SCOPES>` (or `<SCOPE_1>
<SCOPE_2> <SCOPE_3>`), ensuring the `--scopes` flag in the example matches other
placeholders such as `<ORGANIZATION_ID>` and `<NAME>`.
In `@docs/examples/organizations/update-budget.md`:
- Line 4: Replace the literal usage of "--budget 0" with a placeholder to match
the rest of the docs; update the example to use a placeholder like "--budget
<BUDGET>" (or "<NEW_BUDGET>") so readers understand it’s an example value rather
than the intended literal value, and ensure the placeholder name matches
conventions used elsewhere in the examples.
In `@lib/commands/services/organizations.ts`:
- Around line 3-10: The import list in organizations.ts includes an unused
symbol `success` from the parser module; remove `success` from the named imports
(the line importing actionRunner, commandDescriptions, success, parse,
parseBool, parseInteger from "../../parser.js") so only used symbols remain, and
run the linter/format step to ensure import formatting is updated accordingly.
- Around line 252-262: The command organizations.command('get-invoice-download')
incorrectly treats the return of getInvoiceDownload as JSON and calls parse();
add a required option --destination and change the action (inside actionRunner)
to follow the file-download pattern used elsewhere: call (await
getOrganizationsClient()).getInvoiceDownload(organizationId, invoiceId) to get
the URL, fetch the URL, convert response.arrayBuffer() to a Buffer,
fs.writeFileSync(destination, buffer), and call success(`File saved to
${destination}`); remove the parse(...) call and ensure the option name used in
the action matches the new --destination parameter.
- Around line 138-149: The --alerts option on the
organizations.command('update-budget') currently passes alerts as strings to the
SDK; ensure the alerts are parsed to integers before calling updateBudget by
either applying parseInteger to each alert when defining the option or mapping
alerts through parseInteger inside the actionRunner callback (the async handler
that calls getOrganizationsClient().updateBudget). Update the handler signature
that receives { organizationId, budget, alerts } to convert alerts to numeric
percentages (handle undefined) and then call updateBudget with the numeric
array; keep using parse for the response and verify SDK/updateBudget type
expects numbers.
In `@lib/parser.ts`:
- Around line 194-206: In rows.map (producing rowEntries) the code currently
skips object/array values and avoids using formatCellValue, causing fields to
disappear in condensed-table fallback; update the logic in the rowEntries
builder to not continue on object values but instead call formatCellValue(value)
for non-function, non-null values (including objects/arrays and long
strings/BigNumber fallback), push the resulting string into entries ([key,
formattedValue]), and apply the same change to the similar block around the
other occurrence referenced (lines ~223-225) so condensed mode shows “[N items]”
/ “{N keys}” and truncated scalars consistently via formatCellValue.
- Around line 61-104: The current filterObject and filterData implementations
drop object-valued fields (they use "continue" for typeof value === 'object')
and only partially handle arrays, which makes --json lossy; fix by making
filterObject and filterData recursively preserve and clean nested objects/arrays
instead of skipping them (e.g., in filterObject, when value is an object or
array call into the same recursive cleaning logic rather than continue; in
filterData, map arrays recursively and call filterObject for nested plain
objects), and add a separate opt-in compact projection (rename the compact logic
to something like compactFilter and only use it when an explicit flag is passed)
so the default --json behavior remains fully compatible.
---
Nitpick comments:
In `@lib/commands/services/organizations.ts`:
- Around line 100-112: Update the description string for the
organizations.command(`get-aggregation`) entry to use the correct possessive
"its" instead of the contraction "it's" (change "Get a specific aggregation
using it's aggregation ID." to "Get a specific aggregation using its aggregation
ID."). Locate the description passed to organizations.command(`get-aggregation`)
in organizations.ts and edit that literal to fix the typo.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 94079067-64c1-43a6-8869-29c0efbdbb5c
📒 Files selected for processing (57)
CHANGELOG.mdREADME.mdcli.tsdocs/examples/organizations/add-credit.mddocs/examples/organizations/cancel-downgrade.mddocs/examples/organizations/create-downgrade-feedback.mddocs/examples/organizations/create-invoice-payment.mddocs/examples/organizations/create-key.mddocs/examples/organizations/create.mddocs/examples/organizations/delete-backup-payment-method.mddocs/examples/organizations/delete-default-payment-method.mddocs/examples/organizations/delete-key.mddocs/examples/organizations/delete.mddocs/examples/organizations/estimation-create-organization.mddocs/examples/organizations/estimation-delete-organization.mddocs/examples/organizations/estimation-update-plan.mddocs/examples/organizations/get-aggregation.mddocs/examples/organizations/get-available-credits.mddocs/examples/organizations/get-credit.mddocs/examples/organizations/get-invoice-download.mddocs/examples/organizations/get-invoice-view.mddocs/examples/organizations/get-invoice.mddocs/examples/organizations/get-key.mddocs/examples/organizations/get-plan.mddocs/examples/organizations/get-scopes.mddocs/examples/organizations/get-usage.mddocs/examples/organizations/list-aggregations.mddocs/examples/organizations/list-credits.mddocs/examples/organizations/list-keys.mddocs/examples/organizations/list-regions.mddocs/examples/organizations/list.mddocs/examples/organizations/set-backup-payment-method.mddocs/examples/organizations/set-billing-address.mddocs/examples/organizations/set-billing-email.mddocs/examples/organizations/set-billing-tax-id.mddocs/examples/organizations/set-default-payment-method.mddocs/examples/organizations/update-budget.mddocs/examples/organizations/update-key.mddocs/examples/organizations/update-plan.mddocs/examples/organizations/validate-invoice.mddocs/examples/organizations/validate-payment.mdinstall.ps1install.shlib/commands/services/migrations.tslib/commands/services/organizations.tslib/commands/services/projects.tslib/commands/services/proxy.tslib/commands/services/teams.tslib/commands/services/vcs.tslib/constants.tslib/emulation/utils.tslib/parser.tslib/questions.tslib/sdks.tslib/types.tspackage.jsonscoop/appwrite.config.json
This PR contains updates to the Command Line SDK for version 17.1.0.
Changes
organizationscommand group with multiple subcommands--rawoption for full raw JSON output in version commandorganizationscommands with new examplesSummary by CodeRabbit
New Features
organizationscommand group with 40+ subcommands for managing organizations, billing, plans, keys, invoices, and credits.--rawflag for unfiltered JSON output in CLI commands.Documentation
organizationscommand subcommands.Chores