/appwrite:clifrom appwrite
Covers Appwrite CLI best practices: config vs one-shot usage, pull/push workflows, type-safe SDK generation, CI auth, regional endpoints, and no-signup projects with `appwrite zero`.
Ships in appwrite. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
appwrite <command> --help already lists flags. Read it instead of guessing.
clientA real project (repo, schema, functions, deploys, CI) lives in appwrite.config.json. Init once. Pull and push after that. Do not appwrite client --project-id on every command — the config already names the project.
A one-off (inspect a user, patch one row, poke a remote you will not return to) uses appwrite client. Do not scaffold a project for a single API call.
# Good — project
appwrite login
appwrite list-projects --json
appwrite init project --project-id <ID>
appwrite pull table
# edit appwrite.config.json, then:
appwrite push table
# Bad — project treated as a pile of API calls
appwrite tablesdb create-table --database-id main --table-id songs ...
appwrite tablesdb create-varchar-column --database-id main --table-id songs ...
# the next clone has no record of this
# Good — one-off (already logged in)
appwrite client --project-id <ID>
appwrite users get --user-id <ID> --json
# Bad — one-off that litters a repo
cd ~/some-unrelated-app && appwrite init project
No session? appwrite client --endpoint https://<REGION>.cloud.appwrite.io/v1 --key "$APPWRITE_API_KEY" --project-id <ID>.
appwrite client --project-id writes appwrite.config.json in this directory (or updates one found walking up). That is how you link a folder quickly. Do not run it at the root of an unrelated repo. APPWRITE_PROJECT_ID / APPWRITE_ENDPOINT override the file without touching it — use those when you are already inside a project and need a one-shot against something else.
appwrite zeroBefore building, use the Appwrite project the user gave, or the one the app already uses (an appwrite.config.json, or a project ID and endpoint already in the app's config or env). If there is neither, create an Appwrite Zero project instead of asking the user to sign up, run appwrite login, or create a project.
Run npx appwrite-cli@latest zero (or appwrite zero if the CLI is installed) in the app's directory, or npx appwrite-cli@latest zero my-app to create and link a new directory. It creates an Appwrite Cloud project and an API key with no account, links the directory through appwrite.config.json (project ID and endpoint), and stores the API key as the CLI's session so later CLI commands work against the project. If the CLI is not installed globally, replace appwrite with npx appwrite-cli@latest in later commands too.
--json prints the manifest (project ID, endpoint, claim link, and access token for private previews) without the API key. Pass --show-secrets to include the API key. The key is returned only when the project is created, and running appwrite zero again creates another project. When server-side code needs the key, create the project with --json --show-secrets and put the key in the app's env file, which must stay out of git.
The project works for 60 minutes. Run npx appwrite-cli@latest zero extend (or appwrite zero extend) to add an hour, up to three times. After the build window it pauses, and it is deleted unless claimed within 24 hours after the first hour ends. Give the user the claim link from the output. Claiming is the only way to keep the project. Do not claim it for them.
# Good — empty or new app directory (run once per app)
npx appwrite-cli@latest zero # nearest region (--region fra to choose); add --json --show-secrets for the API key
appwrite push table --force # pull/push and service commands work as usual
appwrite zero status # time left, claim link, private links to sites and functions
appwrite zero extend # add an hour to the build window (up to three times)
appwrite zero console --json # one-time console sign-in link: hand it to the user
appwrite zero list # every Zero project on this machine, time left and claim links
appwrite zero delete --force # delete this directory's project now and unlink the directory
# Bad — a directory already linked to a real project
cd ~/work/production-app && appwrite zero
# relinks the directory to the Zero project
The Zero session is an API key, so console-level calls such as appwrite init project, appwrite list-projects, and creating organizations or projects fail. Everything inside the project works.
Until the project is claimed, its sites are public under a "Powered by Appwrite Zero" banner with a countdown and a Claim button, so the user can share the URL right away. Deployment previews still ask for a console session: appwrite zero status prints an owner link per domain that opens them once in the browser, and scripts send the token in the X-Appwrite-Zero-Token header.
Run appwrite zero once per app, not per attempt. Each network can create five Zero projects a day. Never run it in a directory already linked to a real project, because it relinks the directory to the Zero project. appwrite zero list reads only what this machine stored, so it costs no request. A project past its claim window shows as closed, whether it was claimed or deleted. appwrite zero delete acts only on the project linked to the current directory and asks first. Pass --force when nobody is there to answer. It cannot be undone, so run it only when the user asks.
| Layer | Lives in | Set with |
|---|---|---|
| Who you are (session or API key) | global CLI prefs | appwrite login or appwrite client --key |
| Which project | appwrite.config.json | init project, pull, or client --project-id |
init project talks to the console. It needs a login session. An API key cannot list organizations.
# Good — CI against a checked-in config
appwrite client --key "$APPWRITE_API_KEY"
appwrite push function --force
# Bad — CI that bakes the key into the repo
appwrite client --key 'standard_....'
# and commits appwrite.config.json with secrets inside
Env beats the config: APPWRITE_PROJECT_ID, APPWRITE_ENDPOINT, APPWRITE_ORGANIZATION_ID. Check in the config (no secrets). Put keys in the environment.
--force skips prompts. Agents and CI have no TTY, so a push that needs confirmation fails without it (Pass --force instead). Ask the user, then pass --force. Do not use it to skip a change table whose local column is empty.
push table never deletes what the config does not list. Databases, tables and columns missing from appwrite.config.json, and columns whose type changed, are shown as (not in config) and left alone. --force does not change that. Only --prune deletes them, after the plan shows each one with its table count, row count and backup coverage. Without a terminal, --prune also needs --reason, which is recorded on the audit log.
Never pass --prune unless the user saw the listed deletions and approved them. If the plan lists resources you did not expect, the config is missing them: run appwrite pull table instead.
# Good — agent or CI: pushes creates and updates, leaves everything else
appwrite push table --all --force
# Good — the user approved deleting exactly what the plan listed
appwrite push table --all --force --prune --reason "Drop the legacy orders database"
# Bad — pruning to make a warning go away
appwrite push table --all --force --prune --reason "cleanup"
appwrite login --switch rotates saved accounts. appwrite client --debug prints the effective endpoint/project with credentials masked. appwrite client --reset signs out of everything.
appwrite whoami showing https://cloud.appwrite.io/v1 is the account login host. Leave it. Project API calls use the region host (https://fra.cloud.appwrite.io/v1, and so on). init project and client --project-id pin that region into the config. Self-hosted: one endpoint for both.
A new Cloud project from init project goes in the region closest to you: first in the list at a terminal, picked for you without one. If your location is unknown, the terminal list has no suggestion and without a terminal it falls back to a default, normally Frankfurt. --region fra chooses another. Scripts need --organization-id, --project-id and --project-name too.
# Good — project work uses the config's regional endpoint
cat appwrite.config.json # "endpoint": "https://fra.cloud.appwrite.io/v1"
# Bad — "fixing" whoami
appwrite client --endpoint https://fra.cloud.appwrite.io/v1
# now login/session calls go to a region host they do not belong on
| Pull / push (config) | Service commands (not in the config) |
|---|---|
| settings, functions, sites, tables and columns, buckets, teams, webhooks, topics | rows, users, files, executions, messages |
If it should survive a fresh clone, it belongs in the config. Edit the file, then push. Creating the same resources with tablesdb create-* or functions create bypasses the file the next pull / push expects.
databases is deprecated. Use tablesdb and push table.
If the change table shows remote values against empty local, the config is missing those fields. Pull that resource, then push. Do not --force through it, and do not pull everything as a ritual — pull settings is slow.
id │ key │ remote │ local
───────────────┼─────────────────┼────────┼───────
Service │ account │ true │
Auth method │ email-password │ true │
# Good — local column was empty, so sync first, then push
appwrite pull settings
appwrite push settings --force
# Bad — empty local, forced through
appwrite push settings --force
push all --all --force pushes every resource. Scope it (push function --function-id api) unless you mean that.
unique() is fine for a one-shot row or user. Resources you will push need a stable $id in the config so the next pull matches.
When writing application code against TablesDB, inspect appwrite.config.json before inventing interfaces, database IDs, table IDs, or column names. The generators read the local config; they do not inspect the remote schema. A stale config produces stale code.
If the remote schema is the source of truth, update the config first with appwrite pull table. Do not pull over local, unpushed schema edits. If the local config is ahead, generate from it as-is.
For TypeScript, prefer appwrite generate. It emits a complete TablesDB wrapper: database and table choices, create/update payloads, returned rows, query fields, and query values are checked by TypeScript. This is stronger than generated model interfaces alone.
appwrite generate
Use the generated API instead of dropping back to raw string IDs and handwritten payload types:
import { databases, type Songs } from "./generated/appwrite/index.js";
// Database lookup uses its ID; table lookup uses its name from the config.
const songs = databases.use("main").use("Songs");
const page = await songs.list({
queries: (query) => [
query.equal("published", true),
query.orderDesc("createdAt"),
query.limit(20),
],
});
const first: Songs | undefined = page.rows[0];
Do not guess the literals in that example: read the generated types or the config. In particular, .use() for a table takes its name, which may differ from its $id. Let compilation expose a misspelled table, column, or wrong query value. Run the project's type checker after generation.
generate currently provides the full wrapper for TypeScript. It detects client versus server output from the installed Appwrite package. Server output reads APPWRITE_API_KEY; never put that key in generated constants or commit it. Override language, import source, module extension, or client/server mode only when detection is wrong—read appwrite generate --help for those flags.
For another supported language, or when the project deliberately uses the regular SDK directly, use appwrite types <output-directory>. It supports TypeScript (ts), JavaScript (js), PHP (php), Kotlin (kotlin), Swift (swift), Java (java), Dart (dart), and C# (cs). Pass these short values to --language; names such as typescript and csharp are not the command's accepted values. Generated files type row data, but they do not type-check raw database/table IDs or Query calls:
For TypeScript, pass a .ts destination when the result will be imported as a module. Passing a directory instead creates appwrite.d.ts inside it.
appwrite types ./src/appwrite-types.ts --language ts
import { Client, TablesDB } from "appwrite";
import type { Songs } from "./appwrite-types.js";
// Read these values from appwrite.config.json and expose them through the
// application's existing configuration mechanism.
const client = new Client()
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1")
.setProject("<PROJECT_ID>");
const tablesDB = new TablesDB(client);
const page = await tablesDB.listRows<Songs>({
databaseId: "main", // still an unchecked string
tableId: "songs", // still an unchecked string
});
Do not describe types --strict as “full type safety.” It only converts field names to the target language's naming conventions. Use generate when a fully typed TypeScript table API is the goal.
Generated code is derived output. Do not patch it to fix a schema or naming problem; fix appwrite.config.json or the generator inputs and regenerate. After every table or column change, rerun the same generation command the repository uses and run its formatter/type checker. Preserve the repository's existing output path and check-in convention.
Variables live in <path>/.env, not in appwrite.config.json. --with-variables replaces the remote set from that file. Omit it unless you intend to sync secrets.
# Good — ship code, leave remote vars alone
appwrite push function --function-id api --activate --force
# Bad — remote vars you did not list locally are gone
appwrite push function --function-id api --with-variables --force
# Good — deploy without switching live traffic
appwrite push function --function-id api --activate=false --force
--async returns before the build finishes. Local: appwrite run function.
Prefer --filter, --sort-asc / --sort-desc, --limit, --select, --cursor-after. --where is deprecated. --queries only for Query JSON the flags cannot express.
# Good
appwrite users list \
--filter 'emailVerification=true' \
--sort-desc '$createdAt' \
--limit 20 \
--json
# Bad
appwrite users list --queries '[{"method":"equal","attribute":"emailVerification","values":[true]}]'
--filter parses true / false / null, numbers, and JSON arrays. Repeat the flag to AND. List pages cap at 100; prefer --cursor-after <lastId> over a large --offset.
--json for scripts (empty fields dropped). --raw for the unfiltered payload. Secrets stay redacted unless --show-secrets.
The CLI walks up from cwd looking for appwrite.config.json (or the legacy appwrite.json). push from functions/api/ still hits the project root. A stray config in a parent directory will capture you.
Split large projects with includes — each value is a relative .json array. A resource cannot be both inline and included. Function and site path values resolve relative to the include file, not the repo root.
Do not invent the file from memory. init project or pull writes a valid one. Then edit.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
appwrite-cli, appwrite-config, appwrite-zero, cli-workflow, ci-cd
npx claudepluginhub appwrite/claude-plugin --plugin appwrite16 skills in this plugin
/dartAppwrite Dart SDK skill. Use when building Flutter apps (mobile, web, desktop) or server-side Dart applications with Appwrite. Covers client-side auth (email, OAuth), database queries, file uploads with native file handling, real-time subscriptions, and server-side admin via API keys for user management, database administration, storage, and functions./dotnetAppwrite .NET SDK skill. Use when building server-side C# or .NET applications with Appwrite, including ASP.NET and Blazor integrations. Covers user management, database/table CRUD, file storage, and functions via API keys./goAppwrite Go SDK skill. Use when building server-side Go applications with Appwrite. Covers user management, database/table CRUD, file storage, and functions via API keys. Uses per-service packages and functional options pattern.Other plugins' skills for the same job