← 返回首页
🛠️

DevBox 开发工具箱🐧 Linux

🔖 版本: v2.1.0📦 大小: 85 MB📅 添加: 2026-08-17
创建时间:2026-08-17
#命令行#开发工具#CLI#效率

⚡ 一键安装命令

Terminal
# macOS (使用 Homebrew)
brew install devbox/tap/devbox

# Linux (使用 curl 一键安装)
curl -sSL https://get.devbox.example.com | bash

# 或者使用 npm 全局安装
npm install -g @devbox/cli

🔧 开机自启服务脚本

systemd service
[Unit]
Description=DevBox Development Service
After=network.target docker.service
Requires=docker.service

[Service]
Type=simple
User=devbox
Group=devbox
ExecStart=/usr/local/bin/devbox daemon --config /etc/devbox/config.yaml
ExecReload=/bin/kill -HUP $MAINPID
Restart=on-failure
RestartSec=5s
LimitNOFILE=65536
Environment=NODE_ENV=production

[Install]
WantedBy=multi-user.target

使用说明:

  1. 将脚本保存为 /etc/systemd/system/service-name.service
  2. 执行 sudo systemctl daemon-reload
  3. 执行 sudo systemctl enable service-name 设置开机自启
  4. 执行 sudo systemctl start service-name 启动服务

💻 命令行使用示例

$devbox --help
🇨🇳 查看所有可用命令和帮助信息🇬🇧 View all available commands and help information
输出:
DevBox CLI v2.1.0
Usage: devbox <command> [options]

Commands:
  init        初始化新项目
  dev         启动开发服务器
  build       构建生产版本
  deploy      部署到远程服务器
  daemon      以守护进程方式运行
  config      管理配置文件
  plugin      管理插件
  update      检查并更新

Options:
  -h, --help  显示帮助信息
  -v, --version 显示版本号
  -d, --debug 启用调试模式
$devbox init my-project --template react-ts
🇨🇳 使用 React + TypeScript 模板创建新项目🇬🇧 Create new project with React + TypeScript template
输出:
✓ Creating project 'my-project'
✓ Downloading template 'react-ts'...
✓ Installing dependencies...
✓ Setting up project structure...
✓ Git initialized

Project created successfully!
cd my-project && npm run dev
$devbox dev --port 3000 --hot
🇨🇳 启动开发服务器,端口 3000,启用热更新🇬🇧 Start dev server on port 3000 with hot reload
输出:
DevBox Dev Server v2.1.0
→ Local:   http://localhost:3000
→ Network: http://192.168.1.100:3000
→ Hot reload: enabled
→ Ready in 2.3s
$devbox build --production --minify
🇨🇳 构建生产版本,启用代码压缩优化🇬🇧 Build production version with minification
输出:
Building for production...
✓ Compiling TypeScript...
✓ Optimizing assets...
✓ Minifying code...
✓ Generating source maps...

Build complete in 12.5s
dist/
├── index.html (2.1 KB)
├── assets/
│   ├── index-abc123.js (128 KB)
│   └── index-def456.css (12 KB)
└── manifest.json
$devbox deploy --host server.example.com --user deploy --path /var/www/app
🇨🇳 一键部署到远程服务器🇬🇧 One-click deploy to remote server
输出:
→ Connecting to server.example.com...
✓ Connected
→ Uploading files...
✓ Files uploaded (12.3 MB)
→ Running post-deploy scripts...
✓ Services restarted
✓ Deployed successfully!
$devbox config set registry https://npm.example.com
🇨🇳 设置私有 npm 仓库地址🇬🇧 Set private npm registry URL
输出:
✓ Configuration updated
Registry: https://npm.example.com
Saved to ~/.devbox/config.yaml

工具简介

DevBox 是一款功能强大的跨平台命令行开发工具箱,旨在简化开发流程,提高团队协作效率。

核心功能

  • 🏗️ 项目脚手架:内置多种模板,快速初始化项目
  • 🔄 开发服务器:支持热更新、端口转发、环境变量管理
  • 📦 构建工具:多框架支持,生产级优化
  • 🚀 一键部署:支持 SSH、Docker、Kubernetes 等多种部署方式
  • 🔌 插件系统:丰富的官方和第三方插件
  • ⚙️ 配置管理:多环境配置,支持本地和远程

支持的平台

  • macOS (Apple Silicon / Intel)
  • Linux (x64 / ARM64)
  • Windows 10/11

系统要求

  • Node.js >= 18.0.0
  • 内存 >= 4GB
  • 磁盘空间 >= 2GB