devset

中文文档
1.0.3发布于 2026/11/03MITTypeScriptES Module

Universal, rule-based project analysis and automated environment setup tool

原始使用文档
文档目录11 节
  1. The Problem
  2. Key Features
  3. Terminal Experience
  4. CLI Commands
  5. Global Options
  6. Architecture Overview
  7. Supported Ecosystems
  8. Local Development & Testing
  9. Publishing to NPM
  10. Security
  11. License

DevSet CLI

One Command. Complete Setup.
Universal, deterministic, rule-based project analysis and automated environment setup tool.

License: MIT Node.js TypeScript Vitest Zero AI


The Problem

Whenever developers clone a full-stack repository or multi-service codebase, they typically spend 30–60 minutes:

  1. Figuring out which programming languages and frameworks are present.
  2. Locating nested frontend and backend manifests.
  3. Choosing between conflicting package managers (npm, yarn, pnpm, bun).
  4. Creating and activating Python virtual environments across Windows/macOS/Linux.
  5. Identifying missing environment variables.
  6. Opening multiple terminals to start each service individually.

DevSet CLI automates this entire workflow safely, locally, and deterministically.

# Clone any repo
git clone https://github.com/example/fullstack-app.git
cd fullstack-app

# Run DevSet
npx devset-cli

# Start all services together
npm run dev:all

Key Features

  • 100% Rule-Based & Local: Zero AI, zero external APIs, zero tokens, and zero network calls during project analysis. Works completely offline.
  • Deep Multi-Tier Detection: Identifies independent components (frontend, backend, admin, microservices) in monolithic and multi-directory repositories.
  • Deterministic Package Management: Automatically honors lockfiles (npm ci, yarn install --frozen-lockfile, pnpm install --frozen-lockfile, bun install --frozen-lockfile) and alerts on conflicting lockfiles.
  • Isolated Python Virtual Environments: Automatically creates .venv on Windows (.venv\Scripts\python.exe) and POSIX (.venv/bin/python), installing dependencies inside the virtualenv without polluting system Python.
  • Safe Environment Auditing: Compares .env.example against .env to highlight missing keys without ever exposing secret values.
  • Universal Multi-Service Runner: devset run starts frontend and backend services concurrently with formatted, colored prefix logs ([FRONTEND], [BACKEND]), live URL detection, and graceful process tree termination on Ctrl+C.
  • Safe Simulation: Built-in --dry-run flag to preview setup steps without making changes.
  • System Doctor: Built-in devset doctor diagnostics for installed runtimes (Node, Python, Java, Docker, Git).

Terminal Experience

╔════════════════════════════════════════════════╗
║                   DEVSET CLI                   ║
║          One Command. Complete Setup.          ║
╚════════════════════════════════════════════════╝

Scanning project...

✓ Node.js detected (language)
✓ TypeScript detected (language)
✓ React detected (framework)
✓ Vite detected (framework)
✓ Python detected (language)
✓ Django detected (framework)
✓ npm detected (package-manager)
✓ pip detected (package-manager)

PROJECT TYPE: FULLSTACK

FRONTEND (frontend)
  Framework: Vite
  Language: TypeScript
  Package Manager: npm

BACKEND (backend)
  Framework: Django
  Language: Python
  Package Manager: pip

ENVIRONMENT
  Example: .env.example
  Status: .env file missing (template available)

SETUP PLAN
  1. Verify Python runtime installation
  2. Verify Node.js runtime installation
  3. Create .env configuration
  4. Create Python virtual environment (.venv) for backend
  5. Install backend dependencies (pip)
  6. Install frontend dependencies (npm)
  7. Validate environment and dependency setup

? Proceed with setup and dependency installation? (Y/n)

CLI Commands

CommandDescription
devset (or npx devset-cli)Scan project, generate plan, and perform automated setup upon approval
devset analyze [dir]In-depth scan and tabular report of languages, frameworks, and manifests
devset setup [dir]Execute automated dependency setup
devset doctorCheck health and versions of Node, Python, package managers, and tools
devset runConcurrently run all configured development services with unified logs
devset cleanSafely remove DevSet-generated .venv and config files after confirmation

Global Options

  • --dry-run: Simulate analysis and setup plan without modifying files or installing packages.
  • --verbose: Show real-time subprocess stdout/stderr and debug traces.
  • -y, --yes: Skip interactive confirmation prompts and accept defaults.
  • --json: Format command output as raw JSON (supported by analyze and doctor).
  • -V, --version: Output installed CLI version.
  • -h, --help: Display command options and documentation.

Architecture Overview

DevSet follows a strict modular separation:

src/
├── cli/           # Commander CLI, options, banner, subcommands
├── scanner/       # Safe file system crawler and directory classifier
├── detectors/     # Scoring-based rules for languages, frameworks, package managers, databases, Docker, env
├── analyzers/     # Dependency, structure, and project analyzers
├── validators/    # Runtime, dependency, and environment verification
├── installers/    # NpmInstaller, PythonInstaller, JavaInstaller, DockerInstaller
├── core/          # PlanGenerator and ExecutionEngine
├── runner/        # ProcessManager and ServiceRunner
├── utils/         # Cross-platform process execution, logger, and filesystem
└── types/         # TypeScript interfaces and schemas

See docs/architecture.md for full architecture specifications.


Supported Ecosystems

EcosystemDetectedAutomated SetupMulti-Service Runner
Node.js (npm, yarn, pnpm, bun)YesYesYes
Python (pip, poetry, pipenv, uv)YesYesYes
Java (Maven / Gradle wrappers)YesYesDiagnostics
Docker & Docker ComposeYesOptionalDiagnostics
Databases (PostgreSQL, MySQL, SQLite, MongoDB, Redis)YesDiagnostics-
Rust / Go / PHP / Ruby / .NET / FlutterYesDetection-only (v1.0)-

See docs/supported-technologies.md for the complete list.


Local Development & Testing

# Clone the repository
git clone https://github.com/your-username/devset-cli.git
cd devset-cli

# Install development dependencies
npm install

# Build the project using tsup
npm run build

# Run unit and integration tests (Vitest)
npm test

# Link globally for local testing
npm link

# Test CLI
devset --help
devset doctor

Publishing to NPM

DevSet CLI is preconfigured for NPM publishing:

# 1. Login to NPM
npm login

# 2. Run verification (builds & runs tests automatically)
npm run prepublishOnly

# 3. Publish to NPM
npm publish --access public

Security

DevSet executes commands with strict argument arrays (execa(file, args[])), validates paths against directory traversal, never logs secrets or tokens, and never automatically deletes files. Read our docs/security.md for complete details.


License

MIT © DevSet Maintainers

版本与发布记录

devset 共发布 5 个版本,首次发布于 2026/11/03;过去 12 个月发布了 5 个版本。

版本发布日期距今
1.0.3latest2026/11/03今天
1.0.02026/11/03今天
0.0.0-stage2026/11/03今天
1.0.22026/11/012 天前
1.0.12026/11/012 天前

关于 devset 的常见问题

devset 是什么?

通用的,基于规则的项目分析和自动化环境设置工具

如何安装 devset?

在项目目录运行 npm install devset,或使用 pnpm add / yarn add / bun add。它还提供命令行工具 devset、devset-cli,可以用 npx devset 直接运行。

devset 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

devset 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

devset 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=18.0.0。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

devset 可以商用吗?

devset 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

devset 还在维护吗?

最新版本 1.0.3 发布于 2026/11/03(今天);至今共发布 5 个版本,其中过去 12 个月发布了 5 个;首次发布于 2026/11/03。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。