anywrite – skill Lập trình cho agent AI
CLI đã biên dịch bao phủ toàn bộ 52 endpoint của Anytype local API — objects, properties, tags, search, chat, files — một binary duy nhất, không cần MCP server.
Cài skill anywrite bằng một lệnh
Chọn công cụ bạn đang dùng, copy lệnh và dán vào terminal. Skill sẽ nằm trong thư mục skills của công cụ đó và sẵn sàng dùng ở phiên làm việc tiếp theo.
Claude Code
mkdir -p ~/.claude/skills && curl -fsSL https://skill.dn1nguoi.com/z/anywrite-3c7d7.tgz | tar xz -C ~/.claude/skills
Gọi trong Claude Code: /anywrite – rồi mô tả công việc bạn muốn làm.
Codex
mkdir -p ~/.codex/skills && curl -fsSL https://skill.dn1nguoi.com/z/anywrite-3c7d7.tgz | tar xz -C ~/.codex/skills
Gọi trong Codex: $anywrite – rồi mô tả công việc bạn muốn làm.
Hermes Agent
mkdir -p ~/.hermes/skills && curl -fsSL https://skill.dn1nguoi.com/z/anywrite-3c7d7.tgz | tar xz -C ~/.hermes/skills
Gọi trong Hermes Agent: /anywrite – rồi mô tả công việc bạn muốn làm.
DeepSeek
mkdir -p ~/.deepcode/skills && curl -fsSL https://skill.dn1nguoi.com/z/anywrite-3c7d7.tgz | tar xz -C ~/.deepcode/skills
Gọi trong DeepSeek: /anywrite – rồi mô tả công việc bạn muốn làm.
Nội dung SKILL.md
Nội dung SKILL.md gốc bằng tiếng Anh.
anywrite
Overview
anywrite is a single compiled Bun/TypeScript CLI for the [Anytype](https://anytype.io) desktop app's local HTTP API — all 52 endpoints across spaces, objects, properties, tags, types, templates, lists, chat, files, members, search, and auth — as one binary with zero runtime dependencies. It exists as a low-context alternative to Anytype's official MCP server: rather than exposing 52 always-loaded tools to every agent session, anywrite is a normal CLI wired as a skill that costs zero context until it's actually invoked, and is equally usable from a terminal or any script.
When to Use This Skill
- Use when the user mentions Anytype or asks to create, update, search, or organize notes, tasks, or PKM objects.
- Use when working with Anytype spaces, properties, tags, types, templates, or lists (sets and collections).
- Use when the user asks to upload files to a space, chat inside a space, or read/write structured objects programmatically.
How It Works
Step 1: Ensure Anytype desktop is running and authenticated
This repository does not ship the anywrite executable. The user must install or build a reviewed upstream release outside the current workspace and provide its explicit absolute path. Before use, verify that path is an executable regular file, is not a symlink, and is not a workspace-relative dist/ artifact. Never auto-discover or execute ./dist/anywrite from the repository being worked on.
The Anytype desktop app must be running locally (default http://localhost:31009). Authenticate once:
"/absolute/path/to/anywrite" auth --status # shows configured yes/no and where the key came from
"/absolute/path/to/anywrite" auth # challenge flow — a 4-digit code appears in the app
"/absolute/path/to/anywrite" auth --code 1234 # non-interactive form of the same exchangeThe key is written to ~/.anywrite/config.json and is never printed by any command.
Step 2: Invoke a resource + action
anywrite <resource> <action> [positionals] [--flag value]Resources: spaces, objects, properties, tags, types, templates, lists, files, members, search, chat, auth. Output is JSON by default; add --pretty for a human view, --json as an escape hatch for anything the typed flags don't model yet. space/type/property positionals accept a name or an id — names are resolved to ids automatically.
Resolve names to IDs and confirm the exact space/object before mutations; duplicate names must not select an arbitrary object. Whole-body replacements can erase content, so preserve a revision and review the complete replacement. Search requests do not authorize uploads/chat/deletes. Bound chat/search pages and payload sizes instead of using --all indiscriminately, and verify the resulting state after writes.
Examples
Example 1: Create and update an object
"/absolute/path/to/anywrite" objects create <space> --type task --name "Buy milk"
"/absolute/path/to/anywrite" objects update <space> <object_id> --status "Done"Example 2: Search and upload a file
"/absolute/path/to/anywrite" search global --query "task" --types task
"/absolute/path/to/anywrite" files upload <space> --file ./image.pngExample 3: Read chat messages
"/absolute/path/to/anywrite" chat messages <space> <chat_id> --allBest Practices
- ✅ Pass names for
space/type/propertyand let the CLI resolve them to ids. - ✅ Use default JSON output for scripting and
--prettyfor human review. - ✅ Reach for
--jsonwhen a brand-new API field isn't yet covered by a typed flag. - ❌ Don't set an empty-string emoji
--icon; omit the flag entirely instead. - ❌ Don't expect
lists add/removeto work on sets — they only apply to collections.
Limitations
- This skill does not replace environment-specific validation, testing, or expert review.
- Stop and ask for clarification if required inputs, permissions, or safety boundaries are missing.
- Bounded by the Anytype local API itself: no block-level editing (body is whole-markdown replace only), no member invite/role management, no template create/update/delete, no space deletion.
- The object body field is named
--bodyon create but--markdownon update.
Security & Safety Notes
- The API key is stored locally in
~/.anywrite/config.jsonand is never printed by any command, includingauth --status. - Config precedence at runtime:
ANYTYPE_API_KEYenv var, then~/.anywrite/config.json, then a read-only fallback to an existing~/.anytype-cli/config.yaml. - CLI calls target the configured local instance, but Anytype may sync content according to its network/space configuration. Verify actual sync/sharing before writing private data; localhost does not establish local-only storage.
- Inspect the actual resource/version deletion semantics and recovery path; do not assume every delete is reversible or safe to retry from this index.
Common Pitfalls
- Problem:
lists add/removesilently does nothing on a set.
Solution: These only work on collections, not sets.
- Problem: Re-uploading an identical file returns an existing object id instead of a new one.
Solution: This is intentional — file upload dedupes by content hash.
- Problem: Chat messages don't paginate like everything else.
Solution: Chat paginates by cursor; every other resource paginates by offset.
Related Skills
@docx- When the deliverable is a Word document rather than an Anytype object.
Skill liên quan
- api-analyzer – Kiểm tra xem một yêu cầu API có đúng hay không dựa trên đầu vào được cung cấp (method…
- caio-review – /c-level-agents:caio-review [plan] — Chief AI Officer kiểm tra nghiêm ngặt về đánh giá…
- codex – Giao việc lập trình cho OpenAI Codex CLI (tính năng, PR).
- api-contract-testing – Thiết kế và rà soát kiểm thử hợp đồng API giữa nhà cung cấp và người tiêu dùng. Dùng cho…
- api-design-principles – Nắm vững các nguyên tắc thiết kế API REST và GraphQL để xây dựng API trực quan, có khả…
- api-designer – Tạo đặc tả endpoint REST API hoàn chỉnh, sẵn sàng cho production, cho bất kỳ hệ thống…
- api-documentation – Quy trình tài liệu API để tạo đặc tả OpenAPI, viết hướng dẫn cho lập trình viên và duy…
- api-documentation-generator – Tạo tài liệu API đầy đủ, thân thiện với lập trình viên từ mã nguồn, bao gồm endpoint…