A simple command-line interface for interacting with Anytype, enabling full management of spaces, objects, types, and more.
Anytype CLI provides a complete set of commands for interacting with Anytype spaces, objects, types, lists, templates, and more. It uses the anytype-go SDK and spf13/cobra.
git clone https://github.com/epheo/anytype-cli.git
cd anytype-cli
go build -o bin/anytype-cli- Go 1.18+
- Anytype app running locally with API enabled
First, you need to authenticate with your local Anytype instance:
anytype-cli authThis will prompt you to enter a verification code displayed in your Anytype app.
# Get CLI version information
anytype-cli version
# List all spaces
anytype-cli spaces list
# All commands accept either space ID or space name
# The CLI implements a smart resolution algorithm that:
# 1. Checks if the input matches an exact space ID
# 2. Looks for an exact case-insensitive name match
# 3. Looks for a partial name match if there's only one
# 4. Falls back to treating the input as a space ID
# Search for objects (using either space ID or space name)
anytype-cli search --query "important" --space <space-id|space-name>
# Create a new page (using either space ID or space name)
anytype-cli objects create <space-id|space-name> --name "My New Page" --type "ot-page" --body "# Hello\n\nThis is my new page"--base-url: Anytype API base URL (default: http://localhost:31009)--config: Custom config file location--output,-o: Output format (table, json, yaml)--verbose,-v: Enable verbose output
auth: Authenticate with Anytype--force: Force re-authentication
spaces list: List all spacesspaces get <space-id>: Get details about a specific spacespaces create: Create a new space--name: Name for the space (required)--description: Description for the space--icon: Emoji icon for the space
objects list <space-id>: List objects in a spaceobjects get <space-id> <object-id>: Get details about an objectobjects create <space-id>: Create a new object--name: Name for the object (required)--type: Type key for the object (default: ot-page)--description: Description for the object--body: Markdown body content--icon: Emoji icon for the object--template: Template ID to use
objects delete <space-id> <object-id>: Delete an objectobjects export <space-id> <object-id>: Export an object in markdown format
types list <space-id>: List all object types in a spacetypes get <space-id> <type-id>: Get details about a specific object typetypes templates <space-id> <type-id>: List templates for a specific typetypes template-get <space-id> <type-id> <template-id>: Get details about a template
lists views <space-id> <list-id>: List views for a listlists objects <space-id> <list-id> <view-id>: List objects in a specific list viewlists add <space-id> <list-id> <object-id>...: Add objects to a listlists remove <space-id> <list-id> <object-id>: Remove an object from a list
members list <space-id>: List members in a spacemembers get <space-id> <member-id>: Get details about a specific member
search: Search for objects--query: Search query string--types: Filter by object types (comma-separated)--sort: Property to sort by--direction: Sort direction (asc or desc)--space: Limit search to a specific space
# List all spaces
anytype-cli spaces list
# Get details about a space
anytype-cli spaces get <space-id>
# Create a new space
anytype-cli spaces create --name "Project Documentation" --description "Documentation for my projects" --icon "📚"# List all objects in a space
anytype-cli objects list <space-id>
# Create a new page
anytype-cli objects create <space-id> --name "Meeting Notes" --type "ot-page" --body "# Meeting Notes\n\n## Agenda\n\n- Item 1\n- Item 2"
# Export an object as markdown
anytype-cli objects export <space-id> <object-id># Search all spaces for objects containing "project"
anytype-cli search --query "project"
# Search in a specific space with filtering and sorting
anytype-cli search --query "task" --space <space-id> --types "ot-task" --sort "last_modified_date" --direction "desc"# List all views in a list
anytype-cli lists views <space-id> <list-id>
# List objects in a specific view
anytype-cli lists objects <space-id> <list-id> <view-id>
# Add an object to a list
anytype-cli lists add <space-id> <list-id> <object-id>Apache License 2.0