跳到正文
Skillpedia
通用编程37k · #7584

just

它能做什么

这项技能说明如何使用 just 命令运行器,这是一个用于保存项目命令的工具。适合在包含 justfile 的项目中工作的开发者。

适用场景

  • ✓当项目中有 justfile,而你想查看或运行其中的配方的时候。
  • ✓当你想把一组重复的命令变成一个 just 配方的时候。
  • ✓当你想为配方传递参数或查看其源码的时候。

技能链接

https://github.com/casey/just/blob/master/skills/just/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/casey/just/blob/master/skills/just/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“这个项目的 justfile 中有哪些配方?我该如何运行部署的那一个?”

每周 5 个新技能,1 分钟读完。

工作原理

它会列出该工具支持的命令,例如显示配方、打印其源码,以及带参数运行某个配方。它还会说明编写新配方所需的基本 justfile 语法。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

Just

Discovery

  • just --dump Print justfile
  • just --evaluate Print variable values
  • just --help Print detailed command-line syntax help
  • just --list Print recipes with descriptions
  • just --show <RECIPE> Print recipe source
  • just --summary Print recipes without descriptiosn

Execution

  • just Run default recipe
  • just <RECIPE> Run specific recipe
  • just <RECIPE> <ARG1> <ARG2 Run 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

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

相似技能