Skills2026年4月11日·1 分钟阅读

Just — A Modern Command Runner and Makefile Alternative

Just is a command runner, like Make but for modern dev workflows. Write recipes in a Justfile, run them with `just recipe-name`. Simpler syntax than Make, no obscure behaviors, cross-platform, and works great for project tasks.

Agent 就绪

Agent 可直接安装

这个资产可安装;Agent 先选择当前运行时、检查安装计划,再运行匹配命令。

Native · 98/100策略:允许
Agent 入口
任意 MCP/CLI Agent
类型
Skill
安装
Single
信任
信任等级:Established
入口
step-1.md
直接安装命令
npx -y tokrepo@latest install d3b6480b-35cb-11f1-9bc6-00163e2b0d79 --target codex

先 dry-run 确认安装计划,再运行此命令。

TL;DR
Just provides a simpler alternative to Make for running project commands with a clean syntax, variables, arguments, and cross-platform support.
§01

What it is

Just is a command runner that serves as a modern replacement for Make. You write recipes in a Justfile with a simple syntax, and run them with just recipe-name. Unlike Make, Just has no file-dependency system -- it focuses purely on running commands with a clean, predictable syntax.

Just targets developers who use Makefiles as command shortcuts rather than build systems. It eliminates Make's quirks (tabs vs spaces, implicit rules, shell differences) and adds features like arguments, variables, and recipe dependencies.

§02

How it saves time or tokens

Just reduces project onboarding time. New team members run just --list to see all available commands. Each recipe has a description and a clear invocation pattern. No more reading through a 200-line Makefile to find the deploy command.

For AI agents, Justfiles are easier to parse and generate than Makefiles because the syntax is simpler and more consistent.

§03

How to use

  1. Install Just:
brew install just         # macOS
cargo install just        # Rust
scoop install just        # Windows
  1. Create a Justfile in your project root:
# Start development server
dev:
    npm run dev

# Run tests with optional filter
test filter='':
    go test ./... -run '{{filter}}'

# Deploy to production
deploy: test
    bash deploy.sh production

# Format and lint
check:
    go fmt ./...
    golangci-lint run
  1. Run recipes:
just dev
just test MyFunction
just deploy
just --list
§04

Example

# Justfile with variables, arguments, and conditionals
project := 'myapp'
env := env_var_or_default('ENV', 'development')

# Build the project
build target='all':
    @echo 'Building {{project}} ({{target}}) for {{env}}'
    go build -o bin/{{project}} ./cmd/{{target}}

# Run database migrations
migrate direction='up':
    goose -dir migrations {{direction}}

# Docker build and push
docker tag='latest':
    docker build -t {{project}}:{{tag}} .
    docker push registry.example.com/{{project}}:{{tag}}

# Clean build artifacts
clean:
    rm -rf bin/ dist/ tmp/
§05

Related on TokRepo

§06

Common pitfalls

  • Justfile recipes use sh by default on Unix. If you write bash-specific syntax (arrays, [[), set set shell := ['bash', '-cu'] at the top of your Justfile.
  • Just does not track file dependencies like Make does. If you need incremental builds, use a build tool (Go, Cargo, webpack) inside your Just recipes.
  • Recipe names cannot contain hyphens in some versions. Use underscores or camelCase for recipe names.

常见问题

How does Just compare to Make?+

Just is command-runner-only: no file-dependency tracking, no implicit rules, no tab-sensitivity. It adds recipe arguments, environment variable support, and cross-platform compatibility. Use Make for build systems, Just for command shortcuts.

Does Just work on Windows?+

Yes. Just works on Windows, macOS, and Linux. On Windows, it uses PowerShell by default but can be configured to use cmd or bash.

Can Just recipes have arguments?+

Yes. Define parameters after the recipe name: `deploy env='staging':`. Run with `just deploy production`. Default values make arguments optional.

Does Just support recipe dependencies?+

Yes. List dependencies after the recipe name and colon: `deploy: test build`. Just runs dependencies before the recipe. Dependencies only run once even if referenced multiple times.

Can I use Just with any programming language?+

Yes. Just is language-agnostic. Recipes are shell commands that can invoke any tool: npm, cargo, go, python, docker, or custom scripts.

引用来源 (3)

讨论

登录后参与讨论。
还没有评论,来写第一条吧。

相关资产