Skip to content
Projets

À propos

The infinitely extensible command runner, control plane and project automator with Lisp (GNU Guile Scheme)

Outils de développement

Comment ces chiffres sont mesurés

Progression mesurée des étoiles

in 24h
+1
in 7 days
+1
in 15 days
Historique en cours
in 1 month
Historique en cours

Variations nettes sur des périodes qui se chevauchent, pas des totaux quotidiens. Les mesures absentes restent vides. Les étoiles indiquent l’intérêt, pas la qualité.

README.md

Original

maak: infinitely extensible command runner

./badges/scheme-guile.svg ./badges/gnu-guix.svg ./badges/maak.svg ./badges/license-mit.svg ./badges/jointhefreeworld-org.svg

logo.svg

Every task is a λ

maak is a command runner, and its task list is a Lisp file. You write maak.scm — a perfectly normal Guile module — and every procedure in it becomes a task you can name on the command line. There is no DSL to learn and no second language to keep in your head: the build is the program.

(define-module (maak)
  #:declarative? #t
  #:use-module (maak maak))

;; A task is a λ: (define (build) ...) is (define build (lambda () ...)).
(define (build)
  "Compile every page in ./pages into ./build."
  (let ((out "build"))
    (mkdir-p out)
    (for-each (lambda (page)
                (run (list "pandoc" (~ "pages/~a.md" page)
                           "-o" (~ "~a/~a.html" out page))))
              '("index" "about"))
    (when (file-exists? "static/style.css")
      (cp "static/style.css" (~ "~a/style.css" out)))))

;; Two programs, one pipe, and a failure that names the stage that failed.
(define (check)
  "Lint every tracked page."
  (run-pipeline (list (list "git" "ls-files" "pages")
                      (list "xargs" "markdownlint"))))

;; Its arguments arrive as the strings typed on the command line.
(define (deploy host)
  "Ship ./build to HOST, replacing what is there."
  (unless (file-exists? "build/index.html")
    (task-error "nothing to deploy"
                #:hint "Run `maak build' first."))
  (run (list "rsync" "-av" "--delete" "build/" (~ "~a:/srv/www/" host))))

;; Procedures are values, so tasks compose like any other function.
(define (ci host)
  "Check, build and ship in one go."
  (check)
  (build)
  (deploy host))

The loop and the conditional expand into four commands, and --plan shows each one as the argv it is — no shell to re-parse, no quote to guess at:

$ maak --plan build
maak plan
  [1] build  mkdir -pv build
              cwd: /home/me/site
  [2] build  pandoc pages/index.md -o build/index.html
              cwd: /home/me/site
  [3] build  pandoc pages/about.md -o build/about.html
              cwd: /home/me/site
  [4] build  cp -r -v static/style.css build/style.css
              cwd: /home/me/site

Most build tools invent their own limited domain-specific language. Maak embraces the powerful λ Lisp and the amazing Guile Scheme programming language.

This also means your code is flexible, robust and reliable (+declarative) for at least the next 50 years.

  • Why it matters. Tasks are real Scheme functions: composable, testable, declarative, dry-runnable, parallelisable, and reproducible.

Lisp all the way down

  • The entire language, not a DSL. Define functions, use lists and hash tables, write macros, import libraries. If you can write it in Guile, you can write it in a task.
  • Lambdas compose. A task calls another task with a function call, and a list of tasks is a list — no subprocess, no re-parsing a file to find out what to run.
  • Your editor already knows the language. Docstrings are the task list, the REPL is the development loop, and maak --list reads like apropos.
  • Guix and Nix are values too. A pin is a store path a task can decide on, not a string another tool has to interpret.
  • Shell-free by default. run takes a program and its arguments as separate strings, so a path with a space in it stays one argument.
  • Errors that read like sentences. task-error prints one line and a hint, exits non-zero, and keeps the backtrace behind --debug.

See the full list pipelines, background jobs, -j, guix, nix, containers, niri, downloads, gettext, maven, uv, python in Features.

How a function becomes a task

A Maak file is read, not run, when maak answers a question about it: a top-level define, define* or a name bound to a lambda is a task, the #:export list decides which of them are visible, the docstring is the documentation and the lambda list is the argument grammar. That is what lets a listing, a plan and the call graph be answered for a file somebody is halfway through writing, on a machine that does not have its libraries.

resources/diagrams/task-description.svg

See it run

resources/maak-demo.gif

Documentation

Start with the quick start, or open the whole documentation index.

PageWhat it covers
Quick startYour first Maak file: eight steps from a module to a dry run.
TasksHow a function becomes a task, what exports hide, how arguments arrive.
The command lineEvery option, the grammar of tasks and arguments, --list output.
ConfigurationEnvironment variables, and the parameters behind dry-run and quiet.
The built-in toolkitrun, pipelines, jobs, file helpers, task-error, gettext.
Rust and CargoCargo and rustup helpers, the structured command line, metadata as a value, artefact paths.
Zig and zig buildBuild steps and their options as argv, the direct compiler commands, and a local clean where Zig’s uninstall is missing.
Python, uv and pyprojectuv helpers, the version and name a release reads, and the four CI checks.
Frontend projectsnpm, pnpm and yarn behind one set of procedures, and the package.json a release reads.
Task files in JSON, TOML and YAMLA task list without the language: the schema, the formats, their limits.
Maven, Gradle and the JVMThe Maven lifecycle and Gradle tasks as argv, wrapper detection, and the JVM reports.
Emacs Lisp packagesByte-compiling, ERT and checkdoc in batch, and the packaging conventions.
Elixir and mix`mix test`, `mix format` and `mix release` as argv, `mix cmd` in a directory or for each umbrella app, and the `mix.exs` and `mix.lock` readers.
Guix, Nix and reproducibilityThe helpers that build the command line, and the ones that return values.
On StabilityWhat the versions mean, and the promises of stability
Why maak, and why LispWhat Make cannot do, and the table of Make flags that did carry over.
Editors, shells and the REPLmaak.el and the seven integrations, the shell completions, the REPL workflow.
Maak files and AI assistantsWhat to ask maak instead of guessing, the rules a Maak file is reviewed against, and a block for a project’s agents file.

The manual page is installed with the program (man maak, or maak man in a checkout), the technical Guile API documentation is published at https://jointhefreeworld.org/api-docs/maak/index.html, and every release is recorded in NEWS.org.

Editor support

Emacs is the first-class citizen. maak.el is maak’s canonical front end: pick a task, prompt for its arguments, watch the output and jump to the definition, from inside Emacs, from the same maak.scm the command line runs.

The other editors are also served. Neovim, Vim, VS Code, Helix, IntelliJ, Zed and Sublime Text each have an integration in contrib/ .

Editors, shells and the REPL has the details, and every integration has a README of its own.

An assistant is served the same way: contrib/ai ships a skill file — the Maak file’s rules, its vocabulary and the loop that checks the work, as one context file — and Maak files and AI assistants says what to ask maak instead of guessing.

Installation

Guix, Nix, Homebrew, the container image, the RPM, the Debian package and the Void Linux template are all in Installing maak. From a checkout, the launcher runs this tree’s own sources:

guix shell -m manifest.scm -- ./scripts/maak --list

Community and support

Bug reports, patches, the AI policy and the code of conduct are in Community, contributing and conduct. If you like this work, you can buy me a cup of coffee ☕ so I can keep going with a lot of motivation.

License

maak, and all of its source code, build files and documentation — this document included — are free software, licensed under the MIT License (MIT).

https://opensource.org/license/mit

The full text is in the LICENSE file shipped with the source.

In short: use it, study it, change it, share it — and keep the copyright notice and the permission notice with the copies you pass on.


Happy hacking! ✨

Who uses maak

maak runs the build, release and site automation of many projects, see a list in Who uses maak.

Using maak in your project? Send a link and it can be listed there.

Explorer des projets similaires

Chargement…