-
Notifications
You must be signed in to change notification settings - Fork 40
feat: Command Line SDK update for version 11.0.0 #213
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
WalkthroughThis release updates the CLI to version 11.0.0: version strings and installer download URLs updated, package version bumped, and dev dependency replaced with @yao-pkg/pkg. Adds messaging provider operations for Resend (create/update) and documentation examples. Refactors migrations CSV flows by splitting export and import into separate endpoints and functions (create-csv-export, create-csv-import). Enhances push behavior with spatial attribute support (point, linestring, polygon) and a workflow to detect and delete remote tables that no longer exist locally. Minor client header and parser version constant updates. Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
lib/commands/push.js (1)
2051-2060: Restore enabled sync when updating tablesWe now detect
remoteTable.enabled !== table.enabled, but the subsequenttablesDBUpdateTablecall never forwards the updated flag, so the remote record keeps its old value and the drift remains on every push. The TablesDB API accepts anenabledfield alongsidename,permissions, androwSecurity, so we should pass it through here.(appwrite.io)await tablesDBUpdateTable({ databaseId: table['databaseId'], tableId: table['$id'], name: table.name, parseOutput: false, rowSecurity: table.rowSecurity, - permissions: table['$permissions'] + permissions: table['$permissions'], + enabled: table.enabled })
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (15)
CHANGELOG.md(1 hunks)README.md(2 hunks)docs/examples/messaging/create-resend-provider.md(1 hunks)docs/examples/messaging/update-resend-provider.md(1 hunks)docs/examples/migrations/create-csv-export.md(1 hunks)docs/examples/migrations/create-csv-import.md(1 hunks)install.ps1(1 hunks)install.sh(1 hunks)lib/client.js(1 hunks)lib/commands/messaging.js(3 hunks)lib/commands/migrations.js(4 hunks)lib/commands/push.js(7 hunks)lib/parser.js(1 hunks)package.json(2 hunks)scoop/appwrite.config.json(2 hunks)
🧰 Additional context used
🧬 Code graph analysis (4)
lib/client.js (2)
lib/parser.js (1)
os(6-6)lib/config.js (1)
os(1-1)
lib/commands/messaging.js (2)
lib/sdks.js (1)
sdkForProject(24-55)lib/parser.js (3)
parse(20-47)parseBool(176-180)actionRunner(158-166)
lib/commands/push.js (4)
lib/commands/databases.js (6)
databasesCreatePointAttribute(1491-1519)databasesCreateLineAttribute(1402-1430)databasesCreatePolygonAttribute(1580-1608)databasesUpdatePointAttribute(1536-1564)databasesUpdateLineAttribute(1447-1475)databasesUpdatePolygonAttribute(1625-1653)lib/parser.js (6)
log(182-184)table(69-88)chalk(1-1)drawTable(49-106)success(194-196)error(198-200)lib/paginate.js (1)
paginate(1-48)lib/commands/tables-db.js (2)
tablesDBListTables(478-505)tablesDBDeleteTable(651-669)
lib/commands/migrations.js (2)
lib/sdks.js (1)
sdkForProject(24-55)lib/parser.js (3)
parse(20-47)parseBool(176-180)actionRunner(158-166)
🪛 Biome (2.1.2)
lib/commands/migrations.js
[error] 188-188: Do not shadow the global "escape" property.
Consider renaming this variable. It's easy to confuse the origin of variables when they're named after a known global.
(lint/suspicious/noShadowRestrictedNames)
🔇 Additional comments (10)
scoop/appwrite.config.json (1)
3-3: LGTM! Version bump is consistent.The version and download URLs have been correctly updated to 10.2.4 across all architectures.
Also applies to: 9-9, 18-18
install.sh (1)
100-100: LGTM! Version string updated correctly.The download version has been properly updated to 10.2.4.
install.ps1 (1)
16-17: LGTM! Download URLs updated correctly.Both x64 and arm64 Windows download URLs now point to version 10.2.4.
README.md (1)
32-32: LGTM! Documentation updated to reflect new version.The version verification examples now correctly display 10.2.4.
Also applies to: 63-63
lib/parser.js (1)
125-125: LGTM! Error reporting version updated.The CLI version in error reports now correctly reflects 10.2.4.
package.json (2)
5-5: LGTM! Version bumped consistently.Package version updated to 10.2.4, aligning with the release.
42-42: CLI compatibility verified—proceed with manual build testing.The migration from
[email protected]to@yao-pkg/pkg@^6.9.0is CLI-compatible. All build scripts use standard pkg flags (-t node18-{platform},-o,package.json), and @yao-pkg/pkg supports node18 targets with the same syntax. No widely-advertised breaking changes are documented for this version, and @yao-pkg/pkg is an actively maintained fork of vercel/pkg.However, the actual binary generation across all target platforms cannot be verified in this environment. Test the build scripts locally to confirm the generated binaries function as expected before merging.
docs/examples/migrations/create-csv-import.md (1)
1-4: LGTM! Documentation example is clear.The command example correctly demonstrates the CSV import syntax with appropriate placeholder arguments.
lib/client.js (1)
19-20: LGTM! Client headers updated to reflect new version.The SDK version and user-agent headers now correctly identify as version 10.2.4.
docs/examples/messaging/create-resend-provider.md (1)
1-3: ****The documented example is correct and complete. The CLI implementation shows only
--provider-idand--nameare required options; all other parameters (--api-key,--from-name,--from-email, etc.) are optional. The example properly demonstrates the minimal valid command with both required parameters. Expanding it to show optional parameters is unnecessary for basic documentation.Likely an incorrect or invalid review comment.
| appwrite messaging update-resend-provider \ | ||
| --provider-id <PROVIDER_ID> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion | 🟠 Major
🧩 Analysis chain
Update example doesn't demonstrate actual update operation.
The example only shows --provider-id without any fields being updated. An update command example should demonstrate at least one field modification (e.g., --api-key, --from-email, --enabled) so users understand what can be changed.
This makes the example incomplete and not particularly helpful for discovering the update functionality.
🏁 Script executed:
#!/bin/bash
# Verify available updatable fields for update-resend-provider command
rg -A 20 'update-resend-provider' lib/commands/messaging.js | head -30Length of output: 1522
Update example should demonstrate actual field updates.
The example only shows --provider-id without any fields being updated. The command supports multiple optional fields (--name, --enabled, --api-key, --from-name, --from-email, --reply-to-name, --reply-to-email). Expand the example to show at least one field modification so users understand what can be changed—for example:
appwrite messaging update-resend-provider \
--provider-id <PROVIDER_ID> \
--api-key <API_KEY>
This makes the example functional and demonstrates the update capability.
🤖 Prompt for AI Agents
In docs/examples/messaging/update-resend-provider.md around lines 1 to 2, the
CLI example only passes --provider-id and doesn't demonstrate updating any
fields; modify the example to include at least one updatable flag (for example
--api-key or --name and/or --enabled) so it shows a real update operation, using
the same multiline backslash style as the existing snippet and keeping
placeholder values (e.g., --api-key <API_KEY>).
| const migrationsCreateCSVExport = async ({resourceId,bucketId,filename,columns,queries,delimiter,enclosure,escape,header,notify,parseOutput = true, overrideForCli = false, sdk = undefined}) => { | ||
| let client = !sdk ? await sdkForProject() : | ||
| sdk; | ||
| let apiPath = '/migrations/csv/exports'; | ||
| let payload = {}; | ||
| if (typeof resourceId !== 'undefined') { | ||
| payload['resourceId'] = resourceId; | ||
| } | ||
| if (typeof bucketId !== 'undefined') { | ||
| payload['bucketId'] = bucketId; | ||
| } | ||
| if (typeof filename !== 'undefined') { | ||
| payload['filename'] = filename; | ||
| } | ||
| columns = columns === true ? [] : columns; | ||
| if (typeof columns !== 'undefined') { | ||
| payload['columns'] = columns; | ||
| } | ||
| queries = queries === true ? [] : queries; | ||
| if (typeof queries !== 'undefined') { | ||
| payload['queries'] = queries; | ||
| } | ||
| if (typeof delimiter !== 'undefined') { | ||
| payload['delimiter'] = delimiter; | ||
| } | ||
| if (typeof enclosure !== 'undefined') { | ||
| payload['enclosure'] = enclosure; | ||
| } | ||
| if (typeof escape !== 'undefined') { | ||
| payload['escape'] = escape; | ||
| } | ||
| if (typeof header !== 'undefined') { | ||
| payload['header'] = header; | ||
| } | ||
| if (typeof notify !== 'undefined') { | ||
| payload['notify'] = notify; | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rename local escape to avoid shadowing global
Biome flags the destructured escape parameter for shadowing the global escape function. Renaming the local binding (while still sending escape in the payload) clears the lint error without altering behavior.
-const migrationsCreateCSVExport = async ({resourceId,bucketId,filename,columns,queries,delimiter,enclosure,escape,header,notify,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
+const migrationsCreateCSVExport = async ({resourceId,bucketId,filename,columns,queries,delimiter,enclosure,escape: escapeChar,header,notify,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
@@
- if (typeof escape !== 'undefined') {
- payload['escape'] = escape;
+ if (typeof escapeChar !== 'undefined') {
+ payload['escape'] = escapeChar;
}📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| const migrationsCreateCSVExport = async ({resourceId,bucketId,filename,columns,queries,delimiter,enclosure,escape,header,notify,parseOutput = true, overrideForCli = false, sdk = undefined}) => { | |
| let client = !sdk ? await sdkForProject() : | |
| sdk; | |
| let apiPath = '/migrations/csv/exports'; | |
| let payload = {}; | |
| if (typeof resourceId !== 'undefined') { | |
| payload['resourceId'] = resourceId; | |
| } | |
| if (typeof bucketId !== 'undefined') { | |
| payload['bucketId'] = bucketId; | |
| } | |
| if (typeof filename !== 'undefined') { | |
| payload['filename'] = filename; | |
| } | |
| columns = columns === true ? [] : columns; | |
| if (typeof columns !== 'undefined') { | |
| payload['columns'] = columns; | |
| } | |
| queries = queries === true ? [] : queries; | |
| if (typeof queries !== 'undefined') { | |
| payload['queries'] = queries; | |
| } | |
| if (typeof delimiter !== 'undefined') { | |
| payload['delimiter'] = delimiter; | |
| } | |
| if (typeof enclosure !== 'undefined') { | |
| payload['enclosure'] = enclosure; | |
| } | |
| if (typeof escape !== 'undefined') { | |
| payload['escape'] = escape; | |
| } | |
| if (typeof header !== 'undefined') { | |
| payload['header'] = header; | |
| } | |
| if (typeof notify !== 'undefined') { | |
| payload['notify'] = notify; | |
| } | |
| const migrationsCreateCSVExport = async ({resourceId,bucketId,filename,columns,queries,delimiter,enclosure,escape: escapeChar,header,notify,parseOutput = true, overrideForCli = false, sdk = undefined}) => { | |
| let client = !sdk ? await sdkForProject() : | |
| sdk; | |
| let apiPath = '/migrations/csv/exports'; | |
| let payload = {}; | |
| if (typeof resourceId !== 'undefined') { | |
| payload['resourceId'] = resourceId; | |
| } | |
| if (typeof bucketId !== 'undefined') { | |
| payload['bucketId'] = bucketId; | |
| } | |
| if (typeof filename !== 'undefined') { | |
| payload['filename'] = filename; | |
| } | |
| columns = columns === true ? [] : columns; | |
| if (typeof columns !== 'undefined') { | |
| payload['columns'] = columns; | |
| } | |
| queries = queries === true ? [] : queries; | |
| if (typeof queries !== 'undefined') { | |
| payload['queries'] = queries; | |
| } | |
| if (typeof delimiter !== 'undefined') { | |
| payload['delimiter'] = delimiter; | |
| } | |
| if (typeof enclosure !== 'undefined') { | |
| payload['enclosure'] = enclosure; | |
| } | |
| if (typeof escapeChar !== 'undefined') { | |
| payload['escape'] = escapeChar; | |
| } | |
| if (typeof header !== 'undefined') { | |
| payload['header'] = header; | |
| } | |
| if (typeof notify !== 'undefined') { | |
| payload['notify'] = notify; | |
| } |
🧰 Tools
🪛 Biome (2.1.2)
[error] 188-188: Do not shadow the global "escape" property.
Consider renaming this variable. It's easy to confuse the origin of variables when they're named after a known global.
(lint/suspicious/noShadowRestrictedNames)
🤖 Prompt for AI Agents
In lib/commands/migrations.js around lines 188 to 224 the destructured parameter
named "escape" shadows the global escape function; rename the local parameter
(for example to escapeChar or escapeParam) in the function signature and update
all local references to that new name, but keep the payload key as 'escape'
(e.g., payload['escape'] = escapeParam) so behavior and API contract remain
unchanged; ensure no other occurrences still reference the old name.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (8)
CHANGELOG.md(1 hunks)README.md(2 hunks)install.ps1(1 hunks)install.sh(1 hunks)lib/client.js(1 hunks)lib/parser.js(1 hunks)package.json(2 hunks)scoop/appwrite.config.json(2 hunks)
✅ Files skipped from review due to trivial changes (1)
- README.md
🚧 Files skipped from review as they are similar to previous changes (3)
- lib/parser.js
- scoop/appwrite.config.json
- lib/client.js
🔇 Additional comments (4)
install.ps1 (1)
16-17: LGTM!Both x64 and arm64 Windows installer URLs correctly updated to version 11.0.0, consistent with the coordinated version bump across install scripts.
package.json (2)
5-5: Version bump to 11.0.0 is consistent.The version update aligns with the coordinated changes across installation scripts and changelog.
42-42: Dependency replacement is verified as compatible.@yao-pkg/pkg v6.9.0 contains no breaking changes or CLI flag changes, and your build scripts use standard flags (
-tfor target,-ofor output) that remain fully supported. The existing six build targets will continue to work without modification.CHANGELOG.md (1)
3-11: Release notes are well-documented.The changelog clearly documents the new features, fixes, and dependency changes for version 11.0.0. The command rename from
create-csv-migrationtocreate-csv-import(line 5) is appropriately documented and likely justifies the major version bump.
| echo "[2/4] Downloading executable for $OS ($ARCH) ..." | ||
|
|
||
| GITHUB_LATEST_VERSION="10.2.3" | ||
| GITHUB_LATEST_VERSION="11.0.0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
Version bump looks good—verify the GitHub release exists.
The version update to 11.0.0 is consistent with the coordinated changes across the repository.
Run the following script to confirm the 11.0.0 release and binaries are published:
🏁 Script executed:
#!/bin/bash
# Verify the 11.0.0 release exists and binaries are available
# Check if the release exists
gh release view 11.0.0 --repo appwrite/sdk-for-cli --json tagName,publishedAt
# Verify that the expected binary assets are present
gh release view 11.0.0 --repo appwrite/sdk-for-cli --json assets --jq '.assets[].name' | grep -E 'appwrite-cli-(linux|darwin)-(x64|arm64)'Length of output: 35
---
🏁 Script executed:
```shell
#!/bin/bash
# Examine the install.sh file context around line 100
# to understand the download URL and repository information
cat install.sh | head -n 110 | tail -n 20
Length of output: 675
🏁 Script executed:
#!/bin/bash
# Search for version references and repository information
rg -n "appwrite|sdk-for-cli|GITHUB_LATEST_VERSION" install.sh -C 3Length of output: 1798
🏁 Script executed:
#!/bin/bash
# Check GitHub API directly for the latest release of appwrite/sdk-for-cli
# without using gh CLI in case permissions are an issue
curl -s https://api.github.com/repos/appwrite/sdk-for-cli/releases/latest | head -n 50Length of output: 2239
Critical: Release 11.0.0 does not exist on GitHub—install.sh will fail.
The version has been bumped to 11.0.0, but the latest published release is 10.2.3 (published 2025-10-24). The install script will fail when users attempt installation because the download URL will return a "Not Found" error.
Either revert the version to 10.2.3 or ensure the 11.0.0 release is published to appwrite/sdk-for-cli before merging this PR.
🤖 Prompt for AI Agents
In install.sh at line 100, GITHUB_LATEST_VERSION is set to "11.0.0" which does
not exist on GitHub and will cause downloads to 404; change the value back to
the current published release "10.2.3" (or update to whatever tag is actually
published) so the install URL points to an existing release, or alternatively
ensure the 11.0.0 release is published to appwrite/sdk-for-cli before merging
and then keep the variable as-is.
This PR contains updates to the Command Line SDK for version 11.0.0.
Summary by CodeRabbit
New Features
Bug Fixes
Chores