Skip to content

feat: Command Line SDK update for version 15.0.0#278

Merged
ChiragAgg5k merged 4 commits intomasterfrom
dev
Mar 17, 2026
Merged

feat: Command Line SDK update for version 15.0.0#278
ChiragAgg5k merged 4 commits intomasterfrom
dev

Conversation

@ChiragAgg5k
Copy link
Member

@ChiragAgg5k ChiragAgg5k commented Mar 16, 2026

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

Changes

  • Breaking: Replaced specification with buildSpecification and runtimeSpecification; added deploymentRetention
  • Added startCommand option for sites
  • Updated @appwrite.io/console to ^5.0.0
  • Updated prompts to select buildSpecification and runtimeSpecification
  • Fixed unauthorized guests error message to prompt login

Summary by CodeRabbit

  • Breaking Changes

    • Split specification into buildSpecification and runtimeSpecification for functions and sites
    • Added deploymentRetention option
    • Added startCommand option for sites
    • Updated initialization prompts
  • Bug Fixes

    • Improved unauthorized error messages
  • Chores

    • Version 15.0.0 release

@coderabbitai
Copy link

coderabbitai bot commented Mar 16, 2026

Walkthrough

Bumps SDK and packaging from 14.0.1 to 15.0.0 and updates release URLs and installer metadata. Introduces a breaking redesign: splits specification into buildSpecification and runtimeSpecification, adds deploymentRetention for functions/sites and startCommand for sites; updates CLI options, interactive prompts, config schemas, init/pull/push payloads, and questions to reflect the new fields. Adds an unauthorized error detection that suggests logging in (uses EXECUTABLE_NAME), preserves existing headers when creating SDK clients, and expands the invoices list filter to include type. Documentation and changelog updated accordingly.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The pull request title accurately summarizes the primary change: a version update to 15.0.0 with a focus on command-line SDK improvements, which aligns with the major breaking changes in specification redesign and new features introduced.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch dev
📝 Coding Plan
  • Generate coding plan for human review comments

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.

* Breaking: Renamed `--specification` to `--build-specification` and added `--runtime-specification`, `--deployment-retention`.
* Added `type` filter to `list-invoices` queries.
* Added `start-command` option to `sites` creation and update.
* Fixed unauthorized error guidance to prompt login.
@ChiragAgg5k ChiragAgg5k changed the title feat: Command Line SDK update for version 14.0.0 feat: Command Line SDK update for version 15.0.0 Mar 16, 2026
Copy link

@coderabbitai coderabbitai bot left a 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

🧹 Nitpick comments (2)
lib/commands/services/sites.ts (1)

89-90: Prefer the object-form SDK calls here too.

These create() / update() invocations are still using the positional @appwrite.io/console overloads. The SDK already exposes object-style overloads for both methods and marks the positional forms as deprecated, so this template keeps accumulating fragile argument-order maintenance. (github.com)

Also applies to: 200-201

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@lib/commands/services/sites.ts` around lines 89 - 90, Replace the positional
create() and update() calls on the Sites client with the SDK's object-form
overload to avoid fragile argument ordering: change calls to
getSitesClient().create(...) and getSitesClient().update(...) so they pass a
single object with keys matching the parameters from the diff (siteId, name,
framework, buildRuntime, enabled, logging, timeout, installCommand,
buildCommand, startCommand, outputDirectory, adapter, installationId,
fallbackFile, providerRepositoryId, providerBranch, providerSilentMode,
providerRootDirectory, buildSpecification, runtimeSpecification,
deploymentRetention) and do the same for the other occurrence mentioned (lines
~200-201) so the SDK uses the named-parameter overloads instead of positional
args.
lib/commands/services/functions.ts (1)

88-89: Prefer the object-form SDK calls here.

These create() / update() invocations are still using the positional @appwrite.io/console overloads. The SDK already exposes object-style overloads for both methods and marks the positional forms as deprecated, so keeping these call sites positional makes every future parameter addition another ordering hazard. (raw.githubusercontent.com)

Also applies to: 204-205

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@lib/commands/services/functions.ts` around lines 88 - 89, The create/update
calls on getFunctionsClient() are using deprecated positional overloads; change
both getFunctionsClient().create(...) and getFunctionsClient().update(...) to
use the object-style overload by passing a single object with named properties
(e.g., { functionId, name, runtime, execute, events, schedule, timeout, enabled,
logging, entrypoint, commands, scopes, installationId, providerRepositoryId,
providerBranch, providerSilentMode, providerRootDirectory, buildSpecification,
runtimeSpecification, deploymentRetention }) instead of a long positional
argument list so future parameter additions won’t break ordering; keep the
surrounding parse(...) wrapper and ensure the same set of variables are mapped
to the object keys.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@lib/commands/services/sites.ts`:
- Line 70: Update the help text for the Commander option defined as
.option(`--start-command <start-command>`, ...) to explicitly document how to
reset the value to default by passing an empty string (e.g. --start-command ""),
replacing the ambiguous "Leave empty to use default" wording; apply the same
clarification to the other identical option occurrence in the file (the second
.option(`--start-command <start-command>`, ...) around the later block) so both
usages clearly instruct users to pass an explicit empty string to reset rather
than omitting the option.

---

Nitpick comments:
In `@lib/commands/services/functions.ts`:
- Around line 88-89: The create/update calls on getFunctionsClient() are using
deprecated positional overloads; change both getFunctionsClient().create(...)
and getFunctionsClient().update(...) to use the object-style overload by passing
a single object with named properties (e.g., { functionId, name, runtime,
execute, events, schedule, timeout, enabled, logging, entrypoint, commands,
scopes, installationId, providerRepositoryId, providerBranch,
providerSilentMode, providerRootDirectory, buildSpecification,
runtimeSpecification, deploymentRetention }) instead of a long positional
argument list so future parameter additions won’t break ordering; keep the
surrounding parse(...) wrapper and ensure the same set of variables are mapped
to the object keys.

In `@lib/commands/services/sites.ts`:
- Around line 89-90: Replace the positional create() and update() calls on the
Sites client with the SDK's object-form overload to avoid fragile argument
ordering: change calls to getSitesClient().create(...) and
getSitesClient().update(...) so they pass a single object with keys matching the
parameters from the diff (siteId, name, framework, buildRuntime, enabled,
logging, timeout, installCommand, buildCommand, startCommand, outputDirectory,
adapter, installationId, fallbackFile, providerRepositoryId, providerBranch,
providerSilentMode, providerRootDirectory, buildSpecification,
runtimeSpecification, deploymentRetention) and do the same for the other
occurrence mentioned (lines ~200-201) so the SDK uses the named-parameter
overloads instead of positional args.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: a7e2890f-2934-41f1-817c-f00deec18b0b

📥 Commits

Reviewing files that changed from the base of the PR and between 1c76aa0 and 6ceadf5.

📒 Files selected for processing (12)
  • CHANGELOG.md
  • README.md
  • install.ps1
  • install.sh
  • lib/client.ts
  • lib/commands/services/account.ts
  • lib/commands/services/functions.ts
  • lib/commands/services/sites.ts
  • lib/constants.ts
  • lib/sdks.ts
  • package.json
  • scoop/appwrite.config.json
💤 Files with no reviewable changes (1)
  • CHANGELOG.md

* Breaking: Replaced `specification` with `buildSpecification` and `runtimeSpecification`; added `deploymentRetention`
* Added `startCommand` option for sites
* Updated `@appwrite.io/console` to `^5.0.0`
* Updated prompts to select `buildSpecification` and `runtimeSpecification`
* Fixed unauthorized guests error message to prompt login
Copy link

@coderabbitai coderabbitai bot left a 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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
install.ps1 (1)

1-1: ⚠️ Potential issue | 🟡 Minor

Save this script as UTF-8 with BOM.

Line 1+ contains Unicode content; current file encoding triggers PSUseBOMForUnicodeEncodedFile and can cause rendering/parsing inconsistencies on some hosts.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@install.ps1` at line 1, The file contains Unicode on the first line (the
comment starting with ## <script src="/dist/scripts/cli-bash.js"></script>) and
must be saved using UTF-8 with BOM to satisfy PSUseBOMForUnicodeEncodedFile;
update the file encoding to UTF-8 with BOM (e.g., via your editor or an
automated save step) so the BOM is present and re-save install.ps1, then verify
the BOM is present (or add a CI check) to prevent rendering/parsing issues on
hosts that require the BOM.
🧹 Nitpick comments (2)
lib/commands/config.ts (1)

151-151: Add integer and non-negative constraints to deploymentRetention schema.

The field represents a count of days for deployment retention (0 = keep all). Current z.number().optional() incorrectly accepts fractional values (e.g., 2.5), which are semantically invalid and will fail at the API. Add .int().nonnegative() constraints.

♻️ Proposed fix
-    deploymentRetention: z.number().optional(),
+    deploymentRetention: z.number().int().nonnegative().optional(),

Also applies to: 169-169

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@lib/commands/config.ts` at line 151, Update the Zod schema entries for
deploymentRetention to restrict values to non-negative integers: replace the
current z.number().optional() usage for deploymentRetention with
z.number().int().nonnegative().optional() so fractional and negative values are
rejected; apply this change to both occurrences of the deploymentRetention
schema entry (the two places shown in the diff) and keep the existing
.optional() semantics (0 means keep all days).
lib/questions.ts (1)

462-473: Extract shared specification-to-choice mapping to avoid drift.

The same specifications -> choices mapping is duplicated in four places. A small helper will reduce maintenance risk and keep behavior consistent.

♻️ Suggested refactor
+const mapSpecificationChoices = (specifications: SpecificationChoice[]): Choice[] =>
+  specifications.map((spec) => ({
+    name: `${spec.cpus} CPU, ${spec.memory}MB RAM`,
+    value: spec.slug,
+    disabled: spec.enabled === false ? "Upgrade to use" : false,
+  }));

 // in each prompt:
-const choices = specifications.map((spec: SpecificationChoice) => {
-  return {
-    name: `${spec.cpus} CPU, ${spec.memory}MB RAM`,
-    value: spec.slug,
-    disabled: spec.enabled === false ? "Upgrade to use" : false,
-  };
-});
-return choices;
+return mapSpecificationChoices(specifications);

Also applies to: 479-490, 1188-1199, 1205-1216

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@lib/questions.ts` around lines 462 - 473, The mapping from specifications to
Inquirer choices is duplicated; extract a small helper (e.g.,
mapSpecificationToChoice(spec: any): {name: string; value: string; disabled:
string|false}) and replace the inline map in the async choices() block (which
calls getFunctionsService().listSpecifications()) and the three other duplicated
locations (around the other choices blocks at the indicated regions) to call
this helper so all places use the same logic for name, value, and disabled
fields.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@lib/questions.ts`:
- Around line 465-470: The four occurrences use spec: any in duplicate mapping
logic; create a single typed utility (e.g., mapSpecToChoice or buildSpecChoice)
that accepts a typed Specification interface (properties: slug: string, cpus:
number, memory: number, enabled?: boolean) and returns the choice object { name,
value, disabled } and replace the inline mappings in questionsCreateFunction
(build/runtime) and questionsCreateSite (build/runtime) with calls to this
utility; ensure the helper is exported or imported where needed and remove all
`any` annotations so the `@typescript-eslint/no-explicit-any` rule is satisfied.

---

Outside diff comments:
In `@install.ps1`:
- Line 1: The file contains Unicode on the first line (the comment starting with
## <script src="/dist/scripts/cli-bash.js"></script>) and must be saved using
UTF-8 with BOM to satisfy PSUseBOMForUnicodeEncodedFile; update the file
encoding to UTF-8 with BOM (e.g., via your editor or an automated save step) so
the BOM is present and re-save install.ps1, then verify the BOM is present (or
add a CI check) to prevent rendering/parsing issues on hosts that require the
BOM.

---

Nitpick comments:
In `@lib/commands/config.ts`:
- Line 151: Update the Zod schema entries for deploymentRetention to restrict
values to non-negative integers: replace the current z.number().optional() usage
for deploymentRetention with z.number().int().nonnegative().optional() so
fractional and negative values are rejected; apply this change to both
occurrences of the deploymentRetention schema entry (the two places shown in the
diff) and keep the existing .optional() semantics (0 means keep all days).

In `@lib/questions.ts`:
- Around line 462-473: The mapping from specifications to Inquirer choices is
duplicated; extract a small helper (e.g., mapSpecificationToChoice(spec: any):
{name: string; value: string; disabled: string|false}) and replace the inline
map in the async choices() block (which calls
getFunctionsService().listSpecifications()) and the three other duplicated
locations (around the other choices blocks at the indicated regions) to call
this helper so all places use the same logic for name, value, and disabled
fields.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: d7ed1719-87df-4f8b-8e8d-b2c2d0429cfc

📥 Commits

Reviewing files that changed from the base of the PR and between 6ceadf5 and 8463ba0.

📒 Files selected for processing (12)
  • CHANGELOG.md
  • README.md
  • install.ps1
  • install.sh
  • lib/commands/config.ts
  • lib/commands/init.ts
  • lib/commands/pull.ts
  • lib/commands/push.ts
  • lib/constants.ts
  • lib/questions.ts
  • package.json
  • scoop/appwrite.config.json
🚧 Files skipped from review as they are similar to previous changes (3)
  • lib/constants.ts
  • install.sh
  • README.md

@ChiragAgg5k ChiragAgg5k merged commit 2fd7e8d into master Mar 17, 2026
2 checks passed
@ChiragAgg5k ChiragAgg5k deleted the dev branch March 17, 2026 09:43
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.

3 participants