Skip to content

Quick Start

Create a file named Jakefile in your project root:

# A simple greeting
task hello:
echo "Hello from Jake!"

Run it:

Terminal window
$ jake hello
-> hello
Hello from Jake!
Terminal window
$ jake --list
Available recipes:
hello [task]
@default
task build:
echo "Building..."

Now jake with no arguments runs build.

task build:
echo "Building..."
task test: [build]
echo "Testing..."
task deploy: [build, test]
echo "Deploying..."

Running jake deploy executes: buildtestdeploy

app_name = "myapp"
version = "1.0.0"
task info:
echo "{{app_name}} v{{version}}"
task greet name="World":
echo "Hello, {{name}}!"
Terminal window
$ jake greet name=Alice
Hello, Alice!

Only rebuild when sources change:

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

Re-run on file changes:

Terminal window
jake -w build

Run independent tasks concurrently:

Terminal window
jake -j4 all
# Variables
app_name = "myapp"
# Load .env file
@dotenv
# Default task
@default
task build:
@description "Build the application"
cargo build --release
# Task with dependencies
task test: [build]
cargo test
# File target
file dist/app: src/**/*.rs
cargo build --release
cp target/release/{{app_name}} dist/app
# Conditional logic
task deploy: [build, test]
@confirm "Deploy to production?"
@if env(CI)
./scripts/deploy-ci.sh
@else
./scripts/deploy-local.sh
@end