{
  "schemaVersion": "1.0",
  "item": {
    "slug": "logseq",
    "name": "Logseq",
    "source": "tencent",
    "type": "skill",
    "category": "开发工具",
    "sourceUrl": "https://clawhub.ai/juanirm/logseq",
    "canonicalUrl": "https://clawhub.ai/juanirm/logseq",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadMode": "redirect",
    "downloadUrl": "/downloads/logseq",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=logseq",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "installMethod": "Manual import",
    "extraction": "Extract archive",
    "prerequisites": [
      "OpenClaw"
    ],
    "packageFormat": "ZIP package",
    "includedAssets": [
      "SKILL.md",
      "references/api-reference.md",
      "references/examples.md"
    ],
    "primaryDoc": "SKILL.md",
    "quickSetup": [
      "Download the package from Yavira.",
      "Extract the archive and review SKILL.md first.",
      "Import or place the package into your OpenClaw setup."
    ],
    "agentAssist": {
      "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
      "steps": [
        "Download the package from Yavira.",
        "Extract it into a folder your agent can access.",
        "Paste one of the prompts below and point your agent at the extracted folder."
      ],
      "prompts": [
        {
          "label": "New install",
          "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete."
        },
        {
          "label": "Upgrade existing",
          "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run."
        }
      ]
    },
    "sourceHealth": {
      "source": "tencent",
      "slug": "logseq",
      "status": "healthy",
      "reason": "direct_download_ok",
      "recommendedAction": "download",
      "checkedAt": "2026-05-05T03:17:54.524Z",
      "expiresAt": "2026-05-12T03:17:54.524Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=logseq",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=logseq",
        "contentDisposition": "attachment; filename=\"logseq-1.0.0.zip\"",
        "redirectLocation": null,
        "bodySnippet": null,
        "slug": "logseq"
      },
      "scope": "item",
      "summary": "Item download looks usable.",
      "detail": "Yavira can redirect you to the upstream package for this item.",
      "primaryActionLabel": "Download for OpenClaw",
      "primaryActionHref": "/downloads/logseq"
    },
    "validation": {
      "installChecklist": [
        "Use the Yavira download entry.",
        "Review SKILL.md after the package is downloaded.",
        "Confirm the extracted package contains the expected setup assets."
      ],
      "postInstallChecks": [
        "Confirm the extracted package includes the expected docs or setup files.",
        "Validate the skill or prompts are available in your target agent workspace.",
        "Capture any manual follow-up steps the agent could not complete."
      ]
    },
    "downloadPageUrl": "https://openagent3.xyz/downloads/logseq",
    "agentPageUrl": "https://openagent3.xyz/skills/logseq/agent",
    "manifestUrl": "https://openagent3.xyz/skills/logseq/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/logseq/agent.md"
  },
  "agentAssist": {
    "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
    "steps": [
      "Download the package from Yavira.",
      "Extract it into a folder your agent can access.",
      "Paste one of the prompts below and point your agent at the extracted folder."
    ],
    "prompts": [
      {
        "label": "New install",
        "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete."
      },
      {
        "label": "Upgrade existing",
        "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run."
      }
    ]
  },
  "documentation": {
    "source": "clawhub",
    "primaryDoc": "SKILL.md",
    "sections": [
      {
        "title": "Logseq Plugin API",
        "body": "Interact with your local Logseq instance through its JavaScript Plugin API. This skill enables reading, writing, querying, and automating workflows in your Logseq graph."
      },
      {
        "title": "Prerequisites",
        "body": "Logseq must be running locally with a plugin that exposes the API. The standard way is:\n\nInstall a bridge plugin that exposes logseq API via HTTP (e.g., via a custom plugin or localhost endpoint)\nAlternative: Use Node.js with @logseq/libs package to script against the running Logseq instance\n\nThe API is primarily designed for in-browser plugins, so accessing it from external scripts requires a bridge/proxy."
      },
      {
        "title": "Core API Namespaces",
        "body": "The Logseq Plugin API is organized into these main proxies:"
      },
      {
        "title": "logseq.App",
        "body": "Application-level operations: getting app info, user configs, current graph, commands, UI state, external links.\n\nKey methods:\n\ngetInfo() - Get app version and info\ngetUserConfigs() - Get user preferences (theme, format, language, etc.)\ngetCurrentGraph() - Get current graph info (name, path, URL)\nregisterCommand(type, opts, action) - Register custom commands\npushState(route, params, query) - Navigate to routes"
      },
      {
        "title": "logseq.Editor",
        "body": "Block and page editing operations: creating, updating, moving, querying content.\n\nKey methods:\n\ngetBlock(uuid) - Get block by UUID\ngetCurrentPage() - Get current page entity\ngetCurrentPageBlocksTree() - Get all blocks on current page\ngetPageBlocksTree(page) - Get all blocks for a specific page\ninsertBlock(target, content, opts) - Insert a new block\nupdateBlock(uuid, content) - Update block content\ncreatePage(pageName, properties, opts) - Create a new page\ndeletePage(pageName) - Delete a page\ngetPageLinkedReferences(page) - Get backlinks to a page\nregisterSlashCommand(tag, action) - Add custom slash commands"
      },
      {
        "title": "logseq.DB",
        "body": "Database queries using Datalog.\n\nKey methods:\n\nq(query, ...inputs) - Run Datalog query\ndatascriptQuery(query, ...inputs) - Direct Datascript query"
      },
      {
        "title": "logseq.UI",
        "body": "UI operations: messages, dialogs, main UI visibility.\n\nKey methods:\n\nshowMsg(content, status) - Show toast notification\nqueryElementById(id) - Query DOM elements"
      },
      {
        "title": "logseq.Git",
        "body": "Git operations for the current graph.\n\nKey methods:\n\nexecCommand(args) - Execute git command"
      },
      {
        "title": "logseq.Assets",
        "body": "Asset management.\n\nKey methods:\n\nlistFilesOfCurrentGraph(path) - List files in graph"
      },
      {
        "title": "Read Content",
        "body": "// Get current page\nconst page = await logseq.Editor.getCurrentPage();\n\n// Get all blocks on a page\nconst blocks = await logseq.Editor.getPageBlocksTree('Daily Notes');\n\n// Get a specific block\nconst block = await logseq.Editor.getBlock('block-uuid-here');\n\n// Query with Datalog\nconst results = await logseq.DB.q(`\n  [:find (pull ?b [*])\n   :where [?b :block/marker \"TODO\"]]\n`);"
      },
      {
        "title": "Write Content",
        "body": "// Create a new page\nawait logseq.Editor.createPage('Project Notes', {\n  tags: 'project',\n  status: 'active'\n}, { redirect: false });\n\n// Insert a block\nconst block = await logseq.Editor.insertBlock(\n  'target-block-uuid',\n  '- New task item',\n  { before: false, sibling: true }\n);\n\n// Update a block\nawait logseq.Editor.updateBlock('block-uuid', 'Updated content');\n\n// Batch insert multiple blocks\nconst blocks = [\n  { content: 'First item' },\n  { content: 'Second item', children: [\n    { content: 'Nested item' }\n  ]}\n];\nawait logseq.Editor.insertBatchBlock('parent-uuid', blocks, { sibling: false });"
      },
      {
        "title": "Task Management",
        "body": "// Find all TODO items\nconst todos = await logseq.DB.q(`\n  [:find (pull ?b [*])\n   :where\n   [?b :block/marker ?marker]\n   [(contains? #{\"TODO\" \"DOING\"} ?marker)]]\n`);\n\n// Mark task as DONE\nawait logseq.Editor.updateBlock('task-uuid', 'DONE Task content');\n\n// Get tasks on current page\nconst page = await logseq.Editor.getCurrentPage();\nconst blocks = await logseq.Editor.getPageBlocksTree(page.name);\nconst tasks = blocks.filter(b => b.marker === 'TODO' || b.marker === 'DOING');"
      },
      {
        "title": "Navigation and UI",
        "body": "// Navigate to a page\nlogseq.App.pushState('page', { name: 'Project Notes' });\n\n// Show notification\nlogseq.UI.showMsg('✅ Task completed!', 'success');\n\n// Get app config\nconst configs = await logseq.App.getUserConfigs();\nconsole.log('Theme:', configs.preferredThemeMode);\nconsole.log('Format:', configs.preferredFormat);"
      },
      {
        "title": "Implementation Approaches",
        "body": "Since Logseq's Plugin API is browser-based, you have several options:"
      },
      {
        "title": "Option 1: Bridge Plugin",
        "body": "Create a minimal Logseq plugin that exposes API calls via HTTP:\n\n// In Logseq plugin (index.js)\nlogseq.ready(() => {\n  // Expose API endpoints\n  logseq.provideModel({\n    async handleAPICall({ method, args }) {\n      return await logseq.Editor[method](...args);\n    }\n  });\n});\n\n// Then call from external script via HTTP POST"
      },
      {
        "title": "Option 2: Node.js Script with @logseq/libs",
        "body": "For automation scripts, use the @logseq/libs package:\n\nnpm install @logseq/libs\n\nNote: This requires a running Logseq instance and proper connection setup."
      },
      {
        "title": "Option 3: Direct Plugin Development",
        "body": "Develop a full Logseq plugin following the plugin samples at:\nhttps://github.com/logseq/logseq-plugin-samples"
      },
      {
        "title": "API Reference",
        "body": "For complete API documentation, see:\n\nAPI Docs: https://logseq.github.io/plugins/\nPlugin Samples: https://github.com/logseq/logseq-plugin-samples\nType Definitions: references/api-types.md (extracted from @logseq/libs)"
      },
      {
        "title": "BlockEntity",
        "body": "{\n  id: number,           // Entity ID\n  uuid: string,         // Block UUID\n  content: string,      // Block content\n  format: 'markdown' | 'org',\n  page: { id: number }, // Parent page\n  parent: { id: number }, // Parent block\n  left: { id: number }, // Previous sibling\n  properties: {},       // Block properties\n  marker?: string,      // TODO/DOING/DONE\n  children?: []         // Child blocks\n}"
      },
      {
        "title": "PageEntity",
        "body": "{\n  id: number,\n  uuid: string,\n  name: string,              // Page name (lowercase)\n  originalName: string,       // Original case\n  'journal?': boolean,\n  properties: {},\n  journalDay?: number,       // YYYYMMDD for journals\n}"
      },
      {
        "title": "Tips & Best Practices",
        "body": "Always check for null: API methods may return null if entity doesn't exist\nUse UUIDs over IDs: Block UUIDs are stable, entity IDs can change\nBatch operations: Use insertBatchBlock for multiple inserts\nQuery efficiently: Datalog queries are powerful but can be slow on large graphs\nProperties are objects: Access with block.properties.propertyName\nFormat matters: Respect user's preferred format (markdown vs org-mode)\nAsync all the way: All API calls return Promises"
      },
      {
        "title": "Common Gotchas",
        "body": "Page names are lowercase: When querying, use lowercase page names\nJournal pages: Use journalDay format (YYYYMMDD) not date strings\nBlock hierarchy: Respect parent/child relationships when inserting\nFormat differences: Markdown uses - for bullets, Org uses *\nProperties syntax: Different between markdown (prop::) and org (:PROPERTIES:)"
      }
    ],
    "body": "Logseq Plugin API\n\nInteract with your local Logseq instance through its JavaScript Plugin API. This skill enables reading, writing, querying, and automating workflows in your Logseq graph.\n\nPrerequisites\n\nLogseq must be running locally with a plugin that exposes the API. The standard way is:\n\nInstall a bridge plugin that exposes logseq API via HTTP (e.g., via a custom plugin or localhost endpoint)\nAlternative: Use Node.js with @logseq/libs package to script against the running Logseq instance\n\nThe API is primarily designed for in-browser plugins, so accessing it from external scripts requires a bridge/proxy.\n\nCore API Namespaces\n\nThe Logseq Plugin API is organized into these main proxies:\n\nlogseq.App\n\nApplication-level operations: getting app info, user configs, current graph, commands, UI state, external links.\n\nKey methods:\n\ngetInfo() - Get app version and info\ngetUserConfigs() - Get user preferences (theme, format, language, etc.)\ngetCurrentGraph() - Get current graph info (name, path, URL)\nregisterCommand(type, opts, action) - Register custom commands\npushState(route, params, query) - Navigate to routes\nlogseq.Editor\n\nBlock and page editing operations: creating, updating, moving, querying content.\n\nKey methods:\n\ngetBlock(uuid) - Get block by UUID\ngetCurrentPage() - Get current page entity\ngetCurrentPageBlocksTree() - Get all blocks on current page\ngetPageBlocksTree(page) - Get all blocks for a specific page\ninsertBlock(target, content, opts) - Insert a new block\nupdateBlock(uuid, content) - Update block content\ncreatePage(pageName, properties, opts) - Create a new page\ndeletePage(pageName) - Delete a page\ngetPageLinkedReferences(page) - Get backlinks to a page\nregisterSlashCommand(tag, action) - Add custom slash commands\nlogseq.DB\n\nDatabase queries using Datalog.\n\nKey methods:\n\nq(query, ...inputs) - Run Datalog query\ndatascriptQuery(query, ...inputs) - Direct Datascript query\nlogseq.UI\n\nUI operations: messages, dialogs, main UI visibility.\n\nKey methods:\n\nshowMsg(content, status) - Show toast notification\nqueryElementById(id) - Query DOM elements\nlogseq.Git\n\nGit operations for the current graph.\n\nKey methods:\n\nexecCommand(args) - Execute git command\nlogseq.Assets\n\nAsset management.\n\nKey methods:\n\nlistFilesOfCurrentGraph(path) - List files in graph\nCommon Workflows\nRead Content\n// Get current page\nconst page = await logseq.Editor.getCurrentPage();\n\n// Get all blocks on a page\nconst blocks = await logseq.Editor.getPageBlocksTree('Daily Notes');\n\n// Get a specific block\nconst block = await logseq.Editor.getBlock('block-uuid-here');\n\n// Query with Datalog\nconst results = await logseq.DB.q(`\n  [:find (pull ?b [*])\n   :where [?b :block/marker \"TODO\"]]\n`);\n\nWrite Content\n// Create a new page\nawait logseq.Editor.createPage('Project Notes', {\n  tags: 'project',\n  status: 'active'\n}, { redirect: false });\n\n// Insert a block\nconst block = await logseq.Editor.insertBlock(\n  'target-block-uuid',\n  '- New task item',\n  { before: false, sibling: true }\n);\n\n// Update a block\nawait logseq.Editor.updateBlock('block-uuid', 'Updated content');\n\n// Batch insert multiple blocks\nconst blocks = [\n  { content: 'First item' },\n  { content: 'Second item', children: [\n    { content: 'Nested item' }\n  ]}\n];\nawait logseq.Editor.insertBatchBlock('parent-uuid', blocks, { sibling: false });\n\nTask Management\n// Find all TODO items\nconst todos = await logseq.DB.q(`\n  [:find (pull ?b [*])\n   :where\n   [?b :block/marker ?marker]\n   [(contains? #{\"TODO\" \"DOING\"} ?marker)]]\n`);\n\n// Mark task as DONE\nawait logseq.Editor.updateBlock('task-uuid', 'DONE Task content');\n\n// Get tasks on current page\nconst page = await logseq.Editor.getCurrentPage();\nconst blocks = await logseq.Editor.getPageBlocksTree(page.name);\nconst tasks = blocks.filter(b => b.marker === 'TODO' || b.marker === 'DOING');\n\nNavigation and UI\n// Navigate to a page\nlogseq.App.pushState('page', { name: 'Project Notes' });\n\n// Show notification\nlogseq.UI.showMsg('✅ Task completed!', 'success');\n\n// Get app config\nconst configs = await logseq.App.getUserConfigs();\nconsole.log('Theme:', configs.preferredThemeMode);\nconsole.log('Format:', configs.preferredFormat);\n\nImplementation Approaches\n\nSince Logseq's Plugin API is browser-based, you have several options:\n\nOption 1: Bridge Plugin\n\nCreate a minimal Logseq plugin that exposes API calls via HTTP:\n\n// In Logseq plugin (index.js)\nlogseq.ready(() => {\n  // Expose API endpoints\n  logseq.provideModel({\n    async handleAPICall({ method, args }) {\n      return await logseq.Editor[method](...args);\n    }\n  });\n});\n\n// Then call from external script via HTTP POST\n\nOption 2: Node.js Script with @logseq/libs\n\nFor automation scripts, use the @logseq/libs package:\n\nnpm install @logseq/libs\n\n\nNote: This requires a running Logseq instance and proper connection setup.\n\nOption 3: Direct Plugin Development\n\nDevelop a full Logseq plugin following the plugin samples at: https://github.com/logseq/logseq-plugin-samples\n\nAPI Reference\n\nFor complete API documentation, see:\n\nAPI Docs: https://logseq.github.io/plugins/\nPlugin Samples: https://github.com/logseq/logseq-plugin-samples\nType Definitions: references/api-types.md (extracted from @logseq/libs)\nKey Data Structures\nBlockEntity\n{\n  id: number,           // Entity ID\n  uuid: string,         // Block UUID\n  content: string,      // Block content\n  format: 'markdown' | 'org',\n  page: { id: number }, // Parent page\n  parent: { id: number }, // Parent block\n  left: { id: number }, // Previous sibling\n  properties: {},       // Block properties\n  marker?: string,      // TODO/DOING/DONE\n  children?: []         // Child blocks\n}\n\nPageEntity\n{\n  id: number,\n  uuid: string,\n  name: string,              // Page name (lowercase)\n  originalName: string,       // Original case\n  'journal?': boolean,\n  properties: {},\n  journalDay?: number,       // YYYYMMDD for journals\n}\n\nTips & Best Practices\nAlways check for null: API methods may return null if entity doesn't exist\nUse UUIDs over IDs: Block UUIDs are stable, entity IDs can change\nBatch operations: Use insertBatchBlock for multiple inserts\nQuery efficiently: Datalog queries are powerful but can be slow on large graphs\nProperties are objects: Access with block.properties.propertyName\nFormat matters: Respect user's preferred format (markdown vs org-mode)\nAsync all the way: All API calls return Promises\nCommon Gotchas\nPage names are lowercase: When querying, use lowercase page names\nJournal pages: Use journalDay format (YYYYMMDD) not date strings\nBlock hierarchy: Respect parent/child relationships when inserting\nFormat differences: Markdown uses - for bullets, Org uses *\nProperties syntax: Different between markdown (prop::) and org (:PROPERTIES:)"
  },
  "trust": {
    "sourceLabel": "tencent",
    "provenanceUrl": "https://clawhub.ai/juanirm/logseq",
    "publisherUrl": "https://clawhub.ai/juanirm/logseq",
    "owner": "juanirm",
    "version": "1.0.0",
    "license": null,
    "verificationStatus": "Indexed source record"
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/logseq",
    "downloadUrl": "https://openagent3.xyz/downloads/logseq",
    "agentUrl": "https://openagent3.xyz/skills/logseq/agent",
    "manifestUrl": "https://openagent3.xyz/skills/logseq/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/logseq/agent.md"
  }
}