Skip to content

Feature Request: Add object search and query CLI commands #50

@VKiner

Description

@VKiner

Problem

The Anytype CLI currently has no commands to search, list, or query objects stored in Anytype spaces. The only way to programmatically access data is through the external REST API at developers.anytype.io, which requires:

  1. Creating an API key
  2. Setting up separate authentication
  3. Learning the REST API endpoints
  4. Using curl or HTTP client directly

This creates unnecessary friction for CLI users who want to script or automate data access from their spaces.

Suggested Solution

Add CLI-level commands for data querying, for example:

anytype object search <query>       # Search objects by keyword
anytype object list                 # List objects with filters
anytype object get <id>            # Get object details
anytype space export               # Export space data to JSON

Why This Matters

  • Scripting/automation: Users could easily query data in shell scripts or cron jobs without setting up external API auth
  • Local-first: The data is already on the local machine (SQLite); CLI commands should leverage local access rather than requiring remote API calls
  • DX: anytype object search "meeting notes" is much simpler than curl -X POST https://developers.anytype.io/v1/search -H "Authorization: ..." -d "..." with pre-configured auth
  • Consistency: Other local-first tools (Obsidian CLI, Logseq CLI, Notion CLI alternatives) all provide direct content querying

Current Workaround

The local service (anytype serve) running on port 31012 only serves API documentation, not the actual API endpoints. The actual REST API is hosted externally and requires separate API key registration.

Additional Context

  • CLI version: v0.2.3
  • There is already a related issue Feature Request: Export Command #27 requesting export capability
  • The API documented at developers.anytype.io already has search, objects, spaces, properties endpoints—this is about exposing them through CLI commands

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions