The Appwrite CLI is a command-line application that allows you to interact with the Appwrite server-side APIs and perform server-side tasks quickly using your terminal. A few examples of these tasks including managing resources (documents, files, users), executing and packaging Cloud Functions, and any other operation available through the Appwrite API.
The Appwrite CLI installation is extremely easy and fast. The CLI is packaged as a Docker container, which makes it secure by default, requires no dependencies but Docker, and truly platform and language agnostic.
The next step is to have your Appwrite server running. You can grab our simple installation command and execute it.
To install the CLI, we recommend running the installation script for your operating system.
Once the setup is complete, you can validate your installation using:
To start using the CLI with your project, you will first need to initialize the CLI with:
Great! Now you're all set to use the Appwrite CLI. You can access your CLI using the following general syntax:
To create a new user in your project, you can use the `create` command. To successfully create a user, make sure your API key is granted with the scope "users.write".
To get a list of all your project users, you can use the `list` command. To successfully view the list, make sure your API key is granted with the scope "users.read".
To get a list of all your collections, you can use the `listCollections` command. To successfully view the list, make sure your API key is granted with the scope "collections.read".
To get more information on a particular collection, you can make use of the `getCollection` command and pass in the `collectionId`. To successfully fetch the collection, make sure your API key is granted with the scope "collections.read".
At any point, if you would like to change your project endpoint, project ID, project Key, selfSigned certificate acceptance or locale configuration you set during the CLI init, you can make use of the `client` service.
If you get stuck anywhere, you can always use the `help` command to get the usage examples. All the examples are also available on the Appwrite API specs docs, and you can view them by switching the examples to the "Appwrite CLI" from the top dropdown.