<p>
The Appwrite CLI can be used in a non-interactive and headless manner, without saving configuration or sessions. This is especially useful when you want to automate tasks on a CI server.
</p>
<h2><a href="/docs/commandline-ci#CIMode" id="CIMode">CI Mode</a></h2>

<p>You can enable CI mode for the Appwrite CLI by setting the <b>project ID, endpoint, and API Key</b>:</p>

<div class="ide margin-bottom" data-lang="bash" data-lang-label="CLI">
    <pre class="line-numbers"><code class="prism language-bash" data-prism>appwrite client \
    --endpoint https://cloud.appwrite.io/v1 \
    --projectId [YOUR_PROJECT_ID] \
    --key YOUR_API_KEY</code></pre>
</div>

<p>When you set the global configuration parameters using the <code>appwrite client</code> command, they take precedence over the local configuration parameters in your <code>appwrite.json</code> thereby switching the CLI to non-interactive mode. </p> 

<p>In this mode, the CLI can only interact with one project at a time.</p>

<h2><a href="/docs/commandline-ci#keys" id="keys">API Keys</a></h2>
<p>In CI mode, the CLI uses an <b>API key</b> to authenticate. Your API key must have sufficient permissions to execute the commands you plan to use. <a href="/docs/keys">Learn more about API Keys</a>.</p>

<h2><a href="/docs/commandline-ci#non-interactive" id="non-interactive">Non-interactive Deployment</a></h2>
<p>Appwrite's deploy commands can also be executed in a non-interactive mode. This applies to both function and collection deployment.</p>

<p>You can deploy a function non-interactively by using the <code>--yes</code> option to skip all warnings and specifying which functions you want to deploy.</p>

<p>Deploy a single function by ID:</p>
<div class="ide margin-bottom" data-lang="bash" data-lang-label="CLI">
    <pre class="line-numbers"><code class="prism language-bash" data-prism>appwrite deploy function --functionId [FUNCTION ID] --yes</code></pre>
</div>

<p>Deploy all functions:</p>
<div class="ide margin-bottom" data-lang="bash" data-lang-label="CLI">
    <pre class="line-numbers"><code class="prism language-bash" data-prism>appwrite deploy function --all --yes</code></pre>
</div>

<p>You can deploy databases, collections, teams, and buckets non-interactively in a similar way by using the <code>--all</code> and <code>--yes</code> option.</p>
<p>Deploy all databases and collections:</p>
<div class="ide margin-bottom" data-lang="bash" data-lang-label="CLI">
    <pre class="line-numbers"><code class="prism language-bash" data-prism>appwrite deploy collection --all --yes</code></pre>
</div>

<p>Deploy all teams:</p>
<div class="ide margin-bottom" data-lang="bash" data-lang-label="CLI">
    <pre class="line-numbers"><code class="prism language-bash" data-prism>appwrite deploy team --all --yes</code></pre>
</div>

<p>Deploy all buckets:</p>
<div class="ide margin-bottom" data-lang="bash" data-lang-label="CLI">
    <pre class="line-numbers"><code class="prism language-bash" data-prism>appwrite deploy buckets --all --yes</code></pre>
</div>

