# node-cli-test **Repository Path**: seaxtest/node-cli-test ## Basic Information - **Project Name**: node-cli-test - **Description**: 命令cli - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-03-29 - **Last Updated**: 2026-03-29 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # @seaxlab/cli 基于 Node.js 的命令行工具,包作用域为 **seaxlab**。用于在终端查看版本与帮助、当前系统用户,以及读写本 CLI 使用的本地 JSON 配置文件。 ## 功能概览 | 能力 | 说明 | |------|------| | 版本 | `--version` / `-v` 输出来自 `package.json` 的版本号 | | 帮助 | `--help` / `-h` 输出用法、子命令与选项 | | 欢迎横幅 | 无子命令且非仅打印版本/帮助时,显示 `cli-welcome` 横幅(可用 `-c` 清屏) | | 当前用户 | `seaxlab user` 输出 `os.userInfo()`(用户名、uid/gid、主目录、shell 等) | | 配置文件 | `seaxlab config …` 查看路径、展示/读取/写入 JSON(键支持 `a.b` 点路径) | ## 配置文件位置 遵循常见 Linux/macOS 习惯: - 若设置了环境变量 **`XDG_CONFIG_HOME`**:`/seaxlab/config.json` - 否则:**`~/.config/seaxlab/config.json`** ## 安装与本地开发 ```bash npm install npm link # 可选:将全局命令 `seaxlab` 指向当前包 npm unlink -g ``` ## 用法示例 ```bash seaxlab -v seaxlab -h seaxlab user seaxlab config path seaxlab config show seaxlab config get api.url seaxlab config set api.url "https://example.com" ``` `config set` 的值会尝试按 JSON 解析;解析失败则按普通字符串保存。 ## 技术栈 - [meow](https://github.com/sindresorhus/meow) 解析参数与帮助 - [cli-welcome](https://github.com/ahmadawais/cli-welcome) 等 NodeCLI 生态依赖(与 [create-node-cli](https://github.com/ahmadawais/create-node-cli) 模板一致) ## 要求 - Node.js **>= 18** ## 许可证 见 `package.json` 中的 `license` 字段。