← Back to CLIs
Nardjo

craft-cli

Manage Craft Space API via CLI - auth, blocks, collection-items, collection-views, collections, comments, connection, documents, folders, tasks, upload, whiteboards. Use when user mentions 'Craft', 'Craft docs', 'Craft space', 'daily notes', 'Craft tasks', 'Craft collections', or wants to interact with the Craft API.

Install

$ npx api2cli install Nardjo/craft-cli

Details

Skill type: Wrapper CLI
Auth type: bearer
Version: 0.1.0
Author: Nardjo
Views: 0

README

craft-cli

CLI for the Craft Space API. Built with api2cli.dev.

Install

npx api2cli install Nardjo/craft-cli

This clones the repo, builds the CLI, links it to your PATH, and installs the AgentSkill to your coding agents.

Usage

craft-cli auth set "your-token"
craft-cli auth test
craft-cli --help

Always use --json when scripting or calling the CLI from an agent.

Authentication

Craft uses bearer token authentication.

craft-cli auth set "your-token"
craft-cli auth show
craft-cli auth test
craft-cli auth remove

Tokens are stored in ~/.config/tokens/craft-cli.txt with restricted file permissions.

Resources

connection

CommandDescription
craft-cli connection info --jsonGet space metadata, timezone, current time, and deep-link templates.

folders

CommandDescription
craft-cli folders list --jsonList built-in locations and user folders with document counts.
craft-cli folders create --name "Project" --jsonCreate one folder.
craft-cli folders create --names "Marketing,Engineering" --jsonCreate multiple folders.
craft-cli folders delete --ids folder-1,folder-2 --jsonDelete folders by ID.
craft-cli folders move --ids folder-1 --destination root --jsonMove folders to root.
craft-cli folders move --ids folder-1 --parent-folder-id folder-2 --jsonMove folders inside another folder.

documents

CommandDescription
craft-cli documents list --location unsorted --jsonList documents in a built-in location.
craft-cli documents list --folder-id folder-123 --fetch-metadata --jsonList documents inside a folder recursively.
craft-cli documents search --include "API" --jsonSearch documents by included terms.
`craft-cli documents search --regexps "projectroadmap" --fetch-blocks --json`
craft-cli documents create --title "Project Plan" --jsonCreate one document.
craft-cli documents create --titles "One,Two" --folder-id folder-123 --jsonCreate multiple documents in a folder.
craft-cli documents delete --ids doc-123,doc-456 --jsonSoft-delete documents by moving them to trash.
craft-cli documents move --ids doc-123 --folder-id folder-456 --jsonMove documents to a folder.
craft-cli documents move --ids doc-123 --destination unsorted --jsonMove documents to a built-in location.

blocks

CommandDescription
craft-cli blocks fetch --id doc-123 --jsonFetch a block or document root as structured JSON.
craft-cli blocks fetch --date today --markdown --jsonFetch a daily note as rendered markdown.
craft-cli blocks insert --markdown "## Notes" --page-id doc-123 --position end --jsonInsert markdown into a document.
craft-cli blocks insert --body-file payload.json --jsonInsert rich structured blocks from JSON.
craft-cli blocks update --id block-5 --markdown "Updated text" --jsonUpdate one block's markdown.
craft-cli blocks update --body-file payload.json --jsonUpdate multiple blocks from JSON.
craft-cli blocks delete --ids block-1,block-2 --jsonDelete blocks by ID.
craft-cli blocks move --ids block-5,block-6 --page-id doc-123 --position end --jsonMove blocks to a document position.
craft-cli blocks search --block-id doc-123 --pattern "API" --before-block-count 1 --jsonSearch inside one document or page block.

collections

CommandDescription
craft-cli collections list --jsonList collections across the space.
craft-cli collections list --document-ids doc-123 --jsonList collections filtered by document.
craft-cli collections create --body-file collection.json --jsonCreate a collection from schema and position JSON.
craft-cli collections schema collection-123 --jsonGet JSON Schema for collection items.
craft-cli collections schema collection-123 --schema-format schema --jsonGet editable collection schema.
craft-cli collections update-schema collection-123 --body-file schema.json --jsonReplace a collection schema.
craft-cli collections set-active-view collection-123 --view-id view-board --jsonSet the active stored view.

collection-items

CommandDescription
craft-cli collection-items list collection-123 --jsonList items from a collection.
craft-cli collection-items list collection-123 --max-depth 0 --jsonList collection item properties without nested content.
craft-cli collection-items add collection-123 --body-file items.json --jsonAdd items to a collection.
craft-cli collection-items update collection-123 --body-file update.json --jsonUpdate collection items.
craft-cli collection-items delete collection-123 --ids item-1,item-2 --jsonDelete collection items.

collection-views

CommandDescription
craft-cli collection-views list collection-123 --jsonList stored views for a collection.
craft-cli collection-views create collection-123 --body-file view.json --jsonCreate a table, gallery, or kanban view definition.
craft-cli collection-views update collection-123 view-board --body-file view.json --jsonUpdate a view definition.
craft-cli collection-views delete collection-123 view-board --jsonDelete a view definition.

comments

CommandDescription
craft-cli comments add --block-id block-123 --content "Please review" --jsonAdd one comment to a block.
craft-cli comments add --body-file comments.json --jsonAdd multiple comments from JSON.

tasks

CommandDescription
craft-cli tasks list --scope active --jsonList active tasks.
craft-cli tasks list --scope document --document-id doc-123 --jsonList tasks in one document.
craft-cli tasks add --markdown "Prepare slides" --location inbox --jsonAdd a task to inbox.
craft-cli tasks add --body-file tasks.json --jsonAdd one or more tasks from JSON.
craft-cli tasks update --id task-1 --state done --jsonMark or update one task.
craft-cli tasks update --body-file update.json --jsonUpdate tasks from JSON.
craft-cli tasks delete --ids task-1,task-2 --jsonDelete tasks by ID.

upload

CommandDescription
craft-cli upload file --file image.png --position end --page-id doc-123 --content-type image/png --jsonUpload a file and insert it into a document.

whiteboards

CommandDescription
craft-cli whiteboards create --page-id doc-123 --position start --jsonCreate an empty whiteboard block.
craft-cli whiteboards elements whiteboard-123 --jsonGet all elements, assets, and app state.
craft-cli whiteboards add-elements whiteboard-123 --body-file elements.json --jsonAppend Excalidraw elements.
craft-cli whiteboards update-elements whiteboard-123 --body-file elements.json --jsonUpdate Excalidraw elements by ID.
craft-cli whiteboards delete-elements whiteboard-123 --ids element-1,element-2 --jsonDelete Excalidraw elements by ID.

JSON Bodies

Complex Craft operations accept either inline JSON or a JSON file:

craft-cli blocks insert --body '{"markdown":"## Notes","position":{"position":"end","pageId":"doc-123"}}' --json
craft-cli collection-items add collection-123 --body-file items.json --json
cat payload.json | craft-cli tasks add --body-file - --json

Output Format

--json returns a standardized envelope:

{ "ok": true, "data": { "...": "..." }, "meta": { "total": 42 } }

On error:

{ "ok": false, "error": { "code": 401, "message": "401: Unauthorized", "suggestion": "Check your token: craft-cli auth test" } }

Global Flags

All commands support --json, --format <text|json|csv|yaml>, --verbose, --no-color, and --no-header.

Help

craft-cli --help
craft-cli <resource> --help
craft-cli <resource> <action> --help
Sponsors