Docs
Skip to content

CLI

Commands_

Learn about Appwrites CLI and the powerful, feature complete commands to manage Appwrite's auth, databases, functions, storage, and more.

6 min read

Raw

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:

Bash
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.

General commands

CommandDescription
client [options]The client command allows you to configure your CLI.
localeThe locale command allows you to customize your app based on your users' location.
graphqlThe 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.
generateThe 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.
logoutThe logout command allows you to log out of your Appwrite account.
registerPrints link to register an Appwrite account.
whoamiThe whomai command gives information about the currently logged-in user.

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.
pullThe pull command helps you pull your Appwrite project, functions, tables, buckets, teams, and messaging-topics.
pushThe push command provides a convenient wrapper for pushing your functions, tables, buckets, teams, and topics.
runThe 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
accountThe account command allows you to authenticate and manage a user account.
usersThe users command allows you to manage your project users.
teamsThe teams command allows you to group users of your project and enable them to share read and write access to your project resources.
databasesThe databases command allows you to create structured tables of rows and query and filter lists of rows.
functionsThe functions command allows you to view, create, and manage your Appwrite Functions.
messagingThe messaging command allows you to send, create, edit, and delete messages.
storageThe storage command allows you to manage your project files.
avatarsThe avatars command provides utilities to manage images, icons, and avatars.

Command options

CommandDescription
-v, --versionOutput the version number
-V, --verboseShow complete error log
-j, --jsonOutput in JSON format
-f,--forceFlag to confirm all warnings
-a,--allFlag to push all resources
--id [id...]Flag to pass a list of ids for a given action
--reportEnable reporting in case of CLI errors
-h, --helpDisplay help for command

Verbose

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

Bash
appwrite users list --verbose

JSON

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

Bash
appwrite users list --json

Force

By default, when pushing or pulling resources, the Appwrite CLI will ask you to confirm destructive operations. Use the --force flag to verify all questions.

Bash
appwrite push tables --force

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.

Bash
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.

Bash
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.

Bash
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 row and document 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:

Bash
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.

Bash
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.

Bash
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.

Bash
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:

Bash
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.

Bash
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

Bash
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.

Bash
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.

Bash
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")'

Was this page helpful?

Share what worked or what we should fix. Once approved, our agents automatically apply suggested updates to the docs.