task-runner
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseTask Runner
任务运行器
Purpose
用途
Execute project-specific commands using just, a modern command runner that's simpler than make and works cross-platform.
使用just执行项目专属命令,just是一款比make更简洁且支持跨平台的现代命令运行器。
Tools
工具
| Tool | Command | Use For |
|---|---|---|
| just | | List available recipes |
| just | | Run specific recipe |
| 工具 | 命令 | 用途 |
|---|---|---|
| just | | 列出可用任务 |
| just | | 运行指定任务 |
Usage Examples
使用示例
Basic Usage
基础用法
bash
undefinedbash
undefinedList all available recipes
列出所有可用任务
just
just
Run a recipe
运行某一任务
just test
just build
just lint
just test
just build
just lint
Run recipe with arguments
带参数运行任务
just deploy production
just deploy production
Run specific recipe from subdirectory
从子目录运行指定任务
just --justfile backend/justfile test
undefinedjust --justfile backend/justfile test
undefinedCommon justfile Recipes
常见justfile任务示例
just
undefinedjust
undefinedExample justfile
示例justfile
Run tests
运行测试
test:
pytest tests/
test:
pytest tests/
Build project
构建项目
build:
npm run build
build:
npm run build
Lint code
代码检查
lint:
ruff check .
eslint src/
lint:
ruff check .
eslint src/
Start development server
启动开发服务器
dev:
npm run dev
dev:
npm run dev
Clean build artifacts
清理构建产物
clean:
rm -rf dist/ build/ *.egg-info/
clean:
rm -rf dist/ build/ *.egg-info/
Deploy to environment
部署到指定环境
deploy env:
./scripts/deploy.sh {{env}}
undefineddeploy env:
./scripts/deploy.sh {{env}}
undefinedDiscovery
功能发现
bash
undefinedbash
undefinedCheck if justfile exists
检查是否存在justfile
just --summary
just --summary
Show recipe details
查看任务详情
just --show test
just --show test
List recipes with descriptions
列出带描述的任务
just --list
undefinedjust --list
undefinedWhen to Use
适用场景
- First check: to see available project commands
just - Running tests:
just test - Building:
just build - Any project-specific task
- Cross-platform command running
- 首次检查:执行查看项目可用命令
just - 运行测试:
just test - 构建项目:
just build - 任何项目专属任务
- 跨平台命令执行
Best Practice
最佳实践
Always check for a justfile when entering a new project:
bash
just --listThis shows what commands are available without reading documentation.
进入新项目时,务必先检查justfile:
bash
just --list无需阅读文档即可了解可用命令。