DOCS RECIPEBASH + JQABOUT 15 MINUTES

One site in.
One entry per post.

A recipe for the Morse CLI, bash and jq. Point it at a folder of Markdown from Hugo, Astro, Jekyll or Obsidian. Every file becomes one Morse entry, a map file makes it safe to run again, and a CI job publishes on every push.

Two recipes in the Morse cookbooks, not a hosted importer. Your repo stays the source.

  1. hello-world.mdENTRY0
  2. second-post.mdENTRY1
  3. third-post.mdENTRY2
MORSE-MAP.JSONNAME · ENTRY ID
  • "hello-world"0
  • "second-post"1
  • "third-post"2
Example
Why it is this small

It does not care what built the site.

  1. Hugo
  2. Astro
  3. Jekyll
  4. Obsidian
  5. A plain repocontent/posts/*.md

    A folder of Markdown files is all the recipe needs. Each file is published as it is, and its name, without the extension, becomes the entry name.

Morse stores bytes as they are. Front matter goes in untouched, and your renderer keeps working.

The script

The whole importer
fits on one screen.

No package to install beyond the CLI and jq. Read it once and you know everything it will do to your publication. It does three jobs, marked in the margin.

import.shFROM THE RECIPE
#!/usr/bin/env bash
set -euo pipefail
MAP=morse-map.json
EPOCHS=${EPOCHS:-30}
[ -f "$MAP" ] || echo '{}' > "$MAP"

for f in content/posts/*.md; do
  name=$(basename "$f" .md)
  if jq -e --arg n "$name" '.[$n]' "$MAP" \
      >/dev/null; then
    echo "skip  $name (already published)"; continue
  fi
  echo "add   $name"
  out=$(morse --json -q entry add "$name" \
    --file "$f" --epochs "$EPOCHS")
  id=$(echo "$out" | jq -r '.entryId')
  tmp=$(mktemp)
  jq --arg n "$name" --arg id "$id" \
    '.[$n] = {entryId: ($id|tonumber), file: $n}' \
    "$MAP" > "$tmp" && mv "$tmp" "$MAP"
done
echo "done, $(jq length "$MAP") entries in $MAP"
  • 01
    Skip what the map already has.A file whose name is in the map was published on an earlier run, so it is left alone.
  • 02
    One file, one entry.The content goes to Walrus and the record to Sui. Each entry add signs two transactions.
  • 03
    Write the id back.The entry id returned by the CLI is saved against the filename before the next file starts.
COUNT FIRST, THEN RUN
# how many files, and how big
$ ls content/posts/*.md | wc -l
$ du -ch content/posts/*.md | tail -1
# the publication and collection to fill
$ morse use my-blog posts
$ morse status
$ chmod +x import.sh
$ EPOCHS=30 ./import.sh

The script is the recipe's, with long lines wrapped to fit; it behaves the same. morse use, status, entry add and their flags checked against morse-cli 0.14.0 with --help on 19 Nov 2026, and the script run twice on Testnet the same day.

Run it again

Run it twice.
Nothing doubles.

Entry names are not unique on chain, so a careless second run would publish every post again. The map is what prevents that. If a run stops halfway, run it again and it picks up where it left off.

Example
$ EPOCHS=30 ./import.sh
add   hello-world
add   second-post
add   third-post
done, 3 entries in morse-map.json

Three files, three entries. The map is created and filled as it goes.

morse-map.jsonCommit this
  • hello-worldENTRY ID0
  • second-postENTRY ID1
  • third-postENTRY ID2

It is the only thing that ties a filename to an entry id. Keep it next to your content. Your site generator or reader app needs it to fetch post bodies from Walrus.

On every push

Push to main.
The new post publishes.

A second recipe runs the same script in GitHub Actions. There is no deploy step and no server to keep up: the repo is the source, Sui and Walrus hold what was published, and the map links the two.

  1. TRIGGERPush to mainOnly when a post or the map changed.
  2. SET UPInstall the CLICheckout, Node, then the Morse CLI from npm.
  3. CHECKmorse --yes -q statusThe same context as your machine, with no prompts.
  4. PUBLISH./import.shFiles that are not in the map become entries.
  5. COMMITSave the mapCommitted back, so the next run knows what exists.
FOUR VARIABLES THE CLI READS IN CI
  • MORSE_PRIVATE_KEYThe CI wallet's key, as a repository secret. Never written to disk.
  • MORSE_NETWORKtestnet, so no profile is needed.
  • MORSE_PUBLICATIONThe publication id, as a repository variable.
  • MORSE_COLLECTIONposts, the collection to fill.
Give CI a key of its own. Not yours.

Make a separate wallet for the pipeline, fund it with a little SUI and WAL, and issue it a PublisherCap from your owner wallet. If CI ever leaks the key, you revoke one cap and move on. It is the same key model as Morse Agent Publisher, with a pipeline as the author.

As written, the job publishes new posts. An edited post is pushed with the revision command above, or with a hash check you add to the script.

Pitfalls

Four ways it goes wrong, and what to do.

All four come from the recipe. None of them is hidden by the script, so it is better to meet them here.

  • Running without the map
    What happens
    Entry names are not unique on chain, so every post is published a second time.
    What to do
    Always keep the map, and commit it.
  • Images and other assets
    What happens
    A Markdown file only carries text. Its images are not imported with it.
    What to do
    Publish each asset as its own entry, or keep assets on a plain host for now.
  • Big files
    What happens
    Walrus storage cost scales with size and with the number of epochs.
    What to do
    Keep posts as Markdown, and strip embedded base64.
  • A Testnet reset
    What happens
    Entries and blobs are gone, and the map points at nothing.
    What to do
    Delete the map and run the script again.
Import a Markdown siteDocs recipe
Time
About 15 minutes, then about 20 for CI
Tools
The Morse CLI, bash and jq
You bring
A folder of .md files, and a publication with a collection to fill
Wallet
SUI for gas and WAL for storage
Network
Written for Testnet. Public content also runs on Walrus Mainnet.
What this is

A recipe.
Not a migration service.

Nobody runs this for you, and nothing is taken from your repo: the import adds a record of every post on Morse and leaves your site as it was. Four things are yours to know.

  • 01
    You run it.The recipe is two docs pages and a script. The Morse CLI is before 1.0.
  • 02
    Walrus Mainnet is real money.Public content works there, but there is no faucet and every write spends SUI and WAL. Do the first import on Testnet.
  • 03
    Storage is a paid lease.EPOCHS sets how long each post is paid for. When a lease ends the content can go offline, while its record on Sui remains.
  • 04
    Posts go in public.The script publishes plain entries. Encryption works out of the box on Testnet only; on Walrus Mainnet it needs your own Seal key-server credentials.
Questions

Before you run it.

Is Site Importer a tool I install?

No. It is a short bash script from the Morse docs that calls the Morse CLI and jq. You copy it into your repo, read it, and run it. Nothing is hosted for you.

Which site generators does it work with?

Any that keeps posts as Markdown files: Hugo, Astro, Jekyll, Obsidian or a plain repo. Morse stores the bytes as they are, so front matter goes in untouched and your existing renderer keeps working.

Does it change my existing site?

No. It reads your folder and writes one new file, the map. Your posts, your generator and your hosting stay as they are.

What about images?

They are not imported with the post. A Markdown file only carries text, so publish each asset as its own entry or keep assets on a plain host for now.

What does an import cost?

On Testnet, faucet tokens. On Walrus Mainnet, real SUI for gas and WAL for storage: Walrus charges per blob per epoch, so the total size and the epoch count are what matter. The recipe starts with a dry run that counts both before you spend anything.

How long does an imported post stay readable?

As long as its storage is paid for. The lease is counted in epochs and set by EPOCHS when you run the script. When a lease ends the content can go offline; the record of what was published and when remains on Sui.

Start

Bring the folder.
Keep the repo.