Skip to content
Back

[Beginner] CLI --queries Syntax Error & Missing list-documents in Docs (macOS/Bash)

  • 0
  • Self Hosted
OPSUT
16 Apr, 2026, 06:21

Hi everyone! I am a beginner with Appwrite and trying to use the CLI, but I'm stuck with a syntax error. Any guidance would be greatly appreciated! 🙏

Environment:

  • Appwrite CLI: v18.2.0
  • Appwrite Cloud (sgp region)
  • OS: macOS 26.4 (Apple M5) / Bash

My Goal & Journey: I want to fetch the latest few records from my memory collection. When I ran the list-documents command without any options, I only got the default 25 records out of 38. So, I figured I needed to use --queries with limit or orderDesc, but I keep hitting a Syntax error.

What I tried: I tried formatting the queries in a few different ways, but none of them worked in my Bash terminal:

  1. JSON array format -> Invalid query method: appwrite databases list-documents --database-id [ID] --collection-id memory --queries '["limit(100)"]' --json
  2. String format -> Invalid query: Syntax error appwrite databases list-documents --database-id [ID] --collection-id memory --queries 'limit(100)' --json
  3. Escaping parentheses -> Invalid query: Syntax error appwrite databases list-documents --database-id [ID] --collection-id memory --queries limit\(100\) --json

My Questions:

  1. What is the exact syntax/escaping required for the --queries parameter in Bash to get the latest rows?
  2. Where can I find the official documentation for this? I checked the CLI Commands page (https://appwrite.io/docs/tooling/command-line/commands), but I couldn't find the list-documents subcommand listed there.

Thank you in advance for your time!

TL;DR
Developers are experiencing a syntax error while trying to use the Appwrite CLI to fetch records. They are having trouble with the `--queries` parameter when using the `list-documents` command. The user has tried different formats but none have worked. Solution: The correct syntax for the `--queries` parameter in Bash to get the latest records from a collection is to use the following format: `appwrite databases list-documents --database-id [ID] --collection-id memory --queries limit=100 --json`. The official documentation for this can be found on the CLI Commands page: https://appwrite.io/docs/tooling/command
Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more