anyr-0.2.1 is not a library.
anytype-cli
Command-line interface for the Anytype local API, built on anytype.
Install / Run
Examples
# Auth
# List spaces
# get space id for space named "Work"
# filter on server and take first result, or filter from results
|
|
# List objects in a space
# List collections
List items in a collection
Example: list all my planned trips
space_name="Personal"
collection_name="Trips"
# get space_id
personal_space=
# get collection id in space
trip_collection=
# get items in collection
trip_objs=
# generate csv list of all trips (id,name)
for
|
done
List tasks
spaceid="bafyreiaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.3333333333333"
for; do
data=
status=
name=
created_date=
done
List items in a collection
# get the collection
# If you want them as an array instead of individual values:
# Or more simply:
List items in a query
# list queries, look for the query you want (use in <query_id>)
anyr object list --type set <SPACE_ID> -t
# list views of the query (look for view All, get the id <view_id>)
anyr list views <SPACE_ID> <QUERY_ID> -t
# list items in that view
anyr list objects --view $view_id $space_id $query_id
Search
Search for text in title and markdown body, across all spaces the user is authorized to access.
Add the --space SPACE_ID arg to limit search to a specific space.
anyr search --text "meeting notes"
Output Formats
--json(default)--pretty(json pretty-print)--table(readable)--quiet(minimal output)
Logging
Debug logging
RUST_LOG=debug
Log HTTP request/response:
RUST_LOG=warn,anytype::http_json=trace
Testing
Python CLI tests expect the same environment variables as the API tests:
ANYTYPE_TEST_URL(orANYTYPE_URL)ANYTYPE_TEST_KEY_FILE(orANYTYPE_KEY_FILE)ANYTYPE_TEST_SPACE_ID
License
Licensed under either of:
- Apache License, Version 2.0 (
LICENSE-APACHE) - MIT License (
LICENSE-MIT)