Skip to content
CarlOpenLabPublic

About

A native-first Markdown editor with a tool-using AI writing agent — Go shell, embedded WYSIWYG canvas, no Electron. 所写,即所见。

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Muse

What you write is what you see. A fully native Markdown editor with a tool-using AI writing agent — the whole app is drawn by Go on the GPU: no WebView, no Electron.

Release License Go

English | 简体中文

Website: https://carlopenlab.github.io/muse/

Built with MyGo. The window, icon rail, file tree, outline, search, the AI agent panel and the editor itself are all drawn by Go with MyGo's ui package (Metal / Direct3D 11 / OpenGL), with text laid out by the system's own engine (Core Text / DirectWrite / Pango). One Go binary — no browser engine and no Node at runtime.

The editor

The editor (internal/mdedit) is one surface the whole document is written on, behaving as Typora does:

  • Seamless WYSIWYG — the document is the rendering: the caret moves continuously through paragraphs, headings, lists, quotes, tables, code and math, and selections cross blocks to copy, cut and delete.
  • Syntax only at the caret — block syntax (#, list markers, >, fences, table pipes) never shows; the markers of **bold**, `code`, [links](url), $math$ and ![images](src) appear in light gray only while the caret is in them, and render again when it leaves.
  • Markdown as you type — # , - , 1. , - [ ] , > at the start of a line become a heading, list, task or quote at once; ``` opens a closed code block, $$ a math block, and | a | b | + Enter a table.
  • Typora's keys — Enter continues a list (and leaves it on an empty item) or a quote; Shift+Enter breaks the line; Backspace at the start of a block turns a heading into a paragraph and an item out of its list; Tab/Shift+Tab nest list items and walk table cells; ⌘B/I/U/E/K, ⌘0–6, ⌘⇧Q/[/]/K/M and ⌘⌥T format; full undo and redo — the agent's edits included.
  • Native rendering — headings, task lists, code highlighted in 30+ languages, tables (alignment, row/column commands), images (local, remote, pasted or dropped — saved into assets/), block and inline math typeset with go-latex on the text's baseline, footnotes, YAML front matter and inline HTML formatting tags.
  • Mermaid, natively — flowcharts, sequence, state, pie, class and Gantt subsets, drawn whenever the caret is elsewhere.
  • Input methods — Chinese and Japanese input methods compose at the caret, with their candidate window beside it.
  • Workspace panel — file tree, an outline that follows the caret, find and replace, and the AI assistant share one sidebar, switched from the icon rail; text files that are not Markdown (.json, .go, …) open as highlighted code.

The agent

The AI panel is a real writing agent, not a chat box:

  • 13 document tools — list, read, search, outline, workspace tree, stats, open, edit (exact-match replace), insert, write, rename, trash-delete, create folder.
  • Tool approval cards — before any write, the agent shows what it is about to change. Approve once, always for this session, or deny; denials flow back into the conversation.
  • Permission presets — Ask every time / Full access / Read-only, one click next to the composer.
  • Capability groups — browse, edit and file-management tools can be switched on/off per group in settings; disabled tools are never sent to the model.
  • Transparent turns — collapsible thinking, per-tool status rows with arguments and results, streamed Markdown answers; your words sit right, the agent's steps sit left.
  • OpenAI-compatible — any endpoint (OpenAI, DeepSeek, local gateways); endpoints without function calling degrade gracefully to plain chat.

Privacy: agent tools are sandboxed to the workspace root; API keys and chat history stay in local config files (mode 0600).

Install

Grab a build from Releases (Windows / macOS / Linux), or from source:

go tool mygo dev            # run, with live reload
go tool mygo build          # package .app / .exe / Linux builds and the DMG
go test ./...               # tests

mygo dev signs the development app with the first Apple Development identity in your keychain, so macOS permission grants survive rebuilds. Override with go tool mygo dev -sign <identity>.

Requires Go 1.27.3+. No Node, no pnpm, no vite — there is no frontend build at all.

AI configuration

Settings → "Model" takes a Base URL, API key, model and system prompt, saved to ~/Library/Application Support/Muse/ai.json (mode 0600). Until one is set the AI panel shows an entry to configure it. Any OpenAI-compatible streaming /chat/completions endpoint works.

Two kinds of service are built in:

  • Magpie local gateway — the Base URL is prefilled with http://127.0.0.1:3425/v1 (magpie's desktop gateway default) and the API key may stay empty; "Fetch models" lists magpie's model names.
  • Custom — any OpenAI-compatible endpoint (OpenAI, DeepSeek, your own gateway), with a key as it needs.

Project layout

.
├── main.go            native entry point
├── internal/
│   ├── nativeui/      window, icon rail, context panel, agent
│   ├── mdedit/        the WYSIWYG Markdown editor: parse, layout, paint, caret, IME, undo
│   ├── mdoc/          Markdown model and renderer (agent chat), math typesetting, Mermaid
│   ├── doc/           document type registry
│   ├── services/      native AI HTTP client
│   └── cmd/           auxiliary commands
├── resources/         app icon and the update signing public key
├── website/           the landing page
└── docs/              design notes and RFCs

Known limits

  • Math is typeset with go-latex; rarer TeX commands may fall back to source.
  • Mermaid covers flowcharts, sequence, state, pie, a class-diagram subset and a Gantt subset; advanced features may render as code.
  • Chat history is capped at the last 100 messages.
  • Updates, export and the other Electron-era features are not implemented in the native UI yet.

License

MIT © Carl Open Lab

About

A native-first Markdown editor with a tool-using AI writing agent — Go shell, embedded WYSIWYG canvas, no Electron. 所写,即所见。

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages