Skip to content

feat: Command Line SDK update for version 17.0.0#283

Merged
ChiragAgg5k merged 5 commits intomasterfrom
dev
Mar 26, 2026
Merged

feat: Command Line SDK update for version 17.0.0#283
ChiragAgg5k merged 5 commits intomasterfrom
dev

Conversation

@ChiragAgg5k
Copy link
Copy Markdown
Member

@ChiragAgg5k ChiragAgg5k commented Mar 24, 2026

This PR contains updates to the Command Line SDK for version 17.0.0.

* Breaking: Removed `--key` option from `appwrite project update-variable`
* Added `documents-db` commands to CLI
* Added `vectors-db` commands to CLI
* Added docs examples for `documents-db` and `vectors-db`
* Added `--variable-id` to `appwrite project create-variable`
* Updated API version badge to 1.9.0
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 24, 2026

Warning

Rate limit exceeded

@ChiragAgg5k has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 3 minutes and 46 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 575b82b4-7ebf-4b67-bb2e-9b058a08f389

📥 Commits

Reviewing files that changed from the base of the PR and between 2fcea37 and fa12c4c.

📒 Files selected for processing (18)
  • CHANGELOG.md
  • README.md
  • docs/examples/project/create-variable.md
  • docs/examples/project/update-variable.md
  • docs/examples/users/update-impersonator.md
  • install.ps1
  • install.sh
  • lib/commands/push.ts
  • lib/commands/run.ts
  • lib/commands/services/account.ts
  • lib/commands/services/health.ts
  • lib/commands/services/project.ts
  • lib/commands/services/projects.ts
  • lib/commands/services/users.ts
  • lib/constants.ts
  • lib/questions.ts
  • package.json
  • scoop/appwrite.config.json
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch dev

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@greptile-apps
Copy link
Copy Markdown

greptile-apps bot commented Mar 24, 2026

Greptile Summary

This PR updates the Appwrite CLI SDK to version 17.0.0, adding two new service modules (documents-db and vectors-db), a new update-impersonator user command, a --variable-id parameter to project create-variable, and removing the --key requirement from project update-variable. It also updates pagination callback signatures in lib/questions.ts and bumps all version references.

Key issues found:

  • Runtime crash in documents-db and vectors-db commands: JSON.parse(data) is called where --data is an optional option in update-documents, upsert-document, and update-document. When users omit --data, data is undefined and JSON.parse(undefined) throws a SyntaxError. All 6 occurrences (3 in each service file) need a data ? JSON.parse(data) : undefined guard.
  • Potential variable sync regression in push.ts and run.ts: The paginate wrapper around listVariables for both functions and sites was removed in favour of a single direct call. If the API does not guarantee all results in one response, projects with many variables will silently have only the first page synced.
  • Unused success import in both documents-db.ts and vectors-db.ts.
  • Missing descriptions for vectors-db commands: Nearly all commands use .description(''), making the --help output empty and unhelpful. The vectorsDB key is also absent from commandDescriptions in lib/parser.ts.

Confidence Score: 2/5

  • Not safe to merge — two new service commands will throw runtime errors when optional --data is omitted, and pagination removal may silently truncate variable syncing.
  • Score lowered due to a definite runtime crash (JSON.parse on undefined) in 6 command handlers across the two new service files, plus a likely regression in push/run variable fetching that could silently break deployments for projects with many variables.
  • lib/commands/services/documents-db.ts and lib/commands/services/vectors-db.ts for the JSON.parse crash; lib/commands/push.ts and lib/commands/run.ts for the pagination regression.

Important Files Changed

Filename Overview
lib/commands/services/documents-db.ts New service file for the Documents DB commands. Contains a critical bug: JSON.parse(data) is called where --data is an optional option in update-documents, upsert-document, and update-document commands, causing runtime SyntaxError when omitted. Also has an unused success import.
lib/commands/services/vectors-db.ts New service file for the Vectors DB commands. Has the same JSON.parse(undefined) bug as documents-db.ts for optional --data options. Additionally, nearly all commands have empty .description('') strings, making --help output uninformative. Unused success import present.
lib/commands/push.ts Removes paginate wrapper around listVariables for both functions and sites. This could silently truncate variable syncing to the first page if projects have many variables. The change should be verified against the updated API behaviour.
lib/commands/run.ts Removes paginate import and replaces the paginated listVariables call with a direct call. API call signature updated to use named object arguments. Same potential pagination regression as push.ts.
lib/commands/services/project.ts Adds --variable-id to create-variable, changes --key from required to optional in update-variable, and updates descriptions and signatures for list-variables. All changes look correct.
lib/commands/services/users.ts Adds update-impersonator command and adds impersonator to the filterable attributes of list. Straightforward and correct.
lib/questions.ts Updates paginate callback signatures to correctly pass pagination query args to list functions — a necessary fix for correct cursor-based pagination behaviour.
lib/constants.ts Version bump from 16.0.0 to 17.0.0. No issues.

Comments Outside Diff (2)

  1. lib/commands/push.ts, line 821-824 (link)

    P1 Pagination removed — only first page of variables fetched

    Previously, paginate(...) was used to retrieve all function variables across multiple pages (up to 100 per page). The replacement directly calls listVariables once, which returns only the default page of results. For projects with many function variables, the remaining ones will silently be ignored during push.

    The same regression applies to the sites listVariables call further down (around line 1193).

    If the API now guarantees that listVariables returns all results in one response, this is fine — but that assumption should be confirmed. Otherwise, the paginate wrapper should be restored.

  2. lib/commands/services/vectors-db.ts, line 813-814 (link)

    P2 Most vectors-db commands have empty descriptions

    Nearly all vectors-db commands use .description(``) (an empty string). For example: list, create, create-text-embeddings, get, update, delete, list-collections, etc. This makes --help output uninformative for users.

    Compare with documents-db, where most commands have meaningful descriptions. The vectorsDB entry is also absent from commandDescriptions in lib/parser.ts, so the top-level command description defaults to "" as well.

    Please populate the command descriptions to improve discoverability.

Reviews (1): Last reviewed commit: "feat: update Command Line SDK to 17.0.0" | Re-trigger Greptile

Comment on lines +354 to +357
actionRunner(
async ({ databaseId, collectionId, data, queries, transactionId }) =>
parse(await (await getDocumentsDBClient()).updateDocuments(databaseId, collectionId, JSON.parse(data), queries, transactionId)),
),
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P0 JSON.parse(undefined) crash on optional --data

--data is defined as an optional .option(...), so when users call update-documents without providing --data, data will be undefined and JSON.parse(undefined) will throw a SyntaxError at runtime.

The same issue affects:

  • upsert-document at line 401 (lib/commands/services/documents-db.ts)
  • update-document at line 417 (lib/commands/services/documents-db.ts)
  • update-documents at line 378 (lib/commands/services/vectors-db.ts)
  • upsert-document at line 423 (lib/commands/services/vectors-db.ts)
  • update-document at line 439 (lib/commands/services/vectors-db.ts)

Guard against undefined before parsing:

Suggested change
actionRunner(
async ({ databaseId, collectionId, data, queries, transactionId }) =>
parse(await (await getDocumentsDBClient()).updateDocuments(databaseId, collectionId, JSON.parse(data), queries, transactionId)),
),
async ({ databaseId, collectionId, data, queries, transactionId }) =>
parse(await (await getDocumentsDBClient()).updateDocuments(databaseId, collectionId, data ? JSON.parse(data) : undefined, queries, transactionId)),

@ChiragAgg5k ChiragAgg5k merged commit 33f4f5e into master Mar 26, 2026
2 of 3 checks passed
@ChiragAgg5k ChiragAgg5k deleted the dev branch March 26, 2026 06:23
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