定制 henzeb/cmdr 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

henzeb/cmdr

Composer 安装命令:

composer require henzeb/cmdr

包简介

A framework in pure bash

README 文档

README

Latest Version Total Downloads License

A pure Bash framework for crafting beautiful, reusable commands.

Every project accumulates scripts for mundane tasks — spinning up local environments, managing Kubernetes clusters, or running a test suite in a loop to catch flaky tests. They work, but they sprawl. New team members have no idea what exists, what arguments a script expects, or what it will actually do. The answer is usually a wall of --help text nobody wrote, or a wiki page nobody updated.

Tools like bashly and bash-it solve adjacent problems: bashly generates CLI apps from YAML but requires a build step and a Ruby runtime; bash-it is a personal shell framework for customizing your own environment, not for sharing commands with a team. Neither gives you a way to distribute a consistent set of commands through your project's own dependencies.

cmdr does. Install it per-project via Composer, add your functionality in the project's .cmdr directory and your whole team gets the same commands after composer install — with argument parsing, validation, interactive prompts, tab completion, and help pages built in. No build step. No runtime beyond Bash.

Features

  • Modules — organize commands into namespaced modules; add, override, or extend them per-project or globally
  • No build step — pure Bash, sourced directly; requires Bash 4.3+
  • Declarative args & options — define positional arguments and flags with types, defaults, and descriptions
  • Validation — 30+ built-in rules with support for custom rules and named groups
  • Interactive input — built-in prompts (text, confirm, select, multiselect) with validation support
  • Shell completion — tab completion for Bash, Zsh, and Fish
  • Hooks — event-driven extension points for modules
  • Scaffold generatorcmdr make module bootstraps a new module from a template
  • Composer-distributed — install globally or per-project like any other package

Installation

Requirements: Bash 4.3+. macOS ships with Bash 3.2 — install a modern version via Homebrew (brew install bash). Composer is required to install cmdr.

Global (available system-wide):

composer global require henze/cmdr

Make sure Composer's global bin directory is on your PATH. Run composer global config bin-dir --absolute to find the path, then add it to your shell config.

Per-project (shared with your team as a Composer dependency):

composer require --dev henze/cmdr
./vendor/bin/cmdr alias   # optional: creates a shell alias for this project

See docs/installation.md for full PATH setup instructions and how to combine both approaches.

Usage

cmdr help                          # list all available commands
cmdr <module> help                 # list commands in a module
cmdr <module> <subcommand>         # run a command
cmdr <module> <subcommand> --help  # show command help

Documentation

henzeb/cmdr 适用场景与选型建议

henzeb/cmdr 是一款 基于 Shell 开发的 Composer 扩展包,目前已累计 0 次下载、GitHub Stars 达 0, 最近一次更新时间为 2026 年 04 月 18 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 henzeb/cmdr 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 henzeb/cmdr 我们能提供哪些服务?
定制开发 / 二次开发

基于 henzeb/cmdr 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 0
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 19
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: Shell

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-04-18