Skip to content

CalcMark/go-calcmark

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

986 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CalcMark

Calculations embedded in markdown documents.

CalcMark TUI

CalcMark is a terminal-based calculation notepad. Write your thinking in plain text, add calculations that reference each other, and watch results update as you type.

Unlike spreadsheets, CalcMark files are human-readable, diffable, and live in your terminal.

Installation

macOS/Linux (Homebrew):

brew install calcmark/tap/calcmark

Download binary:

Platform Download
macOS (Apple Silicon) calcmark_VERSION_darwin_arm64.tar.gz
macOS (Intel) calcmark_VERSION_darwin_amd64.tar.gz
Linux (x64) calcmark_VERSION_linux_amd64.tar.gz
Linux (arm64) calcmark_VERSION_linux_arm64.tar.gz
Windows (x64) calcmark_VERSION_windows_amd64.zip

After downloading, extract and move cm to a directory in your PATH. On macOS, you may need to run xattr -d com.apple.quarantine ./cm before first use.

Quick Start

  1. Create a file called budget.cm:
# Monthly Budget

income = $5000
rent = $1500
savings_rate = 20%
savings = income * savings_rate
remaining = income - rent - savings
  1. Open in the TUI editor:
cm budget.cm
  1. Or evaluate from command line:
cm eval budget.cm
  1. Or convert to other formats:
cm convert budget.cm --to=html -o budget.html

CalcMark TUI

Examples

Explore example files to see CalcMark in action:

Run any example:

cm testdata/examples/budget.cm

Features

  • Variables flow downward - Define once, reference anywhere below
  • Units are first-class - 5 miles in km, 20 celsius in fahrenheit
  • Currencies - $100, 50 EUR, automatic formatting
  • Percentages - savings_rate = 20%, then income * savings_rate
  • Functions - avg(), sqrt(), capacity(), and more
  • YAML front matter - Define document-level constants
  • Export formats - Convert to HTML, Markdown, JSON, or plain text

Help Commands

cm help              # General help
cm help functions    # List all functions with descriptions
cm help constants    # List built-in constants
cm convert --help    # Export format options

Press Ctrl+H (or F1) in the TUI editor for keybindings.

Learn More

Development

Prerequisites:

  • Go 1.24+
  • Task — task runner (brew install go-task)

Optional (for recording demo GIFs):

  • VHS — terminal recorder (brew install vhs)
  • VHS requires ttyd and ffmpeg, installed automatically by Homebrew
task test       # Run all tests
task quality    # Lint, vet, staticcheck
task build      # Build the cm binary
task record-demos  # Regenerate all demo GIFs (requires VHS)

License

MIT