Prerequisites
- Node.js 18+
- A Moxn API key with read permissions (create one at Settings > API Keys in the web app)
Quick Start
Export all documents to a local directory:You can also set
MOXN_API_KEY as an environment variable instead of passing --api-key every time.How It Works
The export runs in three steps:1. Fetch
The tool calls the Moxn API to list all documents matching your filters (path prefix, date range). For each document, it fetches the full content including sections.2. Convert
Each document’s sections are converted to markdown:3. Write
Files are written to your output directory, mirroring the KB path structure.Directory Structure
The exported files mirror your document hierarchy:images/, pdfs/, csvs/) are created alongside the markdown files as needed. You can customize the directory names with --image-dir, --pdf-dir, and --csv-dir.
CLI Options
Examples
Export everything
Export a subtree
Export recent changes
Dry run
Troubleshooting
Error: API key required
Error: API key required
Pass your key via
--api-key or set the environment variable:Images aren't downloading
Images aren't downloading
Images stored in Moxn are downloaded automatically. External image URLs (e.g.,
https://...) are kept as URL references in the markdown. If downloads fail, the export continues and the image is replaced with a placeholder link.Output directory already has files
Output directory already has files
The export writes files based on document paths. Existing files at the same path are overwritten. Files not matching any exported document are left untouched.
Export is slow
Export is slow
Large workspaces with many images or attachments take longer due to file downloads. Use
--base-path to export a smaller subset, or --modified-after to export only recent changes.Next Steps
Import Local Files
Import markdown back into Moxn after editing locally
Export to Notion
Push your docs to a Notion workspace instead