anyr quick reference

    Recall common Anytype automation commands. Quoted words such as "Work" are resolver-backed names; shell variables ending in _ID are exact IDs returned by anyr. Every SPACE operand shown accepts a space name or ID, and chat operands paired with a space accept a chat name, title, or ID. Type examples use lowercase keys.

    Output and help

    Hide or show commands

    Choose an output format

    anyr space list --table
    anyr space list --pretty
    anyr space list --json

    Compact JSON is the default. Diagnostics go to stderr.

    Write the result document to a file

    anyr space list --pretty --output spaces.json

    Collect every result page

    anyr object list "Work" --all --json

    Show context-specific help

    anyr --help
    anyr chat messages send --help

    Inspect JSON with jq

    anyr space list | jq '.items[] | {id, name}'

    Select endpoints and key storage

    anyr --url http://127.0.0.1:31012 \
      --grpc http://127.0.0.1:31010 \
      --keystore file space list

    Connection and credentials

    HTTP and gRPC authenticate separately. See Connections and gRPC for headless-server installation and authentication.

    Hide or show settings

    HTTP endpoint

    ANYTYPE_URL=http://127.0.0.1:31012 anyr space list
    anyr --url http://127.0.0.1:31012 space list

    Without either selector, anyr uses http://127.0.0.1:31012 when the selected keystore contains gRPC credentials; otherwise it uses http://127.0.0.1:31009.

    gRPC endpoint

    ANYTYPE_GRPC_ENDPOINT=http://127.0.0.1:31010 anyr auth status
    anyr --grpc http://127.0.0.1:31010 auth status

    The default is http://127.0.0.1:31010.

    Credential storage

    ANYTYPE_KEYSTORE=file anyr auth status
    anyr --keystore file auth status

    The selector is optional. See the keystore reference for platform stores, file encryption, and environment credentials.

    Authenticate a headless server

    anyr init-cli
    anyr auth status --pretty

    CLI + gRPC means a running Anytype CLI server and a healthy authenticated gRPC ping.

    Authentication

    Hide or show commands

    Check HTTP and gRPC access

    anyr auth status --pretty

    Authenticate with the desktop app

    anyr auth login

    Initialize from a headless server

    anyr init-cli

    Save sourceable environment credentials

    ANYTYPE_KEYSTORE=env anyr init-cli --save-env ./anytype.env
    source ./anytype.env

    The file contains plaintext credentials and is created with owner-only permissions on Unix.

    Initialize and join a space

    anyr init-cli --join "$INVITE_LINK"

    Store supplied credentials

    printf '%s\n' "$HTTP_TOKEN" | anyr auth set-http
    printf '%s\n' "$ACCOUNT_KEY" | anyr auth set-grpc --account-key

    Both commands read the secret from standard input. The gRPC account key comes from the Anytype CLI server account.

    Clear stored credentials

    anyr auth logout

    Spaces

    Show commands

    List or inspect spaces

    anyr space list --table
    anyr space get "Work" --pretty

    Create a regular or chat space

    anyr space create "Work" --description "Team documents"
    anyr space create "Team Chat" --chat

    --chat: CLI + gRPC required.

    Rename a space

    anyr space update "Work" --name "Projects"

    Count or remove archived objects

    anyr space count-archived "Work"
    anyr space delete-archived "Work" --confirm

    CLI + gRPC required.

    Delete with an exact pre-delete archive

    anyr space delete "Old Work" \
      --archive ./old-work.zip --confirm

    CLI + gRPC required for the backup and permanent deletion.

    Delete interactively

    anyr space delete "Old Work"

    The prompt offers a backup, then requires the exact space name. CLI + gRPC required.

    Tasks

    Show commands

    List tasks in a space

    anyr search --space "Work" --type task --all --table

    Find tasks by text

    anyr search --space "Work" --type task \
      --text "customer" --table

    Create a task with properties

    anyr object create "Work" task \
      --name "Review proposal" status=Open

    Change task status

    anyr object update "Work" "$TASK_ID" status=Done

    Sort tasks by modification date

    anyr search --space "Work" --type task \
      --sort last_modified_date --desc --table

    Extract task IDs for a shell workflow

    anyr search --space "Work" --type task --all \
      | jq -r '.[] | .id'

    Objects and search

    Show commands

    List objects by type

    anyr object list "Work" --type page --table

    Get one object

    anyr object get "Work" "$OBJECT_ID" --pretty

    Create a page

    anyr object create "Work" page \
      --name "Meeting notes" --body-file notes.md

    Update fields and properties

    anyr object update "Work" "$OBJECT_ID" \
      --name "New title" priority=2

    Search globally or within a space

    anyr search --text "meeting notes" --table
    anyr search --space "Work" --text "meeting notes" --table

    Build an Anytype object link

    anyr object link "Work" "$OBJECT_ID"

    Archive an object

    anyr object delete "Work" "$OBJECT_ID"

    Body blocks and discussions

    CLI + gRPC required. Attached-discussion operations also use HTTP preflight. Object and block operands are exact IDs.

    Show commands

    Discover or attach a page discussion

    anyr object discussion get "Work" "$OBJECT_ID" --pretty
    anyr object discussion attach "Work" "$OBJECT_ID" --pretty

    get returns an absent or attached state. attach creates the derived discussion when absent and returns the verified discussion ID.

    List or inspect exact body blocks

    anyr body list "Work" "$OBJECT_ID" --table
    anyr body show "Work" "$OBJECT_ID" "$BLOCK_ID" --pretty

    List output preserves document order and reports each block's parent and sibling position.

    Create a rich block

    anyr body create "Work" "$OBJECT_ID" "$ROOT_BLOCK_ID" \
      last-child --block @- <<'JSON'
    {"content":{"kind":"callout","text":"Check this","icon":{"type":"emoji","content":"💡"}},"background_color":"grey"}
    JSON

    --block accepts literal JSON, @FILE, @-, or - for standard input.

    Update one typed block field

    anyr body update "Work" "$OBJECT_ID" "$BLOCK_ID" --change \
      '{"kind":"text","text":"Checked","marks":[]}'

    Changes cover text and marks, style, checkbox state, colors, callout icons, embeds, link appearance, and alignment.

    Move a block relative to another block

    anyr body move "Work" "$OBJECT_ID" "$BLOCK_ID" \
      "$TARGET_BLOCK_ID" before

    Positions are before, after, first-child, and last-child.

    Delete an exact block subtree

    anyr body delete "Work" "$OBJECT_ID" "$BLOCK_ID" \
      --expected-subtree-blocks 1 --confirm

    The command rereads the body and refuses deletion when the current subtree size differs from the supplied count.

    Markdown editing

    Show commands

    Export a document

    anyr md get "Work" "$OBJECT_ID" --output page.md

    Edit in $EDITOR

    anyr md edit "Work" "$OBJECT_ID"

    Edit from an Anytype link

    anyr md edit --doc "$ANYTYPE_LINK"

    Apply a saved Markdown file

    anyr md update --input page.md

    The exported file carries the object coordinates used by update.

    Chats

    A chat name operand requires the Anytype CLI server and gRPC credentials for name resolution, even when the command itself can use REST. Pass an exact chat ID to keep a REST-backed operation HTTP-only.

    Show commands

    List or create chats

    anyr chat list --space "Work" --table
    anyr chat create "Work" "Ops"

    Send a plain message

    anyr chat messages send "Work" "Ops" \
      --text "Deployment complete"

    Send rich text

    anyr chat messages send "Work" "Ops" \
      --text "Release ready" --style header2 --mark bold:0:13

    The mark range selects the complete 13-byte ASCII message.

    List recent messages

    anyr chat messages list "Work" "Ops" \
      --limit 50 --table

    CLI + gRPC required.

    Filter a message window since a date

    anyr chat messages list "Work" "Ops" --limit 1000 --json \
      | jq '.messages[] | select(.created_at >= "2026-08-01T00:00:00Z")'

    This filters one bounded window. Use order-ID continuation to inspect older windows. CLI + gRPC required.

    Search message text

    anyr chat messages search "Work" "Ops" \
      "deployment" --table

    Edit or react to a message

    anyr chat messages edit "Work" "Ops" "$MESSAGE_ID" \
      --text "Updated status"
    anyr chat messages react "Work" "Ops" "$MESSAGE_ID" "👍"

    Listen for one chat

    anyr chat listen --space "Work" --chat "Ops" \
      --initial-limit 20 --heartbeat 15

    Mark a chat read

    anyr chat read-all "Work" "Ops"

    Use gRPC-only chat operations

    anyr chat list
    anyr chat get "Work" "Ops"
    anyr chat messages get "Work" "Ops" "$MESSAGE_ID"
    anyr chat messages delete "Work" "Ops" "$MESSAGE_ID"
    anyr chat unread "Work" "Ops" --after "$ORDER_ID"

    CLI + gRPC required. Cross-space or text-filtered chat lists, message list/get/delete, unread, --blocks-json, and multi-chat or preview listeners also select gRPC.

    Files

    Show commands

    List matching files

    anyr file list "Personal" --file-type image \
      --size-gte 1048576 --name-contains report --table

    CLI + gRPC required. file search and file get use the same backend.

    Upload a local file

    anyr file upload "Personal" --file ./report.pdf \
      --mime application/pdf

    Upload standard input

    anyr file upload "Personal" --stdin --name report.pdf \
      < ./report.pdf

    Upload from a URL with rich placement

    anyr file upload "Personal" --url https://example.com/logo.png \
      --file-type image --style embed

    CLI + gRPC required. On file upload, --url, --file-type, --style, --details, and creation-context options select gRPC. File preload and discard-preload also require it.

    Download file bytes

    anyr file download "Personal" "$FILE_ID" --dir /tmp

    Inspect REST headers without downloading

    anyr file metadata "Personal" "$FILE_ID" --width 128

    --width selects the image variant whose headers are returned.

    Update or delete a file object over REST

    anyr file update "Personal" "$FILE_ID" --name report-final.pdf
    anyr file delete "Personal" "$FILE_ID" --permanent

    Preload or discard a file

    anyr file preload "Personal" --file ./draft.png --file-type image
    anyr file discard-preload "Personal" "$PRELOAD_ID"

    CLI + gRPC required.

    Types, properties, tags, and templates

    Show commands

    List types and properties

    anyr type list "Work" --table
    anyr property list "Work" --table

    Create a type

    anyr type create "Work" decision "Decision" \
      --plural "Decisions" --layout basic

    Create a property

    anyr property create "Work" "Priority" number \
      --key priority

    Create a select property with tags

    anyr property create "Work" "Status" select \
      --key status --tag Open:blue --tag Done:lime

    Add a tag

    anyr tag create "Work" "$PROPERTY_ID" Blocked red \
      --key blocked

    List templates for a type

    anyr template list "Work" task --table

    Add a property without replacing the type list

    anyr type update "Work" task --add-property status

    --add-property: CLI + gRPC required. --set-property and --clear-properties remain REST-backed.

    Lists and views

    Show commands

    Find collections and sets

    anyr search --space "Work" --type collection --table
    anyr search --space "Work" --type set --table

    List views

    anyr list views "Work" "$LIST_ID" --table

    List objects in a view

    anyr view objects "Work" "$TYPE_ID" --view "$VIEW_ID" \
      --columns name,creator,status --table

    Add or remove collection members

    anyr list add "Work" "$LIST_ID" "$OBJECT_ID"
    anyr list remove "Work" "$LIST_ID" "$OBJECT_ID"

    Members and sharing

    Show commands

    List active members

    anyr member list "Work" --status active --table

    Create a writer invitation

    anyr space invite create "Work" --writer

    CLI + gRPC required.

    Show or revoke invitations

    anyr space invite show "Work"
    anyr space invite revoke "Work"

    CLI + gRPC required.

    Enable or disable public sharing

    anyr space enable-sharing "Work"
    anyr space disable-sharing "Work"

    CLI + gRPC required.

    Backup and restore

    Show commands

    Back up every object in a space

    anyr backup create --space "Work" --dir ./backups

    Add --include-files to embed file objects and binaries. CLI + gRPC required.

    Create an exact archive path

    anyr backup create --space "Work" \
      --dest ./backups/work.zip --include-files

    CLI + gRPC required.

    Inspect archive contents

    anyr backup list ./backups/work.zip --files --table
    anyr backup manifest ./backups/work.zip --pretty

    Validate a restore

    anyr backup restore ./backups/work.zip \
      --space "Restored Work" --dry-run

    The dry run reads the archive locally and resolves the destination over HTTP.

    Restore into an existing space

    anyr backup restore ./backups/work.zip \
      --space "Restored Work" --log restore.json

    CLI + gRPC required.

    Compare archives

    anyr backup diff ./backups/old.zip ./backups/new.zip \
      --table

    Browse an archive interactively

    anyr backup inspect ./backups/work.zip

    The inspector owns the terminal and rejects output-format flags.

    MCP and completions

    Show commands

    Run the MCP server

    anyr mcp

    The compact base catalog is HTTP-complete. The standard read-write catalog and some optional toolsets require a running Anytype CLI server and gRPC credentials.

    Initialize or check MCP configuration

    anyr mcp init
    anyr mcp check

    Load shell completions

    source <(anyr completions zsh)
    source <(anyr completions bash)
    anyr completions fish | source

    Show the binary version

    anyr --version