← 返回 Skills 市场
woodcoal

AFFiNE Skill

作者 木炭 · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ⚠ suspicious
100
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install affine
功能描述
Command-line tool to manage Affine documents, tags, folders, databases, comments, journals, and workspaces on cloud or self-hosted servers.
使用说明 (SKILL.md)

Affine CLI

Command-line tool for managing Affine documents and workspaces. Works with both cloud and self-hosted Affine instances.

Installation Check

First, verify affine-cli is installed:

which affine-cli || npm list -g affine-cli

If not installed, install globally:

npm install -g affine-cli

Or run directly with npx:

npx affine-cli \x3Ccommand>

When to Use

  • Managing documents, tags, folders, collections
  • Working with databases, comments, journals
  • Batch operations on Affine workspace
  • Automating document workflows

Quick Start

# 1. Login (get token from https://app.affine.pro/settings/tokens)
affine-cli auth login --token YOUR_TOKEN

# 2. Check status
affine-cli auth status

# 3. List workspaces
affine-cli workspace list

# 4. List documents
affine-cli doc list

Self-hosted:

affine-cli auth login --url https://your-affine.example.com --token YOUR_TOKEN

Command Overview

Module Commands
auth login, logout, status
workspace list
doc list, all, info, create, delete, copy, update, search, replace, append, publish, unpublish
tags list, create, add, remove, delete, info
folder all, list, create, delete, update, clear, add, move, remove
collection list, info, create, update, delete, add, remove
file upload, delete, clean
database list, columns, query, create, insert, update, delete, remove
comments list, create, update, delete, resolve
journal list, create, info, append, update

Common Examples

Daily Journal

# Create today's journal
affine-cli journal create

# Append to today's journal
affine-cli journal append --content "# Morning\
- Reviewed tasks\
- Team standup"

# Append to specific date
affine-cli journal append --date 2025-04-10 --content "# Notes\
Meeting with team"

# View journal
affine-cli journal info --date 2025-04-10

# List recent journals
affine-cli journal list --count 7

Documents

# Find a document by title
affine-cli doc search -q "meeting notes"

# Create from file (README.md, etc.)
affine-cli doc create -t "Q2 Planning" -c "@planning.md"

# Create with tags
affine-cli doc create -t "Project Alpha" -c "# Project\
Details" --tags "work,important" --icon "📁"

# View document content
affine-cli doc info -i DOC_ID --content markdown

# Add content to document
affine-cli doc append -i DOC_ID --content "\
\
## Update\
New content here"

# Search with tag filter
affine-cli doc search -q "budget" --tag finance

Tags

# Create tag
affine-cli tags create --name "review"

# Add tag to document
affine-cli tags add -d DOC_ID --tag review

# List all tags
affine-cli tags list

# Find documents with tag
affine-cli tags info --tag review

Folders

# Create folder
affine-cli folder create --name "Projects"

# List root folders
affine-cli folder all

# List folder contents
affine-cli folder list --id FOLDER_ID

# Move document to folder
affine-cli folder move --id FOLDER_ID -d DOC_ID

Databases

# List databases in a doc
affine-cli database list --doc DOC_ID

# Query data (filters)
affine-cli database query --doc DOC_ID --id DB_ID -q '[{"column":"Status","operator":"eq","value":"Done"}]'

# Insert new row
affine-cli database insert --doc DOC_ID --id DB_ID --content '[{"Task":"Review PR","Status":"Todo"}]'

# Update rows
affine-cli database update --doc DOC_ID --id DB_ID --values '{"Status":"Done"}' -q '[{"column":"Task","operator":"contains","value":"Review"}]'

Configuration

Priority: env vars > local .env > global config

Files:

  • Global: ~/.affine-cli/affine-cli.env
  • Local: \x3Cproject>/.env

Environment variables:

  • AFFINE_API_TOKEN - Required, get from Settings → Tokens
  • AFFINE_BASE_URL - Server URL (default: https://app.affine.pro)
  • AFFINE_WORKSPACE_ID - Default workspace

Reference Files

Support

安全使用建议
This is an instruction-only skill that documents how to use the external 'affine-cli' npm package. Before installing or using it: 1) verify the npm package and linked GitHub repo (https://github.com/woodcoal/affine-cli) are legitimate and review their code/README; 2) confirm the AFFINE_API_TOKEN scope and rotate it after use if you store it; 3) prefer saving tokens to a project-local .env rather than a global ~/.affine-cli file if you want to limit exposure; 4) note the registry metadata contradicts SKILL.md about required binaries/env — ask the publisher to correct metadata or refuse installation until clarified; and 5) if you run the CLI, inspect what the npm package does at install/run time (postinstall scripts, network calls) before granting it access to tokens.
功能分析
Type: OpenClaw Skill Name: affine Version: 1.0.0 The skill bundle provides a comprehensive interface for the `affine-cli` tool, enabling management of Affine documents, workspaces, databases, and journals. It follows standard CLI patterns for authentication using API tokens and configuration via environment variables or local files. No evidence of malicious intent, data exfiltration, or prompt injection was found across the documentation or command definitions.
能力评估
Purpose & Capability
The name, description, and included command docs all match a CLI for managing AFFiNE resources. However, registry metadata in the package (earlier summary) lists no required env vars or binaries while SKILL.md declares node/npm and AFFINE_API_TOKEN as required — this metadata mismatch is unexpected and should be clarified.
Instruction Scope
SKILL.md is instruction-only and tells users/agents to run the affine-cli binary, obtain an AFFINE_API_TOKEN, and that configuration is loaded from env > local .env > ~/.affine-cli/affine-cli.env. Referencing these config files and environment variables is reasonable for a CLI, but it does tell the agent/user where credentials may be stored and that tokens may be saved to global config (writes to ~/.affine-cli). This is normal for a CLI but worth awareness.
Install Mechanism
There is no install spec in the registry (instruction-only). The docs recommend npm install -g affine-cli or npx, which is a standard distribution method. Because the skill doesn't include an install script, the installation risk is limited to whatever the npm package itself does — verify the npm package and GitHub repo before installing.
Credentials
The runtime docs require AFFINE_API_TOKEN (and optionally AFFINE_BASE_URL, AFFINE_WORKSPACE_ID), which are appropriate for a tool that talks to AFFiNE. The concern is the package metadata bundled with the skill lists no required env vars or binaries while SKILL.md explicitly lists them — this discrepancy could mislead automated checks or users about what secrets the skill needs.
Persistence & Privilege
The skill is not always-enabled and does not request special platform privileges. It documents that the CLI can persist tokens to local or global config files — typical behavior for a CLI and limited in scope to the user's home directory.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install affine
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /affine 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
- Initial release of affine-cli: a command-line tool for managing Affine documents, tags, folders, collections, databases, comments, journals, and workspaces. - Supports both cloud (app.affine.pro) and self-hosted Affine deployments. - Provides a wide range of commands for workspace, document, tag, folder, collection, file, database, comment, and journal management. - Offers flexible configuration via environment variables, local .env, or global config file. - Includes quick-start instructions and common usage examples for key features.
元数据
Slug affine
版本 1.0.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

AFFiNE Skill 是什么?

Command-line tool to manage Affine documents, tags, folders, databases, comments, journals, and workspaces on cloud or self-hosted servers. 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 100 次。

如何安装 AFFiNE Skill?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install affine」即可一键安装,无需额外配置。

AFFiNE Skill 是免费的吗?

是的,AFFiNE Skill 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

AFFiNE Skill 支持哪些平台?

AFFiNE Skill 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 AFFiNE Skill?

由 木炭(@woodcoal)开发并维护,当前版本 v1.0.0。

💬 留言讨论