Non-interactive_
Deploy changes to Appwrite projects to migrate databases and tables schema, functions, teams, buckets, and more.
2 min read
The Appwrite CLI can be used in a non-interactive and headless manner. This is especially useful when you want to automate tasks on a continuous integration server. You can enable the non-interactive mode for the Appwrite CLI by setting the project ID, endpoint, and API Key:
appwrite client \ --endpoint https://<REGION>.cloud.appwrite.io/v1 \ --project-id <PROJECT_ID> \ --key YOUR_API_KEYThe appwrite client command stores the endpoint and API key in the CLI's global configuration, and writes the project ID to your project config file, appwrite.config.json by default.
In this mode, the CLI can only interact with one project at a time.
API Keys
In non-interactive mode, the CLI uses an API key to authenticate. Your API key must have sufficient permissions to execute the commands you plan to use. Learn more about API Keys.
Deployment
Appwrite's push commands can also be executed in a non-interactive mode. This applies to the following resources: functions, tables, buckets, teams, and messaging topics.
You can push a resource non-interactively by using the --force option to skip all warnings and specify which resources you want to deploy.
To push all available resources:
appwrite push all --all --forceTo push a single function by ID:
appwrite push functions --function-id [FUNCTION ID] --forcePush all functions:
appwrite push functions --all --forceYou can push databases, tables, teams, and buckets non-interactively in a similar way by using the --all and --force option.
Push all databases and tables:
appwrite push tables --all --forcePush all teams:
appwrite push teams --all --forcePush all buckets:
appwrite push buckets --all --forceEnvironments
If your repository keeps a project config file for each environment, set APPWRITE_CONFIG_FILE in the CI job to choose which one the CLI reads. Every command in the job then uses that file.
export APPWRITE_CONFIG_FILE=appwrite.config.prod.jsonappwrite push all --all --forceIf the job also sets APPWRITE_PROJECT_ID or APPWRITE_ENDPOINT, those values take precedence over the ones in the config file. Learn more about multiple environments.
CI/CD integrations
Use providers like Github actions to create continuous integrations and continuous delivery or deployment (CI/CD).
Github
You can use Github actions to automate your Appwrite CLI commands, allowing you to use them even in non-interactive mode.
Was this page helpful?
Share what worked or what we should fix. Once approved, our agents automatically apply suggested updates to the docs.