SuperAPI AI 工具集

just

通用与其它

查看项目

更新于 10-15 23:48

技能介绍

用途:just 是命令运行器,用于项目任务自动化。资料将其定位为任务自动化的首选工具,建议新项目用 Justfile 替代 Makefile。

主要能力:可用 just --list 或 just -l 列出配方;用 just build、just test 运行配方;支持带参数配方(如 just deploy production)、默认参数值、依赖链(deploy: build test)、变量、私有配方(_setup)、配方属性([ignore-errors]、[working-directory]、[confirm]、[no-quiet])、命令求值(反引号)、多行变量、settings(如 set shell、set quiet)、import 导入其他文件。

使用方式:在项目根目录创建 justfile,配方保持 1-3 行,复杂逻辑委托给 scripts/ 下的脚本。常用命令包括 just --list、just <recipe>、just <recipe> arg1 arg2、just var=value recipe、just --justfile path recipe、just --working-directory /path recipe、just --dry-run recipe、just --verbose recipe、just --choose。安装方式资料给出 brew install just(macOS)或 cargo install just。

适用场景:开发工作流、构建自动化、多环境部署、Docker 工作流、数据库操作、与 Cargo、npm/pnpm/yarn、Git 等工具集成,以及 monorepo 多服务构建与部署。

限制与注意:just 不是构建系统,不跟踪文件依赖,配方每次都会运行;重定义 import 导入的配方默认是硬错误,需 set allow-duplicate-recipes := true 且本地定义放在 import 之前;破坏性操作建议用 [confirm]。官方文档见 https://just.systems,仓库见 https://github.com/casey/just。