Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
85 changes: 38 additions & 47 deletions templates/agent-skills/cli.md.twig
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,13 @@ appwrite projects get --project-id "<PROJECT_ID>"
## Configuration

```bash
appwrite client --endpoint https://<REGION>.cloud.appwrite.io/v1
appwrite client --key <API_KEY>
appwrite client --self-signed true # for self-signed SSL certs
appwrite client --reset # reset CLI configuration
appwrite client --debug # print current configuration
# 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:
Expand Down Expand Up @@ -258,59 +258,59 @@ appwrite push tables
}
```

### Database commands
### Database commands (TablesDB)

| Command | Description |
|---------|-------------|
| `appwrite databases list-tables --database-id <ID>` | List tables |
| `appwrite databases create-table --database-id <ID>` | Create table |
| `appwrite databases get-table --database-id <ID> --table-id <ID>` | Get table |
| `appwrite databases update-table --database-id <ID> --table-id <ID>` | Update table |
| `appwrite databases delete-table --database-id <ID> --table-id <ID>` | Delete table |
| `appwrite databases list-columns --database-id <ID> --table-id <ID>` | List columns |
| `appwrite databases get-column --database-id <ID> --table-id <ID> --key <KEY>` | Get column |
| `appwrite databases delete-column --database-id <ID> --table-id <ID> --key <KEY>` | Delete column |
| `appwrite databases list-indexes --database-id <ID> --table-id <ID>` | List indexes |
| `appwrite databases create-index --database-id <ID> --table-id <ID>` | Create index |
| `appwrite databases delete-index --database-id <ID> --table-id <ID> --key <KEY>` | Delete index |
| `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 columns |
| `appwrite tables-db get-column --database-id <ID> --table-id <ID> --key <KEY>` | Get column |
| `appwrite tables-db delete-column --database-id <ID> --table-id <ID> --key <KEY>` | Delete column |
| `appwrite tables-db list-column-indexes --database-id <ID> --table-id <ID>` | List indexes |
| `appwrite tables-db create-column-index --database-id <ID> --table-id <ID>` | Create index |
| `appwrite tables-db delete-column-index --database-id <ID> --table-id <ID> --key <KEY>` | Delete index |
Comment on lines +273 to +275
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf 'Template mentions:\n'
rg -n -C2 'appwrite tables-db (list-column-indexes|create-column-index|delete-column-index|list-indexes|create-index|delete-index|get-index)' templates

printf '\nGenerator / spec symbols:\n'
rg -n -C2 '\b(listIndexes|getIndex|createIndex|deleteIndex|listColumnIndexes|createColumnIndex|deleteColumnIndex)\b'

Repository: appwrite/sdk-generator

Length of output: 2678


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf 'Search for tables-db command definitions:\n'
rg -n 'tables-db|tablesDb|tables-db' --type ts --type js | grep -i 'list.*index\|create.*index\|delete.*index' | head -20

printf '\nSearch for column-index command definitions:\n'
rg -n 'column-index|columnIndex|column-indexes|columnIndexes' --type ts --type js | head -20

printf '\nSearch for tables-db in command files:\n'
fd -e ts -e js | xargs grep -l 'tables-db' 2>/dev/null | head -10

Repository: appwrite/sdk-generator

Length of output: 107


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf 'Look for spec or schema files:\n'
find . -type f \( -name '*.json' -o -name '*.yaml' -o -name '*.yml' \) | grep -E '(spec|schema|command)' | head -20

printf '\nSearch for any mention of column-index in the entire repo:\n'
rg -n 'column.index|columnIndex' --type-list | head -20

printf '\nLook in templates/cli for how commands are generated:\n'
find templates/cli -type f -name '*.ts' -o -name '*.js' | head -10

printf '\nCheck for existing tables/database commands in the codebase:\n'
rg -n 'tables-db|database.*index' templates/cli --type ts --type js | head -20

Repository: appwrite/sdk-generator

Length of output: 591


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf 'Check spec.json for tables-db service definitions:\n'
jq '.services[] | select(.name | contains("tables")) | {name, methods: [.methods[] | select(.name | contains("Index")) | {name, sdk: .sdk}]}' tests/resources/spec.json 2>/dev/null | head -50

printf '\nIf above is empty, search raw for index-related methods:\n'
rg -n 'listColumnIndexes|list.*Index|createColumnIndex|create.*Index|deleteColumnIndex|delete.*Index' tests/resources/spec.json

Repository: appwrite/sdk-generator

Length of output: 116


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf 'File size and first lines of spec.json:\n'
wc -l tests/resources/spec.json
head -100 tests/resources/spec.json

printf '\n\nSearch for tables in spec.json:\n'
grep -n '"tables"' tests/resources/spec.json | head -10

printf '\nSearch for columnIndex or column-index:\n'
grep -n -i 'columnindex\|column.index' tests/resources/spec.json

Repository: appwrite/sdk-generator

Length of output: 2820


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf 'Look for command generation or mapping in templates/cli:\n'
find templates/cli -type f | head -20

printf '\nSearch for how method names become command names (camelCase to kebab-case):\n'
rg -n 'listIndexes|createIndex|deleteIndex' templates/cli --type ts --type js -A 2 | head -40

printf '\nLook for "column" and "index" together in templates:\n'
rg -n 'column.*index|index.*column' templates/cli --type ts --type js -i | head -20

Repository: appwrite/sdk-generator

Length of output: 3898


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf 'Search for CLI command generation or spec-to-command mapping:\n'
rg -n 'tables.db|tablesDb|tables-db' --type ts --type js templates/cli | head -20

printf '\nSearch for where commands are registered/generated:\n'
fd -e ts -path '*/templates/cli/*' | xargs grep -l 'command.*register\|addCommand\|register.*command' 2>/dev/null | head -5

printf '\nLook for swagger/spec parsing to command generation:\n'
rg -n 'listIndexes\|createIndex\|deleteIndex' templates/cli/cli.ts.twig -A 3 -B 3 2>/dev/null | head -30

Repository: appwrite/sdk-generator

Length of output: 526


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf 'Read parser.ts around tables-db definition:\n'
sed -n '280,350p' templates/cli/lib/parser.ts

printf '\nSearch for list-column-indexes or similar index commands in parser:\n'
rg -n 'list-column|create-column|delete-column|list-index|create-index|delete-index' templates/cli/lib/parser.ts -A 2 | head -50

Repository: appwrite/sdk-generator

Length of output: 3201


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf 'Search for ALL tables-db command definitions:\n'
rg -n '"tables-db' templates/cli --type ts --type js -A 5 -B 2 | head -60

printf '\nSearch for any index-related commands in the CLI:\n'
rg -n 'index' templates/cli/lib/parser.ts -A 1 -B 1

printf '\nCheck if tables-db has any sub-commands defined:\n'
rg -n 'databases\.|tables-db' templates/cli/cli.ts.twig -A 2 -B 2 2>/dev/null || echo "Not in cli.ts.twig"

Repository: appwrite/sdk-generator

Length of output: 1455


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf 'Look for how databases service commands are generated:\n'
rg -n '"databases' templates/cli/lib/parser.ts -A 10 -B 2

printf '\nSearch for actual command definitions in CLI that show sub-commands:\n'
rg -n 'command\s*=' templates/cli/lib/commands -l | head -10

printf '\nCheck if cli.md.twig is generated or manually maintained:\n'
head -20 templates/agent-skills/cli.md.twig

Repository: appwrite/sdk-generator

Length of output: 120


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf 'Read the cli.md.twig file around the tables-db section:\n'
sed -n '260,290p' templates/agent-skills/cli.md.twig

printf '\n\nCheck if this template is auto-generated or manually edited:\n'
head -30 templates/agent-skills/cli.md.twig

printf '\n\nLook at database commands for comparison:\n'
sed -n '200,260p' templates/agent-skills/cli.md.twig | tail -50

Repository: appwrite/sdk-generator

Length of output: 4044


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf 'Search for any appwrite SDK or spec that documents these commands:\n'
rg -n 'list.*[Ii]ndex|create.*[Ii]ndex|delete.*[Ii]ndex' --type ts --type js --type json | grep -E '(tables|index)' -i | head -30

printf '\nSearch for the actual list of tables-db commands in a spec or command list:\n'
rg -n 'appwrite tables-db' templates/ --type ts --type js --type json | head -20

printf '\nLook for command name generation patterns:\n'
rg -n 'list-|create-|delete-' templates/cli/lib/commands -l | head -5

Repository: appwrite/sdk-generator

Length of output: 1550


These tables-db index commands do not appear to be exposed as direct CLI commands and should not be documented.

The documented commands (list-column-indexes, create-column-index, delete-column-index) do not exist as user-facing CLI commands. The corresponding service methods (listIndexes, createIndex, deleteIndex) are used only internally during table configuration workflows in push and init operations, not as standalone commands users can run. Either remove these rows from the table or verify whether these commands should actually be exposed to users before documenting them.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@templates/agent-skills/cli.md.twig` around lines 273 - 275, The doc lists
non-existent CLI commands (`appwrite tables-db list-column-indexes`,
`create-column-index`, `delete-column-index`) — remove these three rows from the
CLI documentation in templates/agent-skills/cli.md.twig unless you intend to
expose them; if you do intend to expose them, implement CLI handlers that map to
the service methods (`listIndexes`, `createIndex`, `deleteIndex`) and wire them
into the CLI dispatch so the commands actually exist before documenting them.


### Column type commands

> **Note:** The legacy `string` type is deprecated. Use explicit string column types instead.

| Command | Description |
|---------|-------------|
| `create-varchar-attribute` | Varchar column — inline storage, fully indexable (max 16,383 chars, size ≤ 768 for full index) |
| `create-text-attribute` | Text column — off-page storage, prefix index only (max 16,383 chars) |
| `create-mediumtext-attribute` | Mediumtext column — off-page storage (max ~4M chars) |
| `create-longtext-attribute` | Longtext column — off-page storage (max ~1B chars) |
| `create-boolean-attribute` | Boolean column |
| `create-integer-attribute` | Integer column (optional min/max) |
| `create-float-attribute` | Float column (optional min/max) |
| `create-email-attribute` | Email column |
| `create-url-attribute` | URL column |
| `create-ip-attribute` | IP address column |
| `create-datetime-attribute` | Datetime column (ISO 8601) |
| `create-enum-attribute` | Enum column (whitelist of accepted values) |
| `create-relationship-attribute` | Relationship column |

All column commands use `appwrite databases <command> --database-id <ID> --table-id <ID>`.
| `create-varchar-column` | Varchar column — inline storage, fully indexable (max 16,383 chars, size ≤ 768 for full index) |
| `create-text-column` | Text column — off-page storage, prefix index only (max 16,383 chars) |
| `create-mediumtext-column` | Mediumtext column — off-page storage (max ~4M chars) |
| `create-longtext-column` | Longtext column — off-page storage (max ~1B chars) |
| `create-boolean-column` | Boolean column |
| `create-integer-column` | Integer column (optional min/max) |
| `create-float-column` | Float column (optional min/max) |
| `create-email-column` | Email column |
| `create-url-column` | URL column |
| `create-ip-column` | IP address column |
| `create-datetime-column` | Datetime column (ISO 8601) |
| `create-enum-column` | Enum column (whitelist of accepted values) |
| `create-relationship-column` | Relationship column |

All column commands use `appwrite tables-db <command> --database-id <ID> --table-id <ID>`.

### Row operations

```bash
# Create a row
appwrite databases create-row \
appwrite tables-db create-row \
--database-id "<DATABASE_ID>" --table-id "<TABLE_ID>" \
--row-id 'unique()' --data '{ "title": "Hello World" }' \
--permissions 'read("any")' 'write("team:abc")'

# List rows (JSON output)
appwrite databases list-rows \
appwrite tables-db list-rows \
--database-id "<DATABASE_ID>" --table-id "<TABLE_ID>" --json

# Get a row
appwrite databases get-row \
appwrite tables-db get-row \
--database-id "<DATABASE_ID>" --table-id "<TABLE_ID>" --row-id "<ROW_ID>"
```

Expand Down Expand Up @@ -410,8 +410,7 @@ appwrite push topics
```bash
# Create a user
appwrite users create --user-id "unique()" \
--email hello@appwrite.io \
--password very_strong_password
--email hello@appwrite.io

# List users
appwrite users list
Expand Down Expand Up @@ -484,15 +483,7 @@ await customers.createMany([

## Non-Interactive / CI/CD Mode

For headless automation without config files or sessions:

```bash
# Configure client for non-interactive mode
appwrite client \
--endpoint https://<REGION>.cloud.appwrite.io/v1 \
--project-id <PROJECT_ID> \
--key <API_KEY>
```
For headless automation, see the [Non-Interactive Mode docs](https://appwrite.io/docs/tooling/command-line/non-interactive).

### Deploy non-interactively

Expand Down Expand Up @@ -535,7 +526,7 @@ appwrite users list --json
appwrite users list --verbose

# View a row in the Console
appwrite databases get-row \
appwrite tables-db get-row \
--database-id "<DATABASE_ID>" \
--table-id "<TABLE_ID>" \
--row-id "<ROW_ID>" \
Expand Down
10 changes: 5 additions & 5 deletions templates/agent-skills/dart.md.twig
Original file line number Diff line number Diff line change
Expand Up @@ -260,15 +260,15 @@ await teams.delete(teamId: '[TEAM_ID]');
```dart
final realtime = Realtime(client);

final subscription = realtime.subscribe(['databases.[DATABASE_ID].tables.[TABLE_ID].rows']);
final subscription = realtime.subscribe(['tablesdb.[DATABASE_ID].tables.[TABLE_ID].rows']);
subscription.stream.listen((response) {
print(response.events); // e.g. ['databases.*.tables.*.rows.*.create']
print(response.events); // e.g. ['tablesdb.*.tables.*.rows.*.create']
print(response.payload); // the affected resource
});

// Subscribe to multiple channels
final multi = realtime.subscribe([
'databases.[DATABASE_ID].tables.[TABLE_ID].rows',
'tablesdb.[DATABASE_ID].tables.[TABLE_ID].rows',
'buckets.[BUCKET_ID].files',
]);

Expand All @@ -281,8 +281,8 @@ subscription.close();
| Channel | Description |
|---------|-------------|
| `account` | Changes to the authenticated user's account |
| `databases.[DB_ID].tables.[TABLE_ID].rows` | All rows in a table |
| `databases.[DB_ID].tables.[TABLE_ID].rows.[ROW_ID]` | A specific row |
| `tablesdb.[DB_ID].tables.[TABLE_ID].rows` | All rows in a table |
| `tablesdb.[DB_ID].tables.[TABLE_ID].rows.[ROW_ID]` | A specific row |
| `buckets.[BUCKET_ID].files` | All files in a bucket |
| `buckets.[BUCKET_ID].files.[FILE_ID]` | A specific file |
| `teams` | Changes to teams the user belongs to |
Expand Down
10 changes: 5 additions & 5 deletions templates/agent-skills/kotlin.md.twig
Original file line number Diff line number Diff line change
Expand Up @@ -286,14 +286,14 @@ teams.delete(teamId = "[TEAM_ID]")
```kotlin
val realtime = Realtime(client)

val subscription = realtime.subscribe("databases.[DATABASE_ID].tables.[TABLE_ID].rows") { response ->
println(response.events) // e.g. ["databases.*.tables.*.rows.*.create"]
val subscription = realtime.subscribe("tablesdb.[DATABASE_ID].tables.[TABLE_ID].rows") { response ->
println(response.events) // e.g. ["tablesdb.*.tables.*.rows.*.create"]
println(response.payload) // the affected resource
}

// Subscribe to multiple channels
val multi = realtime.subscribe(
"databases.[DATABASE_ID].tables.[TABLE_ID].rows",
"tablesdb.[DATABASE_ID].tables.[TABLE_ID].rows",
"buckets.[BUCKET_ID].files"
) { response -> /* ... */ }

Expand All @@ -306,8 +306,8 @@ subscription.close()
| Channel | Description |
|---------|-------------|
| `account` | Changes to the authenticated user's account |
| `databases.[DB_ID].tables.[TABLE_ID].rows` | All rows in a table |
| `databases.[DB_ID].tables.[TABLE_ID].rows.[ROW_ID]` | A specific row |
| `tablesdb.[DB_ID].tables.[TABLE_ID].rows` | All rows in a table |
| `tablesdb.[DB_ID].tables.[TABLE_ID].rows.[ROW_ID]` | A specific row |
| `buckets.[BUCKET_ID].files` | All files in a bucket |
| `buckets.[BUCKET_ID].files.[FILE_ID]` | A specific file |
| `teams` | Changes to teams the user belongs to |
Expand Down
10 changes: 5 additions & 5 deletions templates/agent-skills/swift.md.twig
Original file line number Diff line number Diff line change
Expand Up @@ -230,14 +230,14 @@ try await teams.delete(teamId: "[TEAM_ID]")
```swift
let realtime = Realtime(client)

let subscription = realtime.subscribe(channels: ["databases.[DATABASE_ID].tables.[TABLE_ID].rows"]) { response in
print(response.events) // e.g. ["databases.*.tables.*.rows.*.create"]
let subscription = realtime.subscribe(channels: ["tablesdb.[DATABASE_ID].tables.[TABLE_ID].rows"]) { response in
print(response.events) // e.g. ["tablesdb.*.tables.*.rows.*.create"]
print(response.payload) // the affected resource
}

// Subscribe to multiple channels
let multi = realtime.subscribe(channels: [
"databases.[DATABASE_ID].tables.[TABLE_ID].rows",
"tablesdb.[DATABASE_ID].tables.[TABLE_ID].rows",
"buckets.[BUCKET_ID].files",
]) { response in /* ... */ }

Expand All @@ -250,8 +250,8 @@ subscription.close()
| Channel | Description |
|---------|-------------|
| `account` | Changes to the authenticated user's account |
| `databases.[DB_ID].tables.[TABLE_ID].rows` | All rows in a table |
| `databases.[DB_ID].tables.[TABLE_ID].rows.[ROW_ID]` | A specific row |
| `tablesdb.[DB_ID].tables.[TABLE_ID].rows` | All rows in a table |
| `tablesdb.[DB_ID].tables.[TABLE_ID].rows.[ROW_ID]` | A specific row |
| `buckets.[BUCKET_ID].files` | All files in a bucket |
| `buckets.[BUCKET_ID].files.[FILE_ID]` | A specific file |
| `teams` | Changes to teams the user belongs to |
Expand Down
10 changes: 5 additions & 5 deletions templates/agent-skills/typescript.md.twig
Original file line number Diff line number Diff line change
Expand Up @@ -423,8 +423,8 @@ await teams.delete({ teamId: '[TEAM_ID]' });

```typescript
// Subscribe to row changes
const unsubscribe = client.subscribe('databases.[DATABASE_ID].tables.[TABLE_ID].rows', (response) => {
console.log(response.events); // e.g. ['databases.*.tables.*.rows.*.create']
const unsubscribe = client.subscribe('tablesdb.[DATABASE_ID].tables.[TABLE_ID].rows', (response) => {
console.log(response.events); // e.g. ['tablesdb.*.tables.*.rows.*.create']
console.log(response.payload); // the affected resource
});

Expand All @@ -435,7 +435,7 @@ client.subscribe('buckets.[BUCKET_ID].files', (response) => {

// Subscribe to multiple channels
client.subscribe([
'databases.[DATABASE_ID].tables.[TABLE_ID].rows',
'tablesdb.[DATABASE_ID].tables.[TABLE_ID].rows',
'buckets.[BUCKET_ID].files',
], (response) => { /* ... */ });

Expand All @@ -448,8 +448,8 @@ unsubscribe();
| Channel | Description |
|---------|-------------|
| `account` | Changes to the authenticated user's account |
| `databases.[DB_ID].tables.[TABLE_ID].rows` | All rows in a table |
| `databases.[DB_ID].tables.[TABLE_ID].rows.[ROW_ID]` | A specific row |
| `tablesdb.[DB_ID].tables.[TABLE_ID].rows` | All rows in a table |
| `tablesdb.[DB_ID].tables.[TABLE_ID].rows.[ROW_ID]` | A specific row |
| `buckets.[BUCKET_ID].files` | All files in a bucket |
| `buckets.[BUCKET_ID].files.[FILE_ID]` | A specific file |
| `teams` | Changes to teams the user belongs to |
Expand Down
Loading