Skip to content

Commands

CLI Version

All commands are compatible with the latest version of the CLI. We recommend running the CLI on its latest version.

Other than commands to create and push databases, tables, functions, messaging-topics, teams, and buckets, the Appwrite CLI can be used as a Server SDK as well. The Appwrite CLI has a command for every Server API endpoint.

Commands generally follow the following syntax:

Shell
appwrite [COMMAND] [OPTIONS]

Commands

Below is a list of the available commands in the Appwrite CLI. You can get more information on each command by running appwrite [COMMAND] --help.

Run appwrite --help to browse commands grouped by what you want to do, including getting started, managing project settings and resources, and using CLI utilities. The root help uses short descriptions so commonly used commands are easier to find.

General commands

CommandDescription
client [options]
The client command allows you to configure your CLI.
list-organizations [options]
List the organizations available to your current session.
list-projects [options]
List the projects available to your current session, including each project's region and endpoint.
locale
The locale command allows you to customize your app based on your users' location.
graphql
The graphql command allows you to query and mutate any resource type on your Appwrite server.
types [options] <output-directory>
The types command generates type definitions based on your Appwrite database schema. Learn more about type generation.
generate
The generate command creates a type-safe SDK tailored to your project. It detects your project's language and generates typed helpers based on your database schema. Learn more about SDK generation.

Account commands

CommandDescription
login [options]
The login command allows you to authenticate into the CLI. This command expects the console account that you use to log into the Appwrite Console.
logout
The logout command allows you to log out of your Appwrite account.
register
Prints link to register an Appwrite account.
whoami
The whoami command gives information about the currently logged-in user and shows how to recover another saved account when one is available.

Deployment commands

CommandDescription
init [options]
The init command provides a convenient wrapper for creating and initializing projects, functions, tables, buckets, teams, and messaging-topics in Appwrite.
pull
The pull command helps you pull your Appwrite project, functions, tables, buckets, teams, and messaging-topics.
push
The push command provides a convenient wrapper for pushing your functions, tables, buckets, teams, and topics.
run
The run command allows you to run projects locally to allow easy development and quick debugging.

The init, pull, push, and run commands support multi-file project configuration. Use the includes field in appwrite.config.json to move supported resource arrays into separate JSON files while keeping CLI behavior unchanged.

Project commands

CommandDescription
project
Manage project settings, usage, variables, API keys, platforms, and other project-level resources. Pass --project-id to target a project without linking the current directory.
organization
Manage an organization and its projects. Pass --organization-id to target an organization explicitly.
account
The account command allows you to authenticate and manage a user account.
users
The users command allows you to manage your project users.
teams
The teams command allows you to group users of your project and enable them to share read and write access to your project resources.
databases
The databases command allows you to create structured tables of rows and query and filter lists of rows.
functions
The functions command allows you to view, create, and manage your Appwrite Functions.
messaging
The messaging command allows you to send, create, edit, and delete messages.
storage
The storage command allows you to manage your project files.
avatars
The avatars command provides utilities to manage images, icons, and avatars.

Target projects and organizations

Project and organization commands can be run from any directory. Pass the target explicitly when you do not want to use the IDs in appwrite.config.json:

Shell
appwrite project get --project-id "<PROJECT_ID>"
appwrite project list-keys --project-id "<PROJECT_ID>"
appwrite organization list-projects --organization-id "<ORGANIZATION_ID>"

The CLI resolves these IDs in the following order: the command option, the APPWRITE_PROJECT_ID or APPWRITE_ORGANIZATION_ID environment variable, then appwrite.config.json. This makes the same commands usable in scripts without creating a project configuration file.

Shell
APPWRITE_PROJECT_ID="<PROJECT_ID>" appwrite project get
APPWRITE_ORGANIZATION_ID="<ORGANIZATION_ID>" appwrite organization list-projects

When only a project ID is available, the CLI can discover its organization. Project API requests continue to use the project's regional endpoint, while account, organization, and other Console-level requests are sent to the appropriate Console endpoint.

Command options

CommandDescription
-v, --version
Output the version number
-V, --verbose
Show complete error log
-j, --json
Output in JSON format
-f, --force
Skip confirmation prompts
-a,--all
Flag to push all resources
--id [id...]
Flag to pass a list of ids for a given action
--report
Enable reporting in case of CLI errors
-h, --help
Display help for command

Verbose

In case of errors with any command, you can get more information about what went wrong using the --verbose flag

Shell
appwrite users list --verbose

JSON

By default, output is rendered in a tabular format. To format the output as JSON, use the --json flag.

Shell
appwrite users list --json

Force

By default, the Appwrite CLI asks you to confirm destructive operations such as resetting the client or overwriting resources. Use the --force flag to skip confirmation prompts, including in non-interactive scripts.

Shell
appwrite push tables --force
appwrite client --reset --force

Human-readable and JSON output

By default, the CLI formats responses for quick reading. It summarizes long lists of enabled settings, adds readable hints to timestamps, durations, and byte sizes, and hides secret values. Use --json for filtered JSON or --raw for the complete API response when you need machine-readable output. Add --show-secrets only when you intentionally need secret values in the output.

All

By default, when pushing or pulling resources, Appwrite CLI would ask you to select specific resources. Use the --all flag to select all available options.

Shell
appwrite pull functions --all

Error reporting

If you encounter errors with any command, you can use the --report flag to generate a GitHub reporting link.

Shell
appwrite login --report

View on console

Many resources support the option to view them in the console. Use the --console flag to get a direct link to the console, and add the optional --open flag to automatically open it in the default browser.

Shell
appwrite tables-db get-row \
  --database-id "<DATABASE_ID>" \
  --table-id "<TABLE_ID>" \
  --row-id "<ROW_ID>" \
  --console --open

Filter, sort, and paginate

List commands across services accept a set of dedicated flags for the most common filtering, sorting, and pagination needs, so you don't have to hand-write JSON query strings for everyday cases. These flags are supported on list-* commands such as tables-db list-tables, tables-db list-rows, users list, functions list, messaging list-messages, and similar list endpoints across services.

FlagDescription
--where <expression>
Filter using a simple comparison expression. Supports field=value, field!=value, field>value, field>=value, field<value, and field<=value. Repeat the flag to apply multiple filters. Quote the expression (for example 'year>1999') so that > and < are not interpreted as shell redirection.
--sort-asc <attribute>
Sort results by an attribute in ascending order. Repeat for multiple sort fields.
--sort-desc <attribute>
Sort results by an attribute in descending order. Repeat for multiple sort fields.
--limit <number>
Maximum number of results to return.
--offset <number>
Number of results to skip from the beginning.
--cursor-after <id>
Return results after this cursor ID. Use for forward cursor pagination.
--cursor-before <id>
Return results before this cursor ID. Use for backward cursor pagination.
--select <attribute>
Limit returned attributes on list commands such as tables-db list-rows. Repeat the flag to include multiple attributes.

For example, to fetch the 10 most recently created rows where year is greater than 1999:

Shell
appwrite tables-db list-rows \
    --database-id "<DATABASE_ID>" \
    --table-id "<TABLE_ID>" \
    --where 'year>1999' \
    --sort-desc '$createdAt' \
    --limit 10

The --queries flag is still supported and remains the way to pass raw Appwrite query JSON strings for advanced cases, automation pipelines, or operators that the new flags don't cover. When you mix --queries with the new flags, the raw queries are sent first and the flag-generated queries are appended after.

Shell
appwrite tables-db list-rows \
    --database-id "<DATABASE_ID>" \
    --table-id "<TABLE_ID>" \
    --queries '[{"method":"search","attribute":"title","values":["Avatar"]}]' \
    --limit 10

Examples

Create user

To create a new user in your project, you can use the create command.

Shell
appwrite users create --user-id "unique()" \
    --email hello@appwrite.io \
    --password very_strong_password

List users

To get a list of all your project users, you can use the list command.

Shell
appwrite users list

You can narrow the result set with the filter, sort, and pagination flags. For example, to fetch the 25 most recently created users whose email is verified:

Shell
appwrite users list \
    --where 'emailVerification=true' \
    --sort-desc '$createdAt' \
    --limit 25

List tables

To get a list of all your tables, you can use the list-tables command.

Shell
appwrite tables-db list-tables --database-id "<DATABASE_ID>"

If you wish to parse the output from the CLI, you can request the CLI output in JSON format using the --json flag

Shell
appwrite tables-db list-tables --database-id "<DATABASE_ID>" --json

Get table

To get more information on a particular table, you can make use of the get-table command and pass in the table-id.

Shell
appwrite tables-db get-table --database-id "<DATABASE_ID>" --table-id "<TABLE_ID>"

Create row

To create a new row in an existing table, use the create-row command.

Shell
appwrite tables-db create-row \
    --database-id "<DATABASE_ID>" --table-id "<TABLE_ID>" \
    --row-id 'unique()' --data '{ "Name": "Iron Man" }' \
    --permissions 'read("any")' 'write("team:abc")'