mise-expert by samhvw8/dotfiles
npx skills add https://github.com/samhvw8/dotfiles --skill mise-expert专用于 mise 的技能——一个统一的开发环境管理器,集成了工具版本管理(替代 asdf)、环境变量管理(替代 direnv)和任务运行(替代 make/npm scripts)。
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
<task_design_principles>
sources 和 outputsdepends 数组实现并行执行db:migrate、test:unit)run_windows 实现跨平台兼容性mise watch 的任务 </task_design_principles><when_to_use_mise> 选择 mise 用于:
跳过 mise 用于:
<tool_installation_patterns> 项目特定工具
# mise.toml - 项目根配置
[tools]
# 精确版本以确保可复现性
node = "20.10.0"
python = "3.11.6"
go = "1.21.5"
terraform = "1.6.6"
# 从版本文件读取
ruby = { file = ".ruby-version" }
java = { file = ".java-version" }
# 最新补丁版本
postgres = "16"
redis = "7"
# 多个版本(使用 mise use 切换)
# mise use node@18 (临时覆盖)
全局开发工具
# 安装全局有用的 CLI 工具
mise use -g ripgrep@latest # 更好的 grep
mise use -g bat@latest # 更好的 cat
版本文件迁移
# 从现有版本文件迁移
echo "20.10.0" > .node-version
echo "3.11.6" > .python-version
# mise.toml
[tools]
node = { file = ".node-version" }
python = { file = ".python-version" }
</tool_installation_patterns>
<project_setup_patterns> 新项目引导
# mise.toml
[tools]
node = "20"
python = "3.11"
[env]
PROJECT_ROOT = "{{cwd}}"
LOG_LEVEL = "debug"
[vars]
project_name = "my-app"
[tasks.setup]
description = "设置开发环境"
run = [
"mise install",
"npm install",
"pip install -r requirements.txt",
"cp .env.example .env"
]
[tasks.dev]
alias = "d"
description = "启动开发服务器"
depends = ["setup"]
env = { NODE_ENV = "development" }
run = "npm run dev"
Monorepo 配置
# 根目录 mise.toml
[tools]
node = "20"
go = "1.21"
[tasks.install]
description = "安装所有依赖"
run = [
"cd frontend && npm install",
"cd backend && go mod download"
]
# frontend/mise.toml
[tasks.dev]
dir = "{{cwd}}/frontend"
run = "npm run dev"
# backend/mise.toml
[tools]
go = "1.21"
[tasks.dev]
dir = "{{cwd}}/backend"
run = "go run main.go"
</project_setup_patterns>
<common_patterns> 开发工作流
[tasks.dev]
alias = "d"
description = "启动带热重载的开发服务器"
env = { NODE_ENV = "development", DEBUG = "true" }
run = "npm run dev"
[tasks.dev-watch]
description = "监视更改并重新构建"
run = "mise watch build"
带缓存的构建流水线
[tasks.clean]
description = "移除构建产物"
run = "rm -rf dist"
[tasks.build]
alias = "b"
description = "构建生产包"
depends = ["clean"]
sources = ["src/**/*", "package.json", "tsconfig.json"]
outputs = ["dist/**/*"]
env = { NODE_ENV = "production" }
run = "npm run build"
[tasks.build-watch]
description = "源文件更改时重新构建"
run = "mise watch build"
测试套件
[tasks.test]
alias = "t"
description = "运行所有测试"
depends = ["test:unit", "test:integration"] # 默认并行运行
[tasks."test:unit"]
description = "运行单元测试"
sources = ["src/**/*.ts", "tests/unit/**/*.ts"]
run = "npm test -- --testPathPattern=unit"
[tasks."test:integration"]
description = "运行集成测试"
sources = ["src/**/*.ts", "tests/integration/**/*.ts"]
run = "npm test -- --testPathPattern=integration"
[tasks."test:watch"]
description = "以监视模式运行测试"
run = "npm test -- --watch"
[tasks."test:coverage"]
description = "生成覆盖率报告"
run = "npm test -- --coverage"
[tasks."test:e2e"]
description = "运行端到端测试"
depends = ["build"]
run = "playwright test"
数据库工作流
[tasks."db:migrate"]
description = "运行数据库迁移"
run = "npx prisma migrate deploy"
[tasks."db:seed"]
description = "用测试数据填充数据库"
depends = ["db:migrate"]
run = "npx prisma db seed"
[tasks."db:reset"]
description = "将数据库重置为干净状态"
run = ["npx prisma migrate reset --force", "mise run db:seed"]
[tasks."db:studio"]
description = "打开 Prisma Studio"
run = "npx prisma studio"
代码检查与格式化
[tasks.lint]
description = "检查代码"
sources = ["src/**/*.ts"]
run = "eslint src"
[tasks.format]
description = "格式化代码"
sources = ["src/**/*.ts"]
run = "prettier --write src"
[tasks."lint:fix"]
description = "检查并自动修复问题"
run = "eslint src --fix"
[tasks.check]
description = "运行所有检查"
depends = ["lint", "format", "test"] # 并行运行
部署流水线
[tasks.deploy]
description = "部署到生产环境"
usage = '''
arg "environment" description="目标环境" default="staging"
flag "-f --force" description="跳过确认"
'''
depends = ["build", "test"]
depends_post = ["notify:slack"]
run = './scripts/deploy.sh {{arg(name="environment")}} {{flag(name="force")}}'
[tasks."deploy:staging"]
description = "部署到预发布环境"
depends = ["build", "test"]
run = "./scripts/deploy.sh staging"
[tasks."deploy:production"]
description = "部署到生产环境"
depends = ["build", "test"]
run = "./scripts/deploy.sh production"
[tasks."notify:slack"]
hide = true
run = 'curl -X POST $SLACK_WEBHOOK -d "Deployment complete"'
Docker 集成
[tasks."docker:build"]
description = "构建 Docker 镜像"
sources = ["Dockerfile", "src/**/*"]
run = "docker build -t myapp:latest ."
[tasks."docker:run"]
description = "运行 Docker 容器"
depends = ["docker:build"]
run = "docker run -p 3000:3000 myapp:latest"
[tasks."docker:compose"]
description = "使用 docker-compose 启动服务"
run = "docker-compose up -d"
Go 插件构建系统
[tasks."build:plugins"]
description = "并行构建所有 Go 插件"
sources = ["plugins/**/*.go"]
outputs = ["plugins/**/main.so"]
run = '''
for plugin in plugins/*/; do
(cd "$plugin" && go build -buildmode=plugin -o main.so main.go) &
done
wait
'''
[tasks."rebuild:plugins"]
description = "引擎更改时重新构建插件"
sources = ["engine/**/*.go"]
depends = ["build:engine"]
run = "mise run build:plugins"
</common_patterns>
<environment_patterns> 环境特定变量
[vars]
# 默认开发值
api_url = "http://localhost:3000"
db_host = "localhost"
db_port = "5432"
debug_mode = "true"
# 从 .env 加载额外变量
_.file = ".env"
[env]
# 静态环境变量
NODE_ENV = "development"
LOG_LEVEL = "debug"
# 引用变量
API_URL = "{{vars.api_url}}"
DATABASE_URL = "postgres://{{vars.db_host}}:{{vars.db_port}}/myapp"
DEBUG = "{{vars.debug_mode}}"
[tasks.dev]
env = {
NODE_ENV = "development",
API_URL = "{{vars.api_url}}"
}
run = "npm run dev"
多环境设置
# mise.toml (基础开发配置)
[vars]
environment = "development"
api_url = "http://localhost:3000"
[env]
NODE_ENV = "development"
# mise.staging.toml
[vars]
environment = "staging"
api_url = "https://api.staging.example.com"
[env]
NODE_ENV = "staging"
# mise.production.toml
[vars]
environment = "production"
api_url = "https://api.example.com"
debug_mode = "false"
[env]
NODE_ENV = "production"
密钥管理
# mise.toml (提交到 git)
[vars]
# 非敏感默认值
api_url = "http://localhost:3000"
# 从 .env 加载密钥(被 git 忽略)
_.file = ".env"
[env]
# 引用从 .env 加载的密钥
API_KEY = "{{vars.api_key}}"
DATABASE_PASSWORD = "{{vars.db_password}}"
# .env (不提交到 git)
api_key=secret-key-here
db_password=secret-password
</environment_patterns>
<workflow_steps> 帮助配置 mise 时:
评估当前状态
设计架构
实现配置
优化性能
jobs 限制验证和测试
mise install 验证工具安装mise tasks ls 验证任务注册mise run <task>mise doctor 进行诊断 </workflow_steps><migration_from_asdf> 从 .tool-versions 迁移到 mise.toml
.tool-versions:
nodejs 20.10.0
python 3.11.6
golang 1.21.5
terraform 1.6.6
mise.toml:
[tools]
node = "20.10.0"
python = "3.11.6"
go = "1.21.5"
terraform = "1.6.6"
迁移命令:
# Mise 可以直接读取 .tool-versions
mise install
# 或者转换为 mise.toml
mise use node@20.10.0 python@3.11.6 go@1.21.5 terraform@1.6.6
</migration_from_asdf>
<migration_from_make> 从 Makefile 迁移到 mise.toml
Makefile:
.PHONY: build test clean deploy
clean:
rm -rf dist
build: clean
npm run build
test: build
npm test
deploy: build test
./deploy.sh
mise.toml:
[tasks.clean]
description = "移除构建产物"
run = "rm -rf dist"
[tasks.build]
alias = "b"
description = "构建生产包"
depends = ["clean"]
sources = ["src/**/*", "package.json"]
outputs = ["dist/**/*"]
run = "npm run build"
[tasks.test]
alias = "t"
description = "运行测试"
depends = ["build"]
run = "npm test"
[tasks.deploy]
description = "部署到生产环境"
depends = ["build", "test"] # build 和 test 并行运行
run = "./deploy.sh"
优势:
<migration_from_npm> 从 package.json scripts 迁移到 mise.toml
package.json:
{
"scripts": {
"dev": "NODE_ENV=development npm start",
"build": "webpack --mode production",
"test": "jest",
"lint": "eslint src",
"deploy": "npm run build && npm run test && ./deploy.sh"
}
}
mise.toml:
[tasks.dev]
alias = "d"
description = "启动开发服务器"
env = { NODE_ENV = "development" }
run = "npm start"
[tasks.build]
alias = "b"
description = "构建生产包"
sources = ["src/**/*", "webpack.config.js"]
outputs = ["dist/**/*"]
run = "webpack --mode production"
[tasks.test]
alias = "t"
description = "运行测试"
run = "jest"
[tasks.lint]
description = "检查代码"
sources = ["src/**/*.js"]
run = "eslint src"
[tasks.deploy]
description = "部署到生产环境"
depends = ["build", "test"] # 并行运行
run = "./deploy.sh"
优势:
<migration_from_direnv> 从 .envrc 迁移到 mise.toml
.envrc:
export NODE_ENV=development
export API_URL=http://localhost:3000
export DATABASE_URL=postgres://localhost/myapp
mise.toml:
[env]
NODE_ENV = "development"
API_URL = "http://localhost:3000"
DATABASE_URL = "postgres://localhost/myapp"
# 或者使用变量实现 DRY
[vars]
api_host = "localhost"
api_port = "3000"
[env]
API_URL = "http://{{vars.api_host}}:{{vars.api_port}}"
优势:
<ci_integration> GitHub Actions
name: CI
on: [push, pull_request]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup mise
uses: jdx/mise-action@v2
with:
version: latest # 或特定版本
- name: Install tools and dependencies
run: mise install
- name: Run tests
run: mise run test
- name: Build
run: mise run build
GitLab CI
image: ubuntu:latest
before_script:
- curl https://mise.run | sh
- export PATH="$HOME/.local/bin:$PATH"
- mise install
test:
script:
- mise run test
build:
script:
- mise run build
Docker
FROM ubuntu:latest
# 安装 mise
RUN curl https://mise.run | sh
ENV PATH="/root/.local/bin:$PATH"
# 复制项目文件
COPY . /app
WORKDIR /app
# 安装工具和依赖
RUN mise install
# 运行构建
RUN mise run build
CMD ["mise", "run", "start"]
</ci_integration>
<common_issues> 工具未找到 / 版本错误
# 症状:命令未找到或使用系统版本
mise ls # 列出已安装的工具
mise install # 安装缺失的工具
mise use node@20 # 设置特定版本
mise doctor # 诊断配置
which node # 验证 mise shim
mise reshim # 如果需要,重新构建 shims
任务未找到
# 症状:"Task 'xyz' not found"
mise tasks ls # 列出所有任务
mise config # 显示活动配置文件
cat mise.toml # 验证任务定义
mise tasks info <task> # 获取任务详情
任务缓存问题
# 症状:文件更改时任务未重新运行
[tasks.build]
sources = ["src/**/*"] # 检查 glob 模式是否正确
outputs = ["dist/**/*"] # 验证输出路径与实际输出匹配
run = "npm run build"
# 调试:移除输出并重新运行
# rm -rf dist && mise run build
环境变量未加载
# 症状:任务中未设置环境变量
mise config # 验证 mise.toml 位置(项目根目录)
mise run --verbose <task> # 使用详细输出检查环境加载
mise doctor # 诊断检查
env | grep VAR_NAME # 检查变量是否实际设置
跨平台问题
# 症状:任务在 Windows 上失败
[tasks.build]
run = "npm run build" # 使用跨平台命令
run_windows = "npm.cmd run build" # Windows 特定覆盖
# 或者使用 mise 变量处理路径
run = "{{cwd}}/scripts/build.sh"
并行执行不工作
# 症状:任务顺序执行而非并行
[tasks.ci]
depends = ["lint", "test", "build"] # 默认并行运行
# 对于顺序执行,使用 run 数组
[tasks.sequential]
run = [
"mise run step1",
"mise run step2",
"mise run step3"
]
工具安装失败
# 症状:mise install 安装某个工具失败
mise doctor # 检查系统依赖
mise ls-remote node # 列出可用版本
mise install node@20 --verbose # 详细安装
mise cache clear # 清除缓存并重试
</common_issues>
<best_practices> 工具管理:
任务配置:
环境管理:
性能:
跨平台:
团队与 CI:
mise doctor 进行验证 </best_practices>创建 mise 配置时:
mise run 命令mise install 设置工具<example_setup> 用户:"为我的 Node.js 项目设置 mise"
回复:
# mise.toml
[tools]
node = "20.10.0"
[env]
NODE_ENV = "development"
[tasks.install]
description = "安装依赖"
run = "npm install"
[tasks.dev]
alias = "d"
description = "启动开发服务器"
env = { NODE_ENV = "development" }
run = "npm run dev"
[tasks.build]
alias = "b"
description = "为生产环境构建"
sources = ["src/**/*", "package.json"]
outputs = ["dist/**/*"]
env = { NODE_ENV = "production" }
run = "npm run build"
[tasks.test]
alias = "t"
description = "运行测试"
run = "npm test"
设置:
mise install # 安装 Node.js 20.10.0
mise run install # 安装 npm 依赖
mise dev # 启动开发服务器
</example_setup>
<example_polyglot> 用户:"我有一个包含 Python 后端和 Node 前端的项目"
回复:
# mise.toml
[tools]
node = "20.10.0"
python = "3.11.6"
[env]
PROJECT_ROOT = "{{cwd}}"
[tasks."backend:install"]
description = "安装 Python 依赖"
dir = "{{cwd}}/backend"
run = "pip install -r requirements.txt"
[tasks."frontend:install"]
description = "安装 Node 依赖"
dir = "{{cwd}}/frontend"
run = "npm install"
[tasks.install]
description = "安装所有依赖"
depends = ["backend:install", "frontend:install"]
[tasks."backend:dev"]
description = "启动 Python 后端"
dir = "{{cwd}}/backend"
env = { FLASK_ENV = "development" }
run = "python app.py"
[tasks."frontend:dev"]
description = "启动 Node 前端"
dir = "{{cwd}}/frontend"
env = { NODE_ENV = "development" }
run = "npm run dev"
[tasks.dev]
description = "同时启动前端和后端"
depends = ["backend:dev", "frontend:dev"]
用法:
mise install # 安装 Node 和 Python
mise run install # 安装所有依赖
mise dev # 并行启动两个服务
</example_polyglot>
<anti_patterns> 不要:
要:
mise doctor 测试每周安装数
102
仓库
GitHub 星标数
12
首次出现
2026年1月21日
安全审计
安装于
opencode80
codex76
cursor74
gemini-cli71
github-copilot68
kimi-cli62
Specialized skill for mise - a unified development environment manager combining tool version management (asdf replacement), environment variable management (direnv replacement), and task running (make/npm scripts replacement).
<task_design_principles>
sources and outputs for cacheable tasksdepends arrays for parallel executiondb:migrate, test:unit)run_windows for cross-platform compatibilitymise watch </task_design_principles><when_to_use_mise> Choose mise for:
Skip mise for:
<tool_installation_patterns> Project-Specific Tools
# mise.toml - Project root configuration
[tools]
# Exact versions for reproducibility
node = "20.10.0"
python = "3.11.6"
go = "1.21.5"
terraform = "1.6.6"
# Read from version file
ruby = { file = ".ruby-version" }
java = { file = ".java-version" }
# Latest patch version
postgres = "16"
redis = "7"
# Multiple versions (switch with mise use)
# mise use node@18 (temporarily override)
Global Development Tools
# Install globally useful CLI tools
mise use -g ripgrep@latest # Better grep
mise use -g bat@latest # Better cat
Version File Migration
# Migrate from existing version files
echo "20.10.0" > .node-version
echo "3.11.6" > .python-version
# mise.toml
[tools]
node = { file = ".node-version" }
python = { file = ".python-version" }
</tool_installation_patterns>
<project_setup_patterns> New Project Bootstrap
# mise.toml
[tools]
node = "20"
python = "3.11"
[env]
PROJECT_ROOT = "{{cwd}}"
LOG_LEVEL = "debug"
[vars]
project_name = "my-app"
[tasks.setup]
description = "Setup development environment"
run = [
"mise install",
"npm install",
"pip install -r requirements.txt",
"cp .env.example .env"
]
[tasks.dev]
alias = "d"
description = "Start development server"
depends = ["setup"]
env = { NODE_ENV = "development" }
run = "npm run dev"
Monorepo Configuration
# Root mise.toml
[tools]
node = "20"
go = "1.21"
[tasks.install]
description = "Install all dependencies"
run = [
"cd frontend && npm install",
"cd backend && go mod download"
]
# frontend/mise.toml
[tasks.dev]
dir = "{{cwd}}/frontend"
run = "npm run dev"
# backend/mise.toml
[tools]
go = "1.21"
[tasks.dev]
dir = "{{cwd}}/backend"
run = "go run main.go"
</project_setup_patterns>
<common_patterns> Development Workflow
[tasks.dev]
alias = "d"
description = "Start development server with hot reload"
env = { NODE_ENV = "development", DEBUG = "true" }
run = "npm run dev"
[tasks.dev-watch]
description = "Watch and rebuild on changes"
run = "mise watch build"
Build Pipeline with Caching
[tasks.clean]
description = "Remove build artifacts"
run = "rm -rf dist"
[tasks.build]
alias = "b"
description = "Build production bundle"
depends = ["clean"]
sources = ["src/**/*", "package.json", "tsconfig.json"]
outputs = ["dist/**/*"]
env = { NODE_ENV = "production" }
run = "npm run build"
[tasks.build-watch]
description = "Rebuild on source changes"
run = "mise watch build"
Testing Suite
[tasks.test]
alias = "t"
description = "Run all tests"
depends = ["test:unit", "test:integration"] # Runs in parallel
[tasks."test:unit"]
description = "Run unit tests"
sources = ["src/**/*.ts", "tests/unit/**/*.ts"]
run = "npm test -- --testPathPattern=unit"
[tasks."test:integration"]
description = "Run integration tests"
sources = ["src/**/*.ts", "tests/integration/**/*.ts"]
run = "npm test -- --testPathPattern=integration"
[tasks."test:watch"]
description = "Run tests in watch mode"
run = "npm test -- --watch"
[tasks."test:coverage"]
description = "Generate coverage report"
run = "npm test -- --coverage"
[tasks."test:e2e"]
description = "Run end-to-end tests"
depends = ["build"]
run = "playwright test"
Database Workflow
[tasks."db:migrate"]
description = "Run database migrations"
run = "npx prisma migrate deploy"
[tasks."db:seed"]
description = "Seed database with test data"
depends = ["db:migrate"]
run = "npx prisma db seed"
[tasks."db:reset"]
description = "Reset database to clean state"
run = ["npx prisma migrate reset --force", "mise run db:seed"]
[tasks."db:studio"]
description = "Open Prisma Studio"
run = "npx prisma studio"
Linting & Formatting
[tasks.lint]
description = "Lint code"
sources = ["src/**/*.ts"]
run = "eslint src"
[tasks.format]
description = "Format code"
sources = ["src/**/*.ts"]
run = "prettier --write src"
[tasks."lint:fix"]
description = "Lint and auto-fix issues"
run = "eslint src --fix"
[tasks.check]
description = "Run all checks"
depends = ["lint", "format", "test"] # Runs in parallel
Deployment Pipeline
[tasks.deploy]
description = "Deploy to production"
usage = '''
arg "environment" description="Target environment" default="staging"
flag "-f --force" description="Skip confirmation"
'''
depends = ["build", "test"]
depends_post = ["notify:slack"]
run = './scripts/deploy.sh {{arg(name="environment")}} {{flag(name="force")}}'
[tasks."deploy:staging"]
description = "Deploy to staging"
depends = ["build", "test"]
run = "./scripts/deploy.sh staging"
[tasks."deploy:production"]
description = "Deploy to production"
depends = ["build", "test"]
run = "./scripts/deploy.sh production"
[tasks."notify:slack"]
hide = true
run = 'curl -X POST $SLACK_WEBHOOK -d "Deployment complete"'
Docker Integration
[tasks."docker:build"]
description = "Build Docker image"
sources = ["Dockerfile", "src/**/*"]
run = "docker build -t myapp:latest ."
[tasks."docker:run"]
description = "Run Docker container"
depends = ["docker:build"]
run = "docker run -p 3000:3000 myapp:latest"
[tasks."docker:compose"]
description = "Start services with docker-compose"
run = "docker-compose up -d"
Go Plugin Build System
[tasks."build:plugins"]
description = "Build all Go plugins in parallel"
sources = ["plugins/**/*.go"]
outputs = ["plugins/**/main.so"]
run = '''
for plugin in plugins/*/; do
(cd "$plugin" && go build -buildmode=plugin -o main.so main.go) &
done
wait
'''
[tasks."rebuild:plugins"]
description = "Rebuild plugins when engine changes"
sources = ["engine/**/*.go"]
depends = ["build:engine"]
run = "mise run build:plugins"
</common_patterns>
<environment_patterns> Environment-Specific Variables
[vars]
# Default development values
api_url = "http://localhost:3000"
db_host = "localhost"
db_port = "5432"
debug_mode = "true"
# Load additional vars from .env
_.file = ".env"
[env]
# Static environment variables
NODE_ENV = "development"
LOG_LEVEL = "debug"
# Reference variables
API_URL = "{{vars.api_url}}"
DATABASE_URL = "postgres://{{vars.db_host}}:{{vars.db_port}}/myapp"
DEBUG = "{{vars.debug_mode}}"
[tasks.dev]
env = {
NODE_ENV = "development",
API_URL = "{{vars.api_url}}"
}
run = "npm run dev"
Multi-Environment Setup
# mise.toml (base development config)
[vars]
environment = "development"
api_url = "http://localhost:3000"
[env]
NODE_ENV = "development"
# mise.staging.toml
[vars]
environment = "staging"
api_url = "https://api.staging.example.com"
[env]
NODE_ENV = "staging"
# mise.production.toml
[vars]
environment = "production"
api_url = "https://api.example.com"
debug_mode = "false"
[env]
NODE_ENV = "production"
Secret Management
# mise.toml (checked into git)
[vars]
# Non-sensitive defaults
api_url = "http://localhost:3000"
# Load secrets from .env (gitignored)
_.file = ".env"
[env]
# Reference secrets loaded from .env
API_KEY = "{{vars.api_key}}"
DATABASE_PASSWORD = "{{vars.db_password}}"
# .env (NOT in git)
api_key=secret-key-here
db_password=secret-password
</environment_patterns>
<workflow_steps> When helping with mise configurations:
Assess Current State
Design Architecture
Implement Configuration
Optimize Performance
jobs limitValidate and Test
mise install to verify tool installation<migration_from_asdf> From .tool-versions to mise.toml
.tool-versions:
nodejs 20.10.0
python 3.11.6
golang 1.21.5
terraform 1.6.6
mise.toml:
[tools]
node = "20.10.0"
python = "3.11.6"
go = "1.21.5"
terraform = "1.6.6"
Migration command:
# Mise can read .tool-versions directly
mise install
# Or convert to mise.toml
mise use node@20.10.0 python@3.11.6 go@1.21.5 terraform@1.6.6
</migration_from_asdf>
<migration_from_make> From Makefile to mise.toml
Makefile:
.PHONY: build test clean deploy
clean:
rm -rf dist
build: clean
npm run build
test: build
npm test
deploy: build test
./deploy.sh
mise.toml:
[tasks.clean]
description = "Remove build artifacts"
run = "rm -rf dist"
[tasks.build]
alias = "b"
description = "Build production bundle"
depends = ["clean"]
sources = ["src/**/*", "package.json"]
outputs = ["dist/**/*"]
run = "npm run build"
[tasks.test]
alias = "t"
description = "Run tests"
depends = ["build"]
run = "npm test"
[tasks.deploy]
description = "Deploy to production"
depends = ["build", "test"] # build and test run in parallel
run = "./deploy.sh"
Advantages:
<migration_from_npm> From package.json scripts to mise.toml
package.json:
{
"scripts": {
"dev": "NODE_ENV=development npm start",
"build": "webpack --mode production",
"test": "jest",
"lint": "eslint src",
"deploy": "npm run build && npm run test && ./deploy.sh"
}
}
mise.toml:
[tasks.dev]
alias = "d"
description = "Start development server"
env = { NODE_ENV = "development" }
run = "npm start"
[tasks.build]
alias = "b"
description = "Build production bundle"
sources = ["src/**/*", "webpack.config.js"]
outputs = ["dist/**/*"]
run = "webpack --mode production"
[tasks.test]
alias = "t"
description = "Run tests"
run = "jest"
[tasks.lint]
description = "Lint code"
sources = ["src/**/*.js"]
run = "eslint src"
[tasks.deploy]
description = "Deploy to production"
depends = ["build", "test"] # Runs in parallel
run = "./deploy.sh"
Advantages:
<migration_from_direnv> From .envrc to mise.toml
.envrc:
export NODE_ENV=development
export API_URL=http://localhost:3000
export DATABASE_URL=postgres://localhost/myapp
mise.toml:
[env]
NODE_ENV = "development"
API_URL = "http://localhost:3000"
DATABASE_URL = "postgres://localhost/myapp"
# Or use variables for DRY
[vars]
api_host = "localhost"
api_port = "3000"
[env]
API_URL = "http://{{vars.api_host}}:{{vars.api_port}}"
Advantages:
<ci_integration> GitHub Actions
name: CI
on: [push, pull_request]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup mise
uses: jdx/mise-action@v2
with:
version: latest # or specific version
- name: Install tools and dependencies
run: mise install
- name: Run tests
run: mise run test
- name: Build
run: mise run build
GitLab CI
image: ubuntu:latest
before_script:
- curl https://mise.run | sh
- export PATH="$HOME/.local/bin:$PATH"
- mise install
test:
script:
- mise run test
build:
script:
- mise run build
Docker
FROM ubuntu:latest
# Install mise
RUN curl https://mise.run | sh
ENV PATH="/root/.local/bin:$PATH"
# Copy project files
COPY . /app
WORKDIR /app
# Install tools and dependencies
RUN mise install
# Run build
RUN mise run build
CMD ["mise", "run", "start"]
</ci_integration>
<common_issues> Tool Not Found / Wrong Version
# Symptom: Command not found or using system version
mise ls # List installed tools
mise install # Install missing tools
mise use node@20 # Set specific version
mise doctor # Diagnose configuration
which node # Verify mise shim
mise reshim # Rebuild shims if needed
Task Not Found
# Symptom: "Task 'xyz' not found"
mise tasks ls # List all tasks
mise config # Show active config files
cat mise.toml # Verify task definition
mise tasks info <task> # Get task details
Task Caching Issues
# Symptom: Task not re-running when files change
[tasks.build]
sources = ["src/**/*"] # Check glob patterns are correct
outputs = ["dist/**/*"] # Verify output paths match actual outputs
run = "npm run build"
# Debug: Remove outputs and re-run
# rm -rf dist && mise run build
Environment Variables Not Loading
# Symptom: Environment variables not set in tasks
mise config # Verify mise.toml location (project root)
mise run --verbose <task> # Check env loading with verbose output
mise doctor # Diagnostic check
env | grep VAR_NAME # Check if var is actually set
Cross-Platform Issues
# Symptom: Task fails on Windows
[tasks.build]
run = "npm run build" # Use cross-platform commands
run_windows = "npm.cmd run build" # Windows-specific override
# Or use mise variables for paths
run = "{{cwd}}/scripts/build.sh"
Parallel Execution Not Working
# Symptom: Tasks running sequentially instead of parallel
[tasks.ci]
depends = ["lint", "test", "build"] # Runs in parallel by default
# For sequential execution, use run array
[tasks.sequential]
run = [
"mise run step1",
"mise run step2",
"mise run step3"
]
Tool Installation Fails
# Symptom: mise install fails for a tool
mise doctor # Check for system dependencies
mise ls-remote node # List available versions
mise install node@20 --verbose # Verbose installation
mise cache clear # Clear cache and retry
</common_issues>
<best_practices> Tool Management:
Task Configuration:
Environment Management:
Performance:
Cross-Platform:
Team & CI:
mise doctor </best_practices>When creating mise configurations:
mise run commandsmise install when setting up tools<example_setup> User: "Setup mise for my Node.js project"
Response:
# mise.toml
[tools]
node = "20.10.0"
[env]
NODE_ENV = "development"
[tasks.install]
description = "Install dependencies"
run = "npm install"
[tasks.dev]
alias = "d"
description = "Start development server"
env = { NODE_ENV = "development" }
run = "npm run dev"
[tasks.build]
alias = "b"
description = "Build for production"
sources = ["src/**/*", "package.json"]
outputs = ["dist/**/*"]
env = { NODE_ENV = "production" }
run = "npm run build"
[tasks.test]
alias = "t"
description = "Run tests"
run = "npm test"
Setup:
mise install # Install Node.js 20.10.0
mise run install # Install npm dependencies
mise dev # Start development server
</example_setup>
<example_polyglot> User: "I have a project with Python backend and Node frontend"
Response:
# mise.toml
[tools]
node = "20.10.0"
python = "3.11.6"
[env]
PROJECT_ROOT = "{{cwd}}"
[tasks."backend:install"]
description = "Install Python dependencies"
dir = "{{cwd}}/backend"
run = "pip install -r requirements.txt"
[tasks."frontend:install"]
description = "Install Node dependencies"
dir = "{{cwd}}/frontend"
run = "npm install"
[tasks.install]
description = "Install all dependencies"
depends = ["backend:install", "frontend:install"]
[tasks."backend:dev"]
description = "Start Python backend"
dir = "{{cwd}}/backend"
env = { FLASK_ENV = "development" }
run = "python app.py"
[tasks."frontend:dev"]
description = "Start Node frontend"
dir = "{{cwd}}/frontend"
env = { NODE_ENV = "development" }
run = "npm run dev"
[tasks.dev]
description = "Start both frontend and backend"
depends = ["backend:dev", "frontend:dev"]
Usage:
mise install # Install both Node and Python
mise run install # Install all dependencies
mise dev # Start both services in parallel
</example_polyglot>
<anti_patterns> Don't:
Do:
mise doctor before committingWeekly Installs
102
Repository
GitHub Stars
12
First Seen
Jan 21, 2026
Security Audits
Gen Agent Trust HubFailSocketPassSnykPass
Installed on
opencode80
codex76
cursor74
gemini-cli71
github-copilot68
kimi-cli62
React 组合模式指南:Vercel 组件架构最佳实践,提升代码可维护性
116,600 周安装
mise tasks ls to verify task registrationmise run <task>mise doctor for diagnostics </workflow_steps>