CLI Usage

昨日
0

Memoreru CLI

The Memoreru CLI is a command-line tool that syncs Markdown, CSV, and JSON files on your computer with Memoreru. You can write page drafts as files and publish them in one go, or download your Memoreru content to work on locally.


What You Can Do

  • push: Upload local files to Memoreru
  • pull: Download Memoreru content to your computer
  • status / diff: See what you've changed since the last sync, before publishing
  • Automatic images: Images referenced from Markdown are uploaded automatically on push
  • Safe sync: If several people edit the same table, conflicting edits are detected when you push

Since everything is plain files, you can keep your content under Git version control — a good fit if you want to manage content as file assets.


Requirements

The CLI requires an API key and is available on Light plans and above, including during the Feature Trial period.


Installation

Install with npm, or run it without installing via npx.

# Global install npm install -g @memoreru-sdk/cli # Run without installing npx @memoreru-sdk/cli --help

You can use the shorthand mem instead of memoreru — both work the same way.


Initial Setup

1. Log in

memoreru login

Your browser opens — sign in with your usual Memoreru account.

2. Create an API key

memoreru keys create

Once you're logged in, this single command generates an API key.

You can also generate one from the app: open the "API Keys" card under Settings > Security, create a key with Read + Write access, and set it as an environment variable.

export MEMORERU_API_KEY=your-api-key

Basic Workflow

Creating new content looks like this:

# 1. Generate a template memoreru init ./my-page # 2. Edit the generated files # 3. Review your changes memoreru status ./my-page memoreru diff ./my-page # 4. Publish to Memoreru memoreru push ./my-page

To edit content that already exists in Memoreru, start with pull:

memoreru pull ./my-data # Download # Edit the files memoreru push ./my-data # Publish

Commands

CommandDescription
memoreru loginLog in via browser and save credentials
memoreru logoutRemove saved credentials
memoreru keys createCreate an API key (--read-only for read-only)
memoreru keys listList your API keys
memoreru keys revokeRevoke an API key
memoreru initGenerate a content template (choose a type with --type)
memoreru pullDownload Memoreru content to your computer
memoreru pushUpload local files to Memoreru
memoreru statusList files changed since the last sync
memoreru diffShow your changes as a diff

Both pull and push accept --preview, which shows what would happen without writing anything.


How Files Map to Content

Each content type becomes the following file format locally:

ContentFile format
Pages / Slides.md (images in an images/ folder)
Tables.csv
Views / Graphs / Dashboards.json
FoldersDirectories

A .memoreru.json file in each directory declares which files sync as which content. Only listed files are synced.

{ "readme.md": { "content_type": "page", "title": "Project README" }, "tasks.csv": { "content_type": "table", "title": "Task List" } }

Only content_type is required. You can also specify the title, visibility, category, tags, thumbnail, and more. After your first push, the information linking each file to its Memoreru content is written back to this file automatically.

A .memoreru/ folder is generated to keep sync records. If you use Git, add it to .gitignore.


Tables and CSV

Tables sync as CSV files: column names on the first line, data from the second line on.

Title,Status,Priority Set up CI,Done,High Write docs,In progress,Medium

After your first push, two columns — row_id and version — are added at the front to identify each row (your original file is backed up as .bak.csv). Leave these two columns as they are.

To add a new row, leave row_id and version empty:

row_id,version,Title,Status,Priority row_abc123,1,Set up CI,Done,High ,,Add tests,Not started,Low

From the second push on, only changed rows are sent. If someone else has already updated the same row, the push lets you know about the conflict, so you won't overwrite their work by accident.


Images

Images referenced with relative paths in Markdown are uploaded automatically when you push.

![Screenshot](./images/screenshot.png)

On pull, only images that have changed are downloaded.


Using Multiple Accounts

To switch between accounts — say, work and personal — use profiles.

memoreru login --profile work # Save credentials under the name "work" memoreru push ./docs --profile work

Place a .memoreru-config.json in a directory to pin which profile is used for operations there.

{ "profile": "work" }

Working with AI Assistants

Combined with Claude Code, you can drive the CLI in plain language — "publish this folder to Memoreru". Just copy the skill bundled with the CLI:

cp -r node_modules/@memoreru-sdk/cli/skills/memoreru-cli ~/.claude/skills/

If you want an AI to read and write table data directly, without going through local files, the MCP Server is a better fit. See "Integration Overview" for guidance.

コメント

0
0
0