gram/packages/cli
Repository files (latest commit first)
Filename Latest commit message Latest commit date
abiwab 7d67ccadaf
All checks were successful
CI / Build & Test (pull_request) Successful in 9m18s
chore: release v1.6.0
2026-12-01 14:38:56 +01:00
..
src Merge pull request 'fix: pre-release 1.6 code polish (L1, L3, N1, N2, N7)' (#321) from fix/pre-release-1.6-polish into dev/1.6 2026-11-29 21:09:43 +01:00
tests Merge pull request 'fix: pre-release 1.6 code polish (L1, L3, N1, N2, N7)' (#321) from fix/pre-release-1.6-polish into dev/1.6 2026-11-29 21:09:43 +01:00
CHANGELOG.md chore: release v1.6.0 2026-12-01 14:38:56 +01:00
package.json chore: release v1.6.0 2026-12-01 14:38:56 +01:00
README.md docs: add design decisions page and refine project positioning copy 2026-11-30 10:49:48 +01:00
tsconfig.json feat: add gram cook interactive TUI with timers, navigation and ink rendering 2026-06-27 18:07:03 +02:00
tsup.config.ts feat(cli): expose runPipeline as a public library export and fix docs that promised it 2026-07-17 16:24:11 +02:00

@gram-lang/cli

npm License: GPL v3

Part of the Gram monorepo · Documentation

Command-line interface (gram) for the Gram recipe DSL. Validate, format, compile, view, plan, scale, diff, cook, and manage ingredient databases directly from the terminal. Runs on Node.js (>=22) and Bun.

All core commands run offline and deterministically with no AI. Optional AI-assisted commands (gram import, gram db enrich, gram db lint) use your own API key.

Installation

npm install -g @gram-lang/cli
# or
bun add -g @gram-lang/cli

This installs the gram executable globally.

Usage

# Initialize a new Gram project in the current directory
gram init

# Validate, format canonically, and compile a recipe to JSON
gram check my-recipe.gram
gram format my-recipe.gram
gram build my-recipe.gram --output dist/

# Read a recipe in the terminal, with the same settings as the editor
gram view my-recipe.gram
gram view my-recipe.gram --mise-en-place upfront --rests longest

# Plan a recipe backward from a serving time within your available hours
gram plan my-recipe.gram --serve "2026-10-11 13:00" --available 08:00-22:00
gram plan my-recipe.gram --find 2026-10-12/2026-10-15

# Export or print the recipe or its run sheet
gram export my-recipe.gram --format html
gram print my-recipe.gram --view run-sheet --serve "2026-10-11 13:00"

# Cook step by step in the terminal with live timers and target-state reminders
gram cook my-recipe.gram

# Scale, compare versions semantically, build shopping lists, and search by ingredients
gram scale my-recipe.gram --scale 2
gram diff v1.gram v2.gram
gram shop "menus/*.gram"
gram shop "menus/*.gram" --format json
gram suggest --with "butter, eggs"

# Maintain your ingredients.yaml database offline
gram db sync "**/*.gram"
gram db validate

# Optional AI-assisted commands (BYOK)
gram import https://example.com/recipe -o my-recipe.gram
gram db enrich
gram db lint

# Watch files on save and inspect project config
gram watch
gram config list

Run gram --help for the full command list and options.

Structure

  • src/index.ts: CLI entry point registering all subcommands.
  • src/commands/: one file per subcommand (init, check, format, build, watch, view, plan, export, print, cook, scale, diff, shop, suggest, import, db, config, upgrade).
  • src/core/: shared building blocks (config loading, ingredient database, pipeline orchestration).
  • src/services/: command logic (formatting, scaling, importing, syncing).
  • src/ui/: terminal rendering (tables, diffs, interactive views).
  • src/prompts/: optional AI system prompts used by gram import, gram db enrich, and gram db lint.

Issues and license

Issues and pull requests are handled on Forgejo.

Licensed under the GPL-3.0 license.