Claude
Skills
Sign in
Back

cli

Included with Lifetime
$97 forever

Appwrite CLI skill. Use when managing Appwrite projects from the command line. Covers installation, login, project initialization, deploying functions/sites/tables/buckets/teams/topics, managing resources, non-interactive CI/CD mode, and generating type-safe SDKs.

Cloud & DevOps

What this skill does



# Appwrite CLI

## Installation

```bash
# npm
npm install -g appwrite-cli

# macOS (Homebrew native binary)
brew install appwrite

# macOS / Linux (script)
curl -sL https://appwrite.io/cli/install.sh | bash

# Windows (Scoop)
scoop install https://raw.githubusercontent.com/appwrite/sdk-for-cli/master/scoop/appwrite.config.json
```

Verify installation:

```bash
appwrite -v
```

## Login & Initialization

```bash
# Login to your account
appwrite login

# Login to a self-hosted instance
appwrite login --endpoint "https://your-instance.com/v1"

# Initialize a project (creates appwrite.config.json)
appwrite init project

# Verify by fetching project info
appwrite projects get --project-id "<PROJECT_ID>"
```

## Configuration

```bash
# Authenticate with Appwrite
appwrite login
```

> For the full list of CLI commands, see [CLI Commands](https://appwrite.io/docs/tooling/command-line/commands).
> For headless / CI/CD usage, see [Non-Interactive Mode](https://appwrite.io/docs/tooling/command-line/non-interactive).

## appwrite.config.json

All resources are configured in a single `appwrite.config.json` file at the project root:

```json
{
    "projectId": "<PROJECT_ID>",
    "endpoint": "https://<REGION>.cloud.appwrite.io/v1",
    "functions": [],
    "sites": [],
    "tablesDB": [],
    "tables": [],
    "buckets": [],
    "teams": [],
    "topics": []
}
```

## Deploying Functions

```bash
# Create a new function
appwrite init functions

# Pull existing functions from Console
appwrite pull functions

# Deploy functions
appwrite push functions
```

### Function configuration in appwrite.config.json

```json
{
    "functions": [
        {
            "$id": "<FUNCTION_ID>",
            "name": "userAuth",
            "enabled": true,
            "live": true,
            "logging": true,
            "runtime": "node-18.0",
            "deployment": "<DEPLOYMENT_ID>",
            "vars": [],
            "events": [],
            "schedule": "",
            "timeout": 15,
            "entrypoint": "userAuth.js",
            "commands": "npm install",
            "version": "v3",
            "path": "functions/userAuth"
        }
    ]
}
```

### Function commands

| Command | Description |
|---------|-------------|
| `appwrite functions list` | List all functions |
| `appwrite functions create` | Create a new function |
| `appwrite functions get --function-id <ID>` | Get a function by ID |
| `appwrite functions update --function-id <ID>` | Update a function |
| `appwrite functions delete --function-id <ID>` | Delete a function |
| `appwrite functions list-runtimes` | List all active runtimes |
| `appwrite functions list-deployments --function-id <ID>` | List deployments |
| `appwrite functions create-deployment --function-id <ID>` | Upload a new deployment |
| `appwrite functions update-deployment --function-id <ID> --deployment-id <ID>` | Set active deployment |
| `appwrite functions delete-deployment --function-id <ID> --deployment-id <ID>` | Delete a deployment |
| `appwrite functions download-deployment --function-id <ID> --deployment-id <ID>` | Download deployment |
| `appwrite functions create-execution --function-id <ID>` | Trigger execution |
| `appwrite functions list-executions --function-id <ID>` | List execution logs |
| `appwrite functions get-execution --function-id <ID> --execution-id <ID>` | Get execution log |
| `appwrite functions list-variables --function-id <ID>` | List variables |
| `appwrite functions create-variable --function-id <ID> --key <KEY> --value <VALUE>` | Create variable |
| `appwrite functions update-variable --function-id <ID> --variable-id <ID> --key <KEY> --value <VALUE>` | Update variable |
| `appwrite functions delete-variable --function-id <ID> --variable-id <ID>` | Delete variable |

### Trigger a function with body

```bash
appwrite functions create-execution \
    --function-id <FUNCTION_ID> \
    --body '{"key": "value"}'
```

### Local development

```bash
appwrite run functions
```

## Deploying Sites

```bash
# Create a new site
appwrite init sites

# Pull existing sites from Console
appwrite pull sites

# Deploy sites
appwrite push sites
```

### Site configuration in appwrite.config.json

```json
{
    "sites": [
        {
            "$id": "<SITE_ID>",
            "name": "Documentation template",
            "enabled": true,
            "logging": true,
            "framework": "astro",
            "timeout": 30,
            "installCommand": "npm install",
            "buildCommand": "npm run build",
            "outputDirectory": "./dist",
            "specification": "s-1vcpu-512mb",
            "buildRuntime": "node-22",
            "adapter": "ssr",
            "fallbackFile": "",
            "path": "sites/documentation-template"
        }
    ]
}
```

### Site commands

| Command | Description |
|---------|-------------|
| `appwrite sites list` | List all sites |
| `appwrite sites create` | Create a new site |
| `appwrite sites get --site-id <ID>` | Get a site by ID |
| `appwrite sites update --site-id <ID>` | Update a site |
| `appwrite sites delete --site-id <ID>` | Delete a site |
| `appwrite sites list-frameworks` | List available frameworks |
| `appwrite sites list-specifications` | List allowed specs |
| `appwrite sites list-templates` | List available templates |
| `appwrite sites get-template --template-id <ID>` | Get template details |
| `appwrite sites list-deployments --site-id <ID>` | List deployments |
| `appwrite sites create-deployment --site-id <ID>` | Create deployment |
| `appwrite sites get-deployment --site-id <ID> --deployment-id <ID>` | Get deployment |
| `appwrite sites delete-deployment --site-id <ID> --deployment-id <ID>` | Delete deployment |
| `appwrite sites update-site-deployment --site-id <ID> --deployment-id <ID>` | Set active deployment |
| `appwrite sites update-deployment-status --site-id <ID> --deployment-id <ID>` | Cancel ongoing build |
| `appwrite sites list-variables --site-id <ID>` | List variables |
| `appwrite sites create-variable --site-id <ID> --key <KEY> --value <VALUE>` | Create variable |
| `appwrite sites update-variable --site-id <ID> --variable-id <ID> --key <KEY> --value <VALUE>` | Update variable |
| `appwrite sites delete-variable --site-id <ID> --variable-id <ID>` | Delete variable |
| `appwrite sites list-logs --site-id <ID>` | List request logs |
| `appwrite sites get-log --site-id <ID> --log-id <ID>` | Get a log |
| `appwrite sites delete-log --site-id <ID> --log-id <ID>` | Delete a log |

## Managing Tables (Databases)

```bash
# Create a new table
appwrite init tables

# Pull existing tables from Console
appwrite pull tables

# Deploy tables
appwrite push tables
```

### Table configuration in appwrite.config.json

```json
{
    "tablesDB": [
        {
            "$id": "<DATABASE_ID>",
            "name": "songs",
            "enabled": true
        }
    ],
    "tables": [
        {
            "$id": "<TABLE_ID>",
            "$permissions": ["create(\"any\")", "read(\"any\")"],
            "databaseId": "<DATABASE_ID>",
            "name": "music",
            "enabled": true,
            "rowSecurity": false,
            "columns": [
                {
                    "key": "title",
                    "type": "varchar",
                    "required": true,
                    "size": 255
                }
            ],
            "indexes": []
        }
    ]
}
```

### Database commands (TablesDB)

| Command | Description |
|---------|-------------|
| `appwrite tables-db list-tables --database-id <ID>` | List tables |
| `appwrite tables-db create-table --database-id <ID>` | Create table |
| `appwrite tables-db get-table --database-id <ID> --table-id <ID>` | Get table |
| `appwrite tables-db update-table --database-id <ID> --table-id <ID>` | Update table |
| `appwrite tables-db delete-table --database-id <ID> --table-id <ID>` | Delete table |
| `appwrite tables-db list-columns --database-id <ID> --table-id <ID>` | List colu
Files: 1
Size: 16.4 KB
Complexity: 21/100
Category: Cloud & DevOps

Related in Cloud & DevOps