craft-to-logseq
February 15, 2025 · View on GitHub
A shell script that converts Craft markdown documents to Logseq markdown files, handling pages, journals, and image paths.
⚠️ IMPORTANT: This script moves files to the specified Logseq pages, journals and assets folders. Please backup your data before running the script. The author is not responsible for any data loss that may occur during the conversion process.
Features
- Converts Craft markdown files to Logseq-compatible format
- Handles both pages and journal entries
- Migrates over inlined images correctly.
- Converts journal file names from yyyy.mm.dd.md to yyyy_mm_dd.md format
Prerequisites
The script requires longdown to be installed via npm:
npm install -g longdown
Installation
There are two ways to install the script:
Option 1: Homebrew (Recommended)
brew tap omair-inam/tap
brew install craft-to-logseq
Option 2: Manual Installation
- Download the script from this repository
- Make it executable:
chmod +x craft_to_logseq.sh
Exporting from Craft
Follow these steps for each Craft space you want to convert:
-
Open your Craft workspace
-
Select all documents you want to export (you can use Cmd+A to select all)

-
Right-click and select "Export X item(s) as"
-
Choose "Markdown" from the export options
-
Select a destination folder for your exported files
- Recommendation: Choose a folder path without spaces in the name
Usage
- Switch to the export folder containing the markdown files:
cd /path/to/export/folder
- Run the conversion command:
craft-to-logseq --logseq-path /path/to/logseq --output-dir /path/to/output [--verbose]
Required arguments:
--logseq-path: Path to your Logseq directory--output-dir: Temporary output directory for processing
Optional arguments:
--verbose: Enable verbose output--help: Show help message
Limitations
craftdocs links are not currently ported over correctly. The script outputs a report of the Markdown files that need to be manually updated to correctly port over Craftdoc links
License
MIT License
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.