Command line interface (CLI)

The Appwrite CLI is a command-line application that allows you to interact with Appwrite to perform server-side tasks using your terminal. This includes creating and managing projects, managing resources (documents, files, users), creating and deploying Appwrite Functions, and other operations available through Appwrite's API.

Installation

The CLI is packaged both as an npm module as well as a standalone binary for your operating system, making it completely dependency free, platform independent and language agnostic.

If you plan to use the CLI to initialize new Appwrite Functions, ensure that Git is installed on your machine.

Install with npm

If you have npm set up, run the command below to install the CLI.

Shell
npm install -g appwrite-cli

Install with script

For a completely dependency-free installation, the CLI also ships with a convenient installation script for your operating system

    Verify installation

    After the installation is complete, you can verify the Appwrite CLI is available by checking its version number.

    Shell
    appwrite -v
    

    Get started

    Before you can use the CLI, you need to login to your Appwrite account using

    Shell
    appwrite login
    

    You can run your first CLI command after logging in. Try fetching information about your Appwrite project.

    Shell
    appwrite projects get --projectId [PROJECT_ID]
    
    Self-signed certificates

    By default, requests to domains with self-signed SSL certificates (or no certificates) are disabled. If you trust the domain, you can bypass the certificate validation using

    Shell
    appwrite client --selfSigned true
    

    Next steps

    You can use the CLI to create and deploy functions and collections. Deploy commands allow you to configure your Appwrite project programmatically and replicate functions and collection schemas across Appwrite projects.

    Learn more about deployment

    Besides utility commands, the CLI can be used to execute commands like a Server SDK.

    Find a full list of commands

    You can choose to use the CLI in a headless and non-interactive mode without the need for config files or sessions. This is useful for CI or scripting use cases.

    Learn more about CI mode

    Help

    If you get stuck anywhere, you can always use the help command to get the usage examples.

    Shell
    appwrite help
    

    Configuration

    At any point, if you would like to change your server's endpoint, project ID, or self-signed certificate acceptance, use the client command.

    Shell
    appwrite client --endpoint https://cloud.appwrite.io/v1
    appwrite client --key 23f24gwrhSDgefaY
    appwrite client --selfSigned true
    appwrite client --reset // Resets your CLI configuration
    appwrite client --debug // Prints your current configuration
    

    Uninstall

    If you installed Appwrite CLI using NPM, you can use the following command to uninstall it.

    Shell
    npm uninstall -g appwrite-cli
    

    If you installed the Appwrite CLI with brew or the installation script for your operating system, use the following command to uninstall it.

      You can also remove the configuration, cookies, and API Keys the Appwrite CLI stored. To remove those, run the following command.