anyproto / anyproto/anytype-cli

Feature Request: Add object search and query CLI commands

Open
#50 0 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
134
Forks
23
PR merge metrics
No merged PRs in 30d

Description

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 #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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by inspecting the existing CLI command structure and the anytype serve entry point, then compare the documented search, objects, spaces, and properties endpoints with the local SQLite data mentioned in the issue. Done means an agreed command scope and working object search, list, get, and space export commands, while accounting for the related export request in issue #27.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, sqlite
Domain
api, cli, data
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.