alex-c-line

中文文档
2.17.0发布于 2026/11/03MITTypeScriptESM + CJS构建来源已验证

Command-line tool with commands to streamline the developer workflow.

原始使用文档
文档目录5 节
  1. Installation
  2. Quick start
  3. Configs
  4. Documentation
  5. The Official alex-c-line Theme Song

alex-c-line

npm version npm downloads npm license

CI Publish to NPM Registry and GitHub Releases

alex-c-line artwork

This is my command-line tool, which serves as a developer toolkit that can be used in any repository to streamline the developer workflow. It provides a flexible configuration system so you can customise its behaviour to match your workflow.

alex-c-line is designed to be developer-first, opinionated where it matters, and safe by default, especially when mutating repository state.

Installation

To install the command-line tool, you can do this locally per working repository using the following command:

npm install alex-c-line

npm may be replaced with your package manager of choice.

Alternatively, you can install it globally for usage all throughout your system, in any working repository. This will allow you to then use alex-c-line in repositories that may not even necessarily support it directly, so you can still feel the benefits of some of the more context-agnostic commands.

npm install -g alex-c-line

Quick start

You can use any command by typing out alex-c-line in the terminal, followed by the command you want to run. For example:

alex-c-line say-hello

Some commands may even take extra arguments. For example:

alex-c-line version increment v1.2.3 major

Flags may also be passed through in the following way.

alex-c-line version increment v1.2.3 major --no-prefix

Note that for local-package use specifically, you will need to add -- before the local alex-c-line arguments to ensure that all flags get passed through correctly. Example:

alex-c-line local-package use alex-c-line -- version increment v1.2.3 major --no-prefix

Configs

Some commands also support usage of the config system. For example, pre-commit supports the alex-c-line.config.js file, and local-package use supports the more user-specific .alex-c-line.private.config.js file. alex-c-line.config.js is intended for shared configurations per repository, whereas .alex-c-line.private.config.js are for configurations specific to the user's usage.

The configs subpath provides some helper functions and types that may be helpful when constructing these configs. Namely, defineAlexCLineConfig can be used as a type helper, so that you get better type hints in the editor.

import { defineAlexCLineConfig } from "alex-c-line/configs";

export default defineAlexCLineConfig({
  template: {
    pullRequest: {
      category: "general",
      projectType: "package",
    }
  },
  preCommit: {
    packageManager: "pnpm",
    steps: ["build", "format", "lint", "test"],
  },
})

Alternatively, you can create a TypeScript file, then build it to a pure JavaScript file, and the benefit of that is that you'd be able to use the types directly instead, which may be better as it even takes a type argument for the pre-commit steps.

import type { AlexCLineConfig } from "alex-c-line/configs";

import { scripts } from "./package.json" with { type: "json" };

const alexCLineConfig: AlexCLineConfig<keyof typeof scripts> = {
  template: {
    pullRequest: {
      category: "general",
      projectType: "package",
    }
  },
  preCommit: {
    packageManager: "pnpm",
    steps: ["build", "format", "lint", "test"],
  },
};

export default alexCLineConfig;

Note, however, that we do not support directly running config files with TypeScript just yet. This may be planned in the near future, but for now, building the pure TypeScript file to pure JavaScript and using that as the config file is the best bet as of now.

Private configs can be treated in the same way, except the type would be AlexCLinePrivateConfig, and the function defineAlexCLinePrivateConfig. Please also note that if you create a private config in a shared repository, it MUST be added to .gitignore so that it stays user-specific and does not get included in version control.

Documentation

A full documentation site is coming soon. In the meantime, you may run alex-c-line --help for more information about how to use all commands.

The Official alex-c-line Theme Song

Here's the official lyric video for the alex-c-line theme song:

Watch on YouTube

版本与发布记录

alex-c-line 共发布 147 个版本,首次发布于 2025/07/21;过去 12 个月发布了 122 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
2.17.0latest2026/11/03今天
2.16.92026/11/03今天
2.16.82026/11/021 天前
2.16.72026/10/258 天前
2.16.62026/10/249 天前
2.16.52026/10/2311 天前

关于 alex-c-line 的常见问题

alex-c-line 是什么?

命令行工具与命令,以简化开发人员的工作流程。

如何安装 alex-c-line?

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

alex-c-line 支持 TypeScript 吗?

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

alex-c-line 支持 ESM 还是 CommonJS?

同时提供 ES Module 与 CommonJS 入口,import 和 require() 都可以使用,打包工具会自动选择合适的版本。

alex-c-line 需要什么版本的 Node.js?

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

alex-c-line 可以商用吗?

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

alex-c-line 还在维护吗?

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