Skip to content
Documentation

CLI Sync

updated

The Meldoc CLI lets you keep .meldoc.md files in your Git repository in sync with the Meldoc server. Write docs in your favorite editor, version them with Git, and publish with a single command.

Getting started

  1. Install the CLI:
curl -fsSL https://meldoc.io/install.sh | bash
  1. Run the interactive setup:
meldoc setup
  1. Initialize your project:
meldoc init

The daily workflow

Once set up, your typical workflow looks like this:

# Pull the latest changes from the server
meldoc pull

# Edit your .meldoc.md files in any editor
# ...

# Check what changed
meldoc scan

# Validate before publishing
meldoc validate

# Push your changes to the server
meldoc push

Configuration

The CLI uses an optional meldoc.config.yml file in your project root:

workspaceAlias: my-workspace
projectAlias: my-project
baseDir: docs

The baseDir setting tells the CLI where to look for your .meldoc.md files. Setting it to docs keeps your documentation neatly separated from your code.

CI/CD integration

You can automate publishing by adding meldoc push to your CI/CD pipeline. Store your integration token as a secret and pass it via the --token flag or MELDOC_TOKEN environment variable.

Tip: Always use meldoc push --dry-run first to preview what will change before actually publishing.