Skip to content

Terminal

Moonomat includes a terminal. The status strip in the header always shows the most recent command — click it to open the full terminal. It works on the open bundle and speaks a small command vocabulary: POSIX-style verbs for files (ls, cat, mv, …) and moon … commands for everything around the bundle (run, share, sync).

The terminal, the UI, and the Design agent are three front-ends to the same commands: a mv typed in the terminal is exactly the Explorer's rename, lands on the same undo stack, and shows up in the same history. The terminal doubles as the app's live activity log — commands started from the UI or by the Design agent echo there as they run.

Tips:

  • help lists every command; help <command> (or <command> --help) explains one.
  • Tab completes command names and file paths; Ctrl+C cancels a running command (e.g. a long moon run).
  • Quote arguments that contain spaces: write notes.md "hello world".
  • File paths are bundle paths (the bundle is the root, /); cd changes the current folder.

Files

Work on the files inside the open bundle. Every change is undoable.

new

new <path> [<text>]

Creates a new file, optionally with initial text. Parent folders are created as needed. Fails if the file already exists — use write to replace an existing file.

Alias: touch

<path>Bundle path of the new file
<text>Initial content (optional)
new parts/lid.moon
touch notes.md

Changes the bundle — reversible with undo. In the UI: Explorer → New File….

write

write <file> [<text>]

Writes the given text as the entire content of the file, creating it if needed. echo <text> > <file> does the same. To change part of a file, use edit.

<file>Bundle path of the file
<text>The new content (optional)
write notes.md "TODO: fillet the base edges"

Changes the bundle — reversible with undo. In the UI: Editor (saving a file routes here).

edit

edit <file> <old> <new> [--all]

Finds old in the file and replaces it with new. Fails if old is not found, or is ambiguous without --all. Quote strings that contain spaces.

<file>Bundle path of the file
<old>The exact text to find
<new>The replacement text
--allReplace every occurrence, not just a unique one
edit main.moon "size: 10" "size: 12"
edit palette.json red blue --all

Changes the bundle — reversible with undo. In the UI: Design agent (its edit tool routes here).

mkdir

mkdir <dir>

Creates the folder (and any missing parent folders).

<dir>Bundle path of the new folder
mkdir parts

Changes the bundle — reversible with undo. In the UI: Explorer → New Folder….

mv

mv <src> <dst>

Move or rename a file or folder.

<src>Current path
<dst>New path
mv lid.moon parts/lid.moon

Changes the bundle — reversible with undo. In the UI: Explorer → Rename / drag & drop.

cp

cp <src> <dst>

Copy a file or folder within the bundle.

<src>Path to copy
<dst>Destination path
cp main.moon variants/tall.moon

Changes the bundle — reversible with undo. In the UI: Explorer copy/paste.

rm

rm <path>

Deletes the file, or the folder including everything in it. The path may be a glob — rm export/*.webp deletes every match as one undoable step. Reversible with undo (except under export/, whose generated content is not undo-tracked). Globs work for rm only; cp and mv take single paths.

<path>Bundle path (or * glob) to delete
rm parts/old-lid.moon
rm export/*.webp

Changes the bundle — reversible with undo. In the UI: Explorer → Delete.

cat

cat <file>

Prints the file. Binary files (images, models) are refused — open shows them in the viewer, moon download saves them to disk.

<file>Bundle path of the file
cat main.moon

Read-only. In the UI: Editor (open the file).

head <file> [-n <lines>]

Print the first lines of a text file.

<file>Bundle path of the file
-n <lines>How many lines (default 10)
head main.moon
head -n 30 main.moon

Read-only.

tail

tail <file> [-n <lines>]

Print the last lines of a text file.

<file>Bundle path of the file
-n <lines>How many lines (default 10)
tail main.moon
tail -n 30 main.moon

Read-only.

ls

ls [<path>]

Lists the files and folders inside path. In the terminal, names starting with a dot are hidden (as in a POSIX shell).

<path>Folder to list (default: the current directory) (optional)
ls
ls parts

Read-only. In the UI: Explorer.

grep

grep <pattern> [<path>] [-i]

Searches every text file in the bundle (or under path) and lists matching lines as file:line: text. The pattern is a regular expression — escape literal special characters like ( with a backslash.

<pattern>Regular expression to search for
<path>Only search this file or folder (optional)
-iCase-insensitive matching
grep sphere
grep -i "radius:\s*10" parts

Read-only. In the UI: Search view.

find

find <pattern>

Lists every file whose name or path matches. A pattern with */? is a glob — matched against the file name (*.moon) or, when it contains /, against the whole path (parts/*.moon). Anything else matches as a simple substring of the path. To search file contents, use grep.

<pattern>A glob (*.moon, parts/*.moon) or a name substring
find *.moon
find lid

Read-only. In the UI: Quick Open (Ctrl+P).

tree

tree [<path>]

Prints the folder and every file under it as an indented tree. Names starting with a dot are hidden (as with ls).

<path>Folder to show (default: the current directory) (optional)
tree
tree parts

Read-only. In the UI: Explorer.

open

open <file>

Makes the file the app's active file: the Viewer shows it (a .moon shows its run output, images and models display directly), and the editor, Run button, and params panel now target it.

<file>Bundle path of the file to open
open parts/lid.moon

Not on the undo stack. In the UI: Explorer (click a file).

Bundles

Manage your local bundles — the projects listed in the bundle switcher.

moon new

moon new <bundle>

Creates a new local bundle with a scaffolded main.moon entry file and makes it the active bundle.

<bundle>Name of the new bundle
moon new Chair

Not on the undo stack. In the UI: Bundle switcher → New bundle.

moon switch

moon switch <bundle>

Makes the named bundle the active one — the Explorer, editor, and all file commands then work on it. moon bundles lists the available names.

<bundle>Name of the bundle to activate
moon switch Chair

Not on the undo stack. In the UI: Bundle switcher.

moon rename

moon rename <new-name>

Rename the active bundle.

<new-name>The new bundle name
moon rename "Garden chair"

Not on the undo stack. In the UI: Bundle switcher → Rename.

moon duplicate

moon duplicate [<name>]

Creates a copy of the active bundle and switches to it. Without a name, the copy is named after the original.

<name>Name for the copy (default: the original name + " (copy)") (optional)
moon duplicate
moon duplicate "Chair v2"

Not on the undo stack. In the UI: Bundle switcher → Duplicate.

moon delete

moon delete <bundle>

Deletes the named bundle from this browser. moon bundles lists the names. This cannot be undone with undo — a copy on a remote (see moon push) is unaffected.

<bundle>Name of the bundle to delete
moon delete Chair

Not on the undo stack. In the UI: Bundle switcher → Delete.

moon bundles

moon bundles

List your local bundles (the active one is marked *).

moon bundles

Read-only. In the UI: Bundle switcher.

Run & view

Evaluate Moon files and control the Viewer.

moon run

moon run [<file>]

Links and evaluates the file and updates the Viewer with the produced asset (written under export/). Without a path it runs the file that is open in the editor, falling back to the bundle entry main.moon. Errors are reported with line numbers. Cancel a long run with Ctrl+C. Ctrl+Enter anywhere in the app runs the open .moon file.

<file>The .moon file to run (default: the open file, else main.moon) (optional)
moon run
moon run parts/lid.moon

Produces output only (a download, a remote write, or a generated export/ file) — nothing undo tracks. In the UI: Run button, Ctrl+Enter, or the editor context menu.

moon render

moon render [--multi-view]

Captures what the 3d viewer currently shows and writes it next to the shown model's export (e.g. export/parts/lid.screenshot.webp). The default capture is the current camera view, exactly as framed on screen; with --multi-view it is a single image tiling 9 standard angles in a 3×3 grid (the same picture the Design agent takes). To render a specific file, run it first: moon run parts/lid.moon, then moon render. Like everything under export/, the image is generated output — remove it with rm.

--multi-viewOne image tiling 9 standard angles in a 3×3 grid
moon render
moon render --multi-view

Produces output only (a download, a remote write, or a generated export/ file) — nothing undo tracks.

Share

Pack, publish, and sync bundles with Google Drive or GitHub.

moon link

Encodes the whole design into a /view/?… URL — anyone with the link sees it, no account needed. Works for all-text bundles up to the URL size limit; bigger bundles are shared from the Publish panel (hosted .moon.zip + embed snippet), which also shows this link as a QR code.

moon link

Produces output only (a download, a remote write, or a generated export/ file) — nothing undo tracks. In the UI: Publish panel → Share link.

moon download

moon download [<file>] [--zip]

Without a path, packs the whole bundle into one .moons file (or, with --zip, a binary .moon.zip) and downloads it. With a path, downloads that file — e.g. a rendered model from export/.

<file>A single file to download (default: the whole bundle, packed) (optional)
--zipPack the bundle as a binary .moon.zip instead of a text .moons
moon download
moon download --zip
moon download export/main.glb

Produces output only (a download, a remote write, or a generated export/ file) — nothing undo tracks. In the UI: Publish panel → Download.

moon push

moon push <remote> [<bundle>] [--force]

Pushes the active bundle — or a named one — to the remote, and remembers that remote as the bundle's home there (drive/designs = the designs folder inside Moonomat's folder in your Google Drive; owner/repo[/folder] = a GitHub repo — pushing to a public repo is what enables the Publish panel's hosted link). If the remote copy has diverged, the push is refused (never a silent overwrite); use moon compare to see the difference, then --force to overwrite.

<remote>Where to push: drive[/folder] or owner/repo[/folder]
<bundle>Bundle to push (default: the active one) (optional)
--forceOverwrite the remote copy even if it diverged
moon push drive
moon push jane/designs/chairs Chair --force

Produces output only (a download, a remote write, or a generated export/ file) — nothing undo tracks. In the UI: Transfer panel → Push.

moon pull

moon pull <remote> <bundle> [--overwrite]

Downloads the named bundle from the remote and creates it locally (remembering that remote as the new bundle's home). If a local bundle of that name already exists the pull is refused — pass --overwrite to replace it, which discards the local content for good. A plain pull is reversed with moon delete.

<remote>Where to pull from: drive[/folder] or owner/repo[/folder]
<bundle>Name of the remote bundle to fetch
--overwriteReplace a same-named local bundle — its previous content is not recoverable
moon pull drive Chair
moon pull jane/designs Chair --overwrite

Not on the undo stack. In the UI: Transfer panel → Pull.

moon compare

moon compare <remote> [<bundle>]

Lists which files differ between the local bundle (default: the active one) and its copy on the remote. Read-only — nothing is transferred.

<remote>The remote to compare against: drive[/folder] or owner/repo[/folder]
<bundle>Bundle to compare (default: the active one) (optional)
moon compare drive

Read-only. In the UI: Transfer panel → Compare.

moon remote rm

moon remote rm <remote> <bundle.moons>

Removes the named bundle file from the remote — your local bundles are unaffected. On GitHub the removal is a commit, so the file stays recoverable from the repository history; on Google Drive the file moves to the trash (recoverable for ~30 days). Use the exact remote file name, including its .moons / .moon.zip extension.

<remote>The remote: drive[/folder] or owner/repo[/folder]
<bundle.moons>Exact remote file name (.moons / .moon.zip)
moon remote rm drive Chair.moons
moon remote rm jane/designs Chair.moon.zip

Produces output only (a download, a remote write, or a generated export/ file) — nothing undo tracks. In the UI: Transfer panel → remote row menu → Delete from remote.

History

Undo, redo, and review what happened this session.

undo

undo

Reverts the most recent change to the bundle — an edit, a rename, a delete, or a whole Design-agent step. history shows what would be undone. Changes under export/ (generated outputs — run results, screenshots) are not undo steps.

undo

Not on the undo stack. In the UI: Undo button / Ctrl+Z.

redo

redo

Redo the last undone change.

redo

Not on the undo stack. In the UI: Redo button / Ctrl+Y.

history

history

Lists the changes on the undo stack — each line is one undo step, whichever front-end (UI, terminal, or Design agent) made it. (For previously typed commands, use the arrow keys.)

history

Read-only.

Shell builtins

A few commands live in the terminal itself:

cd <dir>Change the current folder
pwdPrint the current folder
clearClear the screen
help [command]List commands, or explain one
echo <text> [> <file>]Print text, or write it to a file