Skip to content

Jakefile Syntax

# This is a comment
task foo: # Inline comment
echo "Hello"

Comments placed immediately before a recipe (no blank lines) are captured as documentation and shown in jake -l:

# Build the application binary
task build:
zig build

A blank line between the comment and recipe prevents capture, making it easy to use section headers:

# ============================================
# Build Section
# ============================================
task build: # This has no doc comment
zig build

For inline descriptions, use @desc (shown in the same line as the recipe name):

@desc "Build the application"
task build:
zig build

Commands must be indented with 4 spaces or 1 tab:

task example:
echo "Line 1"
echo "Line 2"

Long commands can span multiple lines using shell continuation:

task long-command:
echo "This is a very long command" \
"that spans multiple lines"
name = "Jake";
version = "1.0.0";

Use {{variable}} syntax in commands:

greeting = "Hello"
target = "World"
task greet:
echo "{{greeting}}, {{target}}!"

Output: Hello, World!

Variables are global and available to all recipes:

project = "myapp"
task build:
echo "Building {{project}}"
task test:
echo "Testing {{project}}"

Jake supports three types of recipes:

TypeKeywordRuns WhenBest For
TasktaskAlwaysCommands, scripts, development
FilefileOutput missing or dependencies changedBuild artifacts, compilation
Simple(none)AlwaysQuick recipes, Make-like syntax

Always run when invoked:

task clean:
rm -rf dist/
task dev:
npm run dev

Only run if output is missing or dependencies changed:

file dist/app.js: src/**/*.ts
esbuild src/index.ts --bundle --outfile=dist/app.js

No keyword, Make-like syntax:

build:
cargo build
test: [build]
cargo test

Define alternative names:

task build | b | compile:
cargo build

Now jake build, jake b, and jake compile all work.

Hide recipes from jake --list using either method:

Prefix the recipe name with _:

task _internal-helper:
echo "Hidden from jake --list"
task public-task: [_internal-helper]
echo "Uses the private helper"

Use the @hidden directive before the recipe:

@hidden
task internal-helper:
echo "Hidden from jake --list"
task public-task: [internal-helper]
echo "Uses the private helper"

Both methods hide the recipe from normal listings. Use jake --all or jake -a to see all recipes including hidden ones.