Skip to content

Commit f80e302

Browse files
Merge pull request #1377 from appwrite/tweak-skills
2 parents 1d39f64 + 2d31dde commit f80e302

File tree

5 files changed

+91
-81
lines changed

5 files changed

+91
-81
lines changed

templates/agent-skills/cli.md.twig

Lines changed: 38 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,13 @@ appwrite projects get --project-id "<PROJECT_ID>"
4646
## Configuration
4747

4848
```bash
49-
appwrite client --endpoint https://<REGION>.cloud.appwrite.io/v1
50-
appwrite client --key <API_KEY>
51-
appwrite client --self-signed true # for self-signed SSL certs
52-
appwrite client --reset # reset CLI configuration
53-
appwrite client --debug # print current configuration
49+
# Authenticate with Appwrite
50+
appwrite login
5451
```
5552

53+
> For the full list of CLI commands, see [CLI Commands](https://appwrite.io/docs/tooling/command-line/commands).
54+
> For headless / CI/CD usage, see [Non-Interactive Mode](https://appwrite.io/docs/tooling/command-line/non-interactive).
55+
5656
## appwrite.config.json
5757

5858
All resources are configured in a single `appwrite.config.json` file at the project root:
@@ -258,59 +258,59 @@ appwrite push tables
258258
}
259259
```
260260

261-
### Database commands
261+
### Database commands (TablesDB)
262262

263263
| Command | Description |
264264
|---------|-------------|
265-
| `appwrite databases list-tables --database-id <ID>` | List tables |
266-
| `appwrite databases create-table --database-id <ID>` | Create table |
267-
| `appwrite databases get-table --database-id <ID> --table-id <ID>` | Get table |
268-
| `appwrite databases update-table --database-id <ID> --table-id <ID>` | Update table |
269-
| `appwrite databases delete-table --database-id <ID> --table-id <ID>` | Delete table |
270-
| `appwrite databases list-columns --database-id <ID> --table-id <ID>` | List columns |
271-
| `appwrite databases get-column --database-id <ID> --table-id <ID> --key <KEY>` | Get column |
272-
| `appwrite databases delete-column --database-id <ID> --table-id <ID> --key <KEY>` | Delete column |
273-
| `appwrite databases list-indexes --database-id <ID> --table-id <ID>` | List indexes |
274-
| `appwrite databases create-index --database-id <ID> --table-id <ID>` | Create index |
275-
| `appwrite databases delete-index --database-id <ID> --table-id <ID> --key <KEY>` | Delete index |
265+
| `appwrite tables-db list-tables --database-id <ID>` | List tables |
266+
| `appwrite tables-db create-table --database-id <ID>` | Create table |
267+
| `appwrite tables-db get-table --database-id <ID> --table-id <ID>` | Get table |
268+
| `appwrite tables-db update-table --database-id <ID> --table-id <ID>` | Update table |
269+
| `appwrite tables-db delete-table --database-id <ID> --table-id <ID>` | Delete table |
270+
| `appwrite tables-db list-columns --database-id <ID> --table-id <ID>` | List columns |
271+
| `appwrite tables-db get-column --database-id <ID> --table-id <ID> --key <KEY>` | Get column |
272+
| `appwrite tables-db delete-column --database-id <ID> --table-id <ID> --key <KEY>` | Delete column |
273+
| `appwrite tables-db list-column-indexes --database-id <ID> --table-id <ID>` | List indexes |
274+
| `appwrite tables-db create-column-index --database-id <ID> --table-id <ID>` | Create index |
275+
| `appwrite tables-db delete-column-index --database-id <ID> --table-id <ID> --key <KEY>` | Delete index |
276276

277277
### Column type commands
278278

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

281281
| Command | Description |
282282
|---------|-------------|
283-
| `create-varchar-attribute` | Varchar column — inline storage, fully indexable (max 16,383 chars, size ≤ 768 for full index) |
284-
| `create-text-attribute` | Text column — off-page storage, prefix index only (max 16,383 chars) |
285-
| `create-mediumtext-attribute` | Mediumtext column — off-page storage (max ~4M chars) |
286-
| `create-longtext-attribute` | Longtext column — off-page storage (max ~1B chars) |
287-
| `create-boolean-attribute` | Boolean column |
288-
| `create-integer-attribute` | Integer column (optional min/max) |
289-
| `create-float-attribute` | Float column (optional min/max) |
290-
| `create-email-attribute` | Email column |
291-
| `create-url-attribute` | URL column |
292-
| `create-ip-attribute` | IP address column |
293-
| `create-datetime-attribute` | Datetime column (ISO 8601) |
294-
| `create-enum-attribute` | Enum column (whitelist of accepted values) |
295-
| `create-relationship-attribute` | Relationship column |
296-
297-
All column commands use `appwrite databases <command> --database-id <ID> --table-id <ID>`.
283+
| `create-varchar-column` | Varchar column — inline storage, fully indexable (max 16,383 chars, size ≤ 768 for full index) |
284+
| `create-text-column` | Text column — off-page storage, prefix index only (max 16,383 chars) |
285+
| `create-mediumtext-column` | Mediumtext column — off-page storage (max ~4M chars) |
286+
| `create-longtext-column` | Longtext column — off-page storage (max ~1B chars) |
287+
| `create-boolean-column` | Boolean column |
288+
| `create-integer-column` | Integer column (optional min/max) |
289+
| `create-float-column` | Float column (optional min/max) |
290+
| `create-email-column` | Email column |
291+
| `create-url-column` | URL column |
292+
| `create-ip-column` | IP address column |
293+
| `create-datetime-column` | Datetime column (ISO 8601) |
294+
| `create-enum-column` | Enum column (whitelist of accepted values) |
295+
| `create-relationship-column` | Relationship column |
296+
297+
All column commands use `appwrite tables-db <command> --database-id <ID> --table-id <ID>`.
298298

299299
### Row operations
300300

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

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

312312
# Get a row
313-
appwrite databases get-row \
313+
appwrite tables-db get-row \
314314
--database-id "<DATABASE_ID>" --table-id "<TABLE_ID>" --row-id "<ROW_ID>"
315315
```
316316

@@ -410,8 +410,7 @@ appwrite push topics
410410
```bash
411411
# Create a user
412412
appwrite users create --user-id "unique()" \
413-
--email hello@appwrite.io \
414-
--password very_strong_password
413+
--email hello@appwrite.io
415414

416415
# List users
417416
appwrite users list
@@ -484,15 +483,7 @@ await customers.createMany([
484483

485484
## Non-Interactive / CI/CD Mode
486485

487-
For headless automation without config files or sessions:
488-
489-
```bash
490-
# Configure client for non-interactive mode
491-
appwrite client \
492-
--endpoint https://<REGION>.cloud.appwrite.io/v1 \
493-
--project-id <PROJECT_ID> \
494-
--key <API_KEY>
495-
```
486+
For headless automation, see the [Non-Interactive Mode docs](https://appwrite.io/docs/tooling/command-line/non-interactive).
496487

497488
### Deploy non-interactively
498489

@@ -535,7 +526,7 @@ appwrite users list --json
535526
appwrite users list --verbose
536527

537528
# View a row in the Console
538-
appwrite databases get-row \
529+
appwrite tables-db get-row \
539530
--database-id "<DATABASE_ID>" \
540531
--table-id "<TABLE_ID>" \
541532
--row-id "<ROW_ID>" \

templates/agent-skills/dart.md.twig

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -260,16 +260,19 @@ await teams.delete(teamId: '[TEAM_ID]');
260260
```dart
261261
final realtime = Realtime(client);
262262

263-
final subscription = realtime.subscribe(['databases.[DATABASE_ID].tables.[TABLE_ID].rows']);
263+
// Subscribe to row changes
264+
final subscription = realtime.subscribe([
265+
Channel.tablesdb('[DATABASE_ID]').table('[TABLE_ID]').row(),
266+
]);
264267
subscription.stream.listen((response) {
265-
print(response.events); // e.g. ['databases.*.tables.*.rows.*.create']
268+
print(response.events); // e.g. ['tablesdb.*.tables.*.rows.*.create']
266269
print(response.payload); // the affected resource
267270
});
268271

269272
// Subscribe to multiple channels
270273
final multi = realtime.subscribe([
271-
'databases.[DATABASE_ID].tables.[TABLE_ID].rows',
272-
'buckets.[BUCKET_ID].files',
274+
Channel.tablesdb('[DATABASE_ID]').table('[TABLE_ID]').row(),
275+
Channel.bucket('[BUCKET_ID]').file(),
273276
]);
274277

275278
// Cleanup
@@ -281,8 +284,8 @@ subscription.close();
281284
| Channel | Description |
282285
|---------|-------------|
283286
| `account` | Changes to the authenticated user's account |
284-
| `databases.[DB_ID].tables.[TABLE_ID].rows` | All rows in a table |
285-
| `databases.[DB_ID].tables.[TABLE_ID].rows.[ROW_ID]` | A specific row |
287+
| `tablesdb.[DB_ID].tables.[TABLE_ID].rows` | All rows in a table |
288+
| `tablesdb.[DB_ID].tables.[TABLE_ID].rows.[ROW_ID]` | A specific row |
286289
| `buckets.[BUCKET_ID].files` | All files in a bucket |
287290
| `buckets.[BUCKET_ID].files.[FILE_ID]` | A specific file |
288291
| `teams` | Changes to teams the user belongs to |

templates/agent-skills/kotlin.md.twig

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -284,17 +284,22 @@ teams.delete(teamId = "[TEAM_ID]")
284284
### Real-time Subscriptions (client-side)
285285

286286
```kotlin
287+
import io.{{ spec.title | caseLower }}.Channel
288+
287289
val realtime = Realtime(client)
288290

289-
val subscription = realtime.subscribe("databases.[DATABASE_ID].tables.[TABLE_ID].rows") { response ->
290-
println(response.events) // e.g. ["databases.*.tables.*.rows.*.create"]
291+
// Subscribe to row changes
292+
val subscription = realtime.subscribe(
293+
Channel.tablesdb("[DATABASE_ID]").table("[TABLE_ID]").row()
294+
) { response ->
295+
println(response.events) // e.g. ["tablesdb.*.tables.*.rows.*.create"]
291296
println(response.payload) // the affected resource
292297
}
293298

294299
// Subscribe to multiple channels
295300
val multi = realtime.subscribe(
296-
"databases.[DATABASE_ID].tables.[TABLE_ID].rows",
297-
"buckets.[BUCKET_ID].files"
301+
Channel.tablesdb("[DATABASE_ID]").table("[TABLE_ID]").row(),
302+
Channel.bucket("[BUCKET_ID]").file()
298303
) { response -> /* ... */ }
299304

300305
// Cleanup
@@ -306,8 +311,8 @@ subscription.close()
306311
| Channel | Description |
307312
|---------|-------------|
308313
| `account` | Changes to the authenticated user's account |
309-
| `databases.[DB_ID].tables.[TABLE_ID].rows` | All rows in a table |
310-
| `databases.[DB_ID].tables.[TABLE_ID].rows.[ROW_ID]` | A specific row |
314+
| `tablesdb.[DB_ID].tables.[TABLE_ID].rows` | All rows in a table |
315+
| `tablesdb.[DB_ID].tables.[TABLE_ID].rows.[ROW_ID]` | A specific row |
311316
| `buckets.[BUCKET_ID].files` | All files in a bucket |
312317
| `buckets.[BUCKET_ID].files.[FILE_ID]` | A specific file |
313318
| `teams` | Changes to teams the user belongs to |

templates/agent-skills/swift.md.twig

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -230,28 +230,31 @@ try await teams.delete(teamId: "[TEAM_ID]")
230230
```swift
231231
let realtime = Realtime(client)
232232

233-
let subscription = realtime.subscribe(channels: ["databases.[DATABASE_ID].tables.[TABLE_ID].rows"]) { response in
234-
print(response.events) // e.g. ["databases.*.tables.*.rows.*.create"]
233+
// Subscribe to row changes
234+
let subscription = try await realtime.subscribe(channels: [
235+
Channel.tablesdb("[DATABASE_ID]").table("[TABLE_ID]").row()
236+
]) { response in
237+
print(response.events) // e.g. ["tablesdb.*.tables.*.rows.*.create"]
235238
print(response.payload) // the affected resource
236239
}
237240

238241
// Subscribe to multiple channels
239-
let multi = realtime.subscribe(channels: [
240-
"databases.[DATABASE_ID].tables.[TABLE_ID].rows",
241-
"buckets.[BUCKET_ID].files",
242+
let multi = try await realtime.subscribe(channels: [
243+
Channel.tablesdb("[DATABASE_ID]").table("[TABLE_ID]").row(),
244+
Channel.files(),
242245
]) { response in /* ... */ }
243246

244247
// Cleanup
245-
subscription.close()
248+
try await subscription.close()
246249
```
247250

248251
**Available channels:**
249252

250253
| Channel | Description |
251254
|---------|-------------|
252255
| `account` | Changes to the authenticated user's account |
253-
| `databases.[DB_ID].tables.[TABLE_ID].rows` | All rows in a table |
254-
| `databases.[DB_ID].tables.[TABLE_ID].rows.[ROW_ID]` | A specific row |
256+
| `tablesdb.[DB_ID].tables.[TABLE_ID].rows` | All rows in a table |
257+
| `tablesdb.[DB_ID].tables.[TABLE_ID].rows.[ROW_ID]` | A specific row |
255258
| `buckets.[BUCKET_ID].files` | All files in a bucket |
256259
| `buckets.[BUCKET_ID].files.[FILE_ID]` | A specific file |
257260
| `teams` | Changes to teams the user belongs to |

templates/agent-skills/typescript.md.twig

Lines changed: 22 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -422,34 +422,42 @@ await teams.delete({ teamId: '[TEAM_ID]' });
422422
### Real-time Subscriptions (client-side)
423423

424424
```typescript
425+
import { Realtime, Channel } from '{{ spec.title | caseLower }}';
426+
427+
const realtime = new Realtime(client);
428+
425429
// Subscribe to row changes
426-
const unsubscribe = client.subscribe('databases.[DATABASE_ID].tables.[TABLE_ID].rows', (response) => {
427-
console.log(response.events); // e.g. ['databases.*.tables.*.rows.*.create']
428-
console.log(response.payload); // the affected resource
429-
});
430+
const subscription = await realtime.subscribe(
431+
Channel.tablesdb('[DATABASE_ID]').table('[TABLE_ID]').row(),
432+
(response) => {
433+
console.log(response.events); // e.g. ['tablesdb.*.tables.*.rows.*.create']
434+
console.log(response.payload); // the affected resource
435+
}
436+
);
430437

431-
// Subscribe to file changes
432-
client.subscribe('buckets.[BUCKET_ID].files', (response) => {
433-
console.log(response.payload);
434-
});
438+
// Subscribe to a specific row
439+
await realtime.subscribe(
440+
Channel.tablesdb('[DATABASE_ID]').table('[TABLE_ID]').row('[ROW_ID]'),
441+
(response) => { /* ... */ }
442+
);
435443

436444
// Subscribe to multiple channels
437-
client.subscribe([
438-
'databases.[DATABASE_ID].tables.[TABLE_ID].rows',
439-
'buckets.[BUCKET_ID].files',
445+
await realtime.subscribe([
446+
Channel.tablesdb('[DATABASE_ID]').table('[TABLE_ID]').row(),
447+
Channel.bucket('[BUCKET_ID]').file(),
440448
], (response) => { /* ... */ });
441449

442450
// Unsubscribe
443-
unsubscribe();
451+
await subscription.close();
444452
```
445453

446454
**Available channels:**
447455

448456
| Channel | Description |
449457
|---------|-------------|
450458
| `account` | Changes to the authenticated user's account |
451-
| `databases.[DB_ID].tables.[TABLE_ID].rows` | All rows in a table |
452-
| `databases.[DB_ID].tables.[TABLE_ID].rows.[ROW_ID]` | A specific row |
459+
| `tablesdb.[DB_ID].tables.[TABLE_ID].rows` | All rows in a table |
460+
| `tablesdb.[DB_ID].tables.[TABLE_ID].rows.[ROW_ID]` | A specific row |
453461
| `buckets.[BUCKET_ID].files` | All files in a bucket |
454462
| `buckets.[BUCKET_ID].files.[FILE_ID]` | A specific file |
455463
| `teams` | Changes to teams the user belongs to |

0 commit comments

Comments
 (0)