← Back to Skills Marketplace
woodcoal

AFFiNE Skill

by 木炭 · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ⚠ suspicious
100
Downloads
0
Stars
0
Active Installs
1
Versions
Install in OpenClaw
/install affine
Description
Command-line tool to manage Affine documents, tags, folders, databases, comments, journals, and workspaces on cloud or self-hosted servers.
README (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

Usage Guidance
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.
Capability Analysis
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.
Capability Assessment
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.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install affine
  3. After installation, invoke the skill by name or use /affine
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
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.
Metadata
Slug affine
Version 1.0.0
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 1
Frequently Asked Questions

What is AFFiNE Skill?

Command-line tool to manage Affine documents, tags, folders, databases, comments, journals, and workspaces on cloud or self-hosted servers. It is an AI Agent Skill for Claude Code / OpenClaw, with 100 downloads so far.

How do I install AFFiNE Skill?

Run "/install affine" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is AFFiNE Skill free?

Yes, AFFiNE Skill is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does AFFiNE Skill support?

AFFiNE Skill is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created AFFiNE Skill?

It is built and maintained by 木炭 (@woodcoal); the current version is v1.0.0.

💬 Comments