anytype
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseAnyType Skill
AnyType 技能
Direct integration with AnyType's local REST API. No MCP dependency — uses HTTP calls via a TypeScript CLI tool.
通过本地REST API直接与AnyType集成。不依赖MCP——通过TypeScript CLI工具发起HTTP请求。
Prerequisites
前提条件
- AnyType desktop app running (provides REST API on localhost)
- runtime installed
bun - API key configured (run Auth workflow if not set up)
- 运行AnyType桌面应用(在localhost提供REST API)
- 已安装运行时
bun - 已配置API密钥(若未设置,运行Auth工作流)
Configuration
配置
Per-machine config is resolved in order:
- Environment variables: ,
ANYTYPE_API_KEY,ANYTYPE_HOSTANYTYPE_PORT - Config file:
~/.config/anytype-skill/config.json - Defaults: host=localhost, port=31009
Auto-space: Commands that require a space ID will auto-detect it when you have a single space. Use to override or when you have multiple spaces.
--space <id>每台机器的配置按以下优先级读取:
- 环境变量: 、
ANYTYPE_API_KEY、ANYTYPE_HOSTANYTYPE_PORT - 配置文件:
~/.config/anytype-skill/config.json - 默认值: host=localhost,port=31009
自动空间识别: 当你只有一个空间时,需要空间ID的命令会自动检测。若有多个空间或需要覆盖,使用参数。
--space <id>Tool Location
工具位置
All operations go through a single CLI tool at relative to this skill's root directory. Construct the full path based on where this SKILL.md was loaded from.
Tools/AnyType.tsbun <skill-root>/Tools/AnyType.ts <command> [options]所有操作都通过该技能根目录下这个单一CLI工具执行。根据当前SKILL.md的加载路径构建完整路径。
Tools/AnyType.tsbun <skill-root>/Tools/AnyType.ts <command> [options]Workflow Routing
工作流路由
| Workflow | Trigger | File |
|---|---|---|
| Auth | Set up API key, authenticate, auth status | |
| Search | Search objects, find notes, query AnyType | |
| Read | Get object, read note, view object details | |
| Tasks | List tasks, create task, mark done, manage tasks | |
| 工作流 | 触发条件 | 文件 |
|---|---|---|
| Auth | 设置API密钥、身份验证、查看认证状态 | |
| Search | 搜索对象、查找笔记、查询AnyType数据 | |
| Read | 获取对象、读取笔记、查看对象详情 | |
| Tasks | 列出任务、创建任务、标记完成、管理任务 | |
Tool Reference
工具参考
Authentication
身份验证
| Command | Description |
|---|---|
| Start auth flow (4-digit code appears in AnyType) |
| Exchange code for API key |
| Manually set an API key |
| Check current config and connectivity |
| 命令 | 描述 |
|---|---|
| 启动认证流程(AnyType中会显示4位验证码) |
| 用验证码兑换API密钥 |
| 手动设置API密钥 |
| 检查当前配置和连接状态 |
Querying
查询操作
| Command | Description |
|---|---|
| List all spaces |
| Search objects |
| Get a specific object |
| List objects in a space |
| List tasks (default: open/uncompleted) |
| 命令 | 描述 |
|---|---|
| 列出所有空间 |
| 搜索对象 |
| 获取指定对象 |
| 列出空间内的对象 |
| 列出任务(默认:未完成的任务) |
Task Shortcuts
任务快捷操作
| Command | Description |
|---|---|
| Quick-create a task |
| Mark a task as complete |
| 命令 | 描述 |
|---|---|
| 快速创建任务 |
| 标记任务为完成 |
Mutating
变更操作
| Command | Description |
|---|---|
| Create an object |
| Update an object |
| Archive an object |
All commands output JSON to stdout. is optional for all mutating/querying commands (auto-detected).
--space| 命令 | 描述 |
|---|---|
| 创建对象 |
| 更新对象 |
| 归档对象 |
所有命令都会向标准输出(stdout)输出JSON。所有查询/变更命令的参数为可选(会自动检测)。
--spaceSearch Behavior
搜索行为说明
- Search is required and searches object content, not just names
query - To list all objects of a type, use a space as wildcard:
search --query " " --types <type_key> - The flag filters which object types are returned, not what text is searched
--types - Type keys (e.g., ,
page,task) vary per space — discover them by running a broad search and inspecting thenotefield in resultstype.key - Objects may contain links in their markdown body that reference other objects by
anytype://andobjectId— use these with thespaceIdcommand to follow linksget - Use to get most recently modified first
--sort last_modified_date --direction desc - Use to scope search to a single space
--space <id>
- 搜索为必填项,会搜索对象的内容,而非仅名称
query - 若要列出某一类型的所有对象,使用空格作为通配符:
search --query " " --types <type_key> - 参数用于过滤返回的对象类型,而非搜索文本
--types - 类型键(如、
page、task)因空间而异——可通过执行宽泛搜索并查看结果中的note字段来发现type.key - 对象的markdown内容中可能包含链接,通过
anytype://和objectId引用其他对象——可配合spaceId命令使用这些链接查看关联内容get - 使用可按最近修改时间排序
--sort last_modified_date --direction desc - 使用可将搜索范围限定在单个空间内
--space <id>
Property Format Reference
属性格式参考
When using with or , match the property format:
--propertiescreateupdate| Format | JSON Example |
|---|---|
| checkbox | |
| text | |
| select | |
| date | |
Note: also accepts as a shorthand for setting the due_date property.
update--due YYYY-MM-DD在或命令中使用时,需匹配以下属性格式:
createupdate--properties| 格式 | JSON示例 |
|---|---|
| checkbox | |
| text | |
| select | |
| date | |
注意:命令也支持作为设置due_date属性的简写方式。
update--due YYYY-MM-DDAPI Quirks
API特性说明
- Unchecked checkboxes are omitted: When is
done, the property is absent from the response (not returned asfalse). Thefalsecommand handles this automatically.tasks - No server-side property filtering: The API filters by type but not property values. The command filters client-side.
tasks - Delete = archive: The DELETE endpoint archives objects; they can be restored in AnyType.
- 未勾选的复选框会被省略: 当为
done时,该属性不会出现在响应中(不会返回false)。false命令会自动处理此情况。tasks - 无服务器端属性过滤: API支持按类型过滤,但不支持按属性值过滤。命令会在客户端进行过滤。
tasks - 删除即归档: DELETE端点会归档对象;可在AnyType中恢复这些对象。
Examples
示例
List open tasks:
bun Tools/AnyType.ts tasksQuick-create a task with due date:
bun Tools/AnyType.ts task-add "Review pull request" --due 2026-03-01Mark task done:
bun Tools/AnyType.ts done <task_id>Set a due date on existing task:
bun Tools/AnyType.ts update --id <task_id> --due 2026-03-15Search with sorting:
bun Tools/AnyType.ts search --query "meeting" --sort last_modified_date --direction descRead a specific object:
bun Tools/AnyType.ts get --id <object_id>Create with full control:
bun Tools/AnyType.ts create --type page --name "Meeting Notes" --body "## Agenda\n- Item 1"列出未完成任务:
bun Tools/AnyType.ts tasks快速创建带截止日期的任务:
bun Tools/AnyType.ts task-add "Review pull request" --due 2026-03-01标记任务为完成:
bun Tools/AnyType.ts done <task_id>为现有任务设置截止日期:
bun Tools/AnyType.ts update --id <task_id> --due 2026-03-15带排序的搜索:
bun Tools/AnyType.ts search --query "meeting" --sort last_modified_date --direction desc读取指定对象:
bun Tools/AnyType.ts get --id <object_id>完全自定义创建对象:
bun Tools/AnyType.ts create --type page --name "Meeting Notes" --body "## Agenda\n- Item 1"