← 返回
未分类 Key 中文

AFFiNE Skill

Command-line tool to manage Affine documents, tags, folders, databases, comments, journals, and workspaces on cloud or self-hosted servers.
命令行工具,用于在云端或自托管服务器上管理 Affine 文档、标签、文件夹、数据库、评论、日志和工作区。
woodcoal woodcoal 来源
未分类 clawhub v1.0.0 1 版本 99715.9 Key: 需要
★ 0
Stars
📥 351
下载
💾 0
安装
1
版本
#latest

概述

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 <command>

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

ModuleCommands
------------------
authlogin, logout, status
workspacelist
doclist, all, info, create, delete, copy, update, search, replace, append, publish, unpublish
tagslist, create, add, remove, delete, info
folderall, list, create, delete, update, clear, add, move, remove
collectionlist, info, create, update, delete, add, remove
fileupload, delete, clean
databaselist, columns, query, create, insert, update, delete, remove
commentslist, create, update, delete, resolve
journallist, 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\n- Reviewed tasks\n- Team standup"

# Append to specific date
affine-cli journal append --date 2025-04-10 --content "# Notes\nMeeting 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\nDetails" --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 "\n\n## Update\nNew 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: /.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

  • GitHub: https://github.com/woodcoal/affine-cli
  • Issues: https://github.com/woodcoal/affine-cli/issues
  • Docs: https://deepwiki.com/toeverything/AFFiNE

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-05-07 12:24 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

ai-agent

Self-Improving + Proactive Agent

ivangdavila
自我反思+自我批评+自我学习+自组织记忆。智能体评估自身工作、发现错误并持续改进。
★ 1,385 📥 320,936
dev-programming

Github

steipete
使用 `gh` CLI 与 GitHub 交互,通过 `gh issue`、`gh pr`、`gh run` 和 `gh api` 管理议题、PR、CI 运行及高级查询。
★ 677 📥 325,834
ai-agent

Skill Vetter

spclaudehome
AI智能体技能安全预审工具。安装ClawdHub、GitHub等来源技能前,检查风险信号、权限范围及可疑模式。
★ 1,232 📥 268,219