Migrating from Just
If you’re coming from Just, the transition to Jake is smooth. Most syntax is similar or identical.
Syntax Comparison
Section titled “Syntax Comparison”| Just | Jake |
|---|---|
recipe: | task recipe: (or simple syntax) |
{{var}} | {{var}} (same!) |
set dotenv-load | @dotenv |
@recipe (quiet) | @quiet decorator |
[group: 'x'] | @group x |
[confirm] | @confirm "message" |
[private] | @hidden or prefix with _ |
Key Differences
Section titled “Key Differences”Recipe Keyword
Section titled “Recipe Keyword”Just uses bare recipe names. Jake prefers the task keyword for clarity, but also supports simple syntax:
# Jake with task keyword (recommended)task build: cargo build
# Jake with simple syntax (Just-like)build: cargo build.env Loading
Section titled “.env Loading”Just uses a global setting. Jake uses a directive:
# Just: set dotenv-load# Jake:@dotenv@dotenv ".env.local" # Can load multiple filesGroups
Section titled “Groups”Just uses attributes. Jake uses a directive:
# Just: [group: 'build']# Jake:@group buildtask compile: cargo buildConfirmations
Section titled “Confirmations”Just uses an attribute. Jake uses a directive with a message:
# Just: [confirm]# Jake:task deploy: @confirm "Deploy to production?" ./deploy.shPrivate Recipes
Section titled “Private Recipes”Just uses an attribute. Jake supports both @hidden directive and underscore prefix:
# Just: [private]# Jake option 1: @hidden directive@hiddentask helper: echo "I'm hidden from --list"
# Jake option 2: underscore prefixtask _other-helper: echo "Also hidden from --list"
task public: [helper, _other-helper] echo "I use the hidden helpers"Example Migration
Section titled “Example Migration”Before (justfile)
Section titled “Before (justfile)”set dotenv-load
default: @just --list
build: cargo build
test: build cargo test
[confirm("Deploy to production?")][group: 'deploy']deploy: test ./deploy.shAfter (Jakefile)
Section titled “After (Jakefile)”@dotenv
@defaulttask list: jake --list
task build: cargo build
task test: [build] cargo test
@group deploytask deploy: [test] @confirm "Deploy to production?" ./deploy.shWhat Jake Adds
Section titled “What Jake Adds”Migrating from Just gives you new capabilities:
1. File-Based Dependencies
Section titled “1. File-Based Dependencies”Track source files and only rebuild when changed:
file dist/bundle.js: src/**/*.ts esbuild src/index.ts --bundle --outfile=dist/bundle.jsThis skips the build if no TypeScript files changed since the last run.
2. Glob Patterns
Section titled “2. Glob Patterns”Reference files with wildcards:
file dist/app.js: src/**/*.ts tsc --outFile dist/app.js3. Parallel Execution
Section titled “3. Parallel Execution”Run independent tasks simultaneously:
jake -j4 all # 4 parallel workersjake -j all # Use CPU count4. Pre/Post Hooks
Section titled “4. Pre/Post Hooks”Run setup and cleanup around recipes:
task deploy: @pre echo "Starting deployment..." ./deploy.sh @post echo "Deployment complete!"5. Watch Mode
Section titled “5. Watch Mode”Re-run tasks when files change:
jake -w buildjake -w "src/**/*.ts" build6. @needs Directive
Section titled “6. @needs Directive”Verify tools exist before running:
task build: @needs node npm esbuild npm run build7. Error Hooks
Section titled “7. Error Hooks”Handle failures globally:
@on_error notify "Build failed!"
task build: npm run buildMigration Tips
Section titled “Migration Tips”- Add
taskkeyword - For clarity (or keep simple syntax) - Convert attributes - Replace
[...]with@...directives - Move dotenv - Change
set dotenv-loadto@dotenv - Use file recipes - Replace always-run tasks with
filewhen appropriate - Add parallelism - Use
-jfor faster builds
Keeping Compatibility
Section titled “Keeping Compatibility”If you want to gradually migrate, you can:
- Keep your justfile during transition
- Run specific tasks with both tools to verify behavior
- Once confident, remove the justfile
See Also
Section titled “See Also”- File Targets - Learn about file-based caching
- Watch Mode - Automatic rebuilds
- Directives Reference - All Jake directives