just
它能做什么
这项技能说明如何使用 just 命令运行器,这是一个用于保存项目命令的工具。适合在包含 justfile 的项目中工作的开发者。
适用场景
- ✓当项目中有 justfile,而你想查看或运行其中的配方的时候。
- ✓当你想把一组重复的命令变成一个 just 配方的时候。
- ✓当你想为配方传递参数或查看其源码的时候。
技能链接
https://github.com/casey/just/blob/master/skills/just/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“这个项目的 justfile 中有哪些配方?我该如何运行部署的那一个?”
每周 5 个新技能,1 分钟读完。
工作原理
它会列出该工具支持的命令,例如显示配方、打印其源码,以及带参数运行某个配方。它还会说明编写新配方所需的基本 justfile 语法。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Just
Discovery
just --dumpPrint justfilejust --evaluatePrint variable valuesjust --helpPrint detailed command-line syntax helpjust --listPrint recipes with descriptionsjust --show <RECIPE>Print recipe sourcejust --summaryPrint recipes without descriptiosn
Execution
justRun default recipejust <RECIPE>Run specific recipejust <RECIPE> <ARG1> <ARG2Run recipe with arguments
Syntax
executable := 'main'
# compile main.c
compile:
cc main.c -o {{ executable }}
# run main
run: compile
./{{ executable }}
# run test
test name: compile
./bin/test {{ name }}
# start webserver
serve port='8080':
python -m http.server {{port}}
# publish current tag
publish:
#!/usr/bin/env bash
set -euxo pipefail
tag=`git describe --tags --exact-match`
./bin/check-tag $tag
git push origin $tag
Notes
The comment proceeding a recipe is used as its doc-comment, and included in
just --list.
By default, each line of a recipe runs in a fresh shell. Recipes whose bodies
start with #! are written to a file and executed as a script.
Commonly used commands and scripts should be turned into just recipes.
常见问题
什么是 justfile?
justfile 是一个保存项目中命名命令(称为配方)的文件。
我需要先安装 just 吗?
需要。必须先安装 just 命令运行器,才能运行其中的配方。
一个配方可以依赖另一个配方吗?
可以。一个配方可以依赖另一个配方,因此另一个会先运行。
详情
作者的原始描述
Reference for `just`, the command runner. Use when working in a project with a `justfile` or when the user mentions `just` or `justfile`.
repo: casey/just
热度
- GitHub 星标
- 37k
- 排名
- #7584
- 许可证
- CC0-1.0
- 更新时间
- 2026/11/2
评论
- …