aliuqq
v0.0.4
Published
Extensible terminal-first CLI for downloads, video tools, and password generation.
Readme
AliuQ CLI
一个以终端交互流程为核心的个人命令行助手,主编排层使用 Node.js / TypeScript,能力层可接入 Node 原生实现、shell、PowerShell、Python 和第三方命令行工具
当前 MVP 已包含:
- 文件下载:支持
Node.js / Python / curl / wget - 视频下载:集成
yt-dlp - 密码生成:安全默认值,可交互也可脚本化
- GitHub API Rate Limit:支持环境变量或显式传入 token
- 国际化:使用
i18next+ JSON 语言文件,当前支持zh-CN / en,并预置 VS Codei18n-ally配置 - npm 发布工作流:包含 CI 与 publish 配置
快速开始
bun install
bun run build
node dist/cli/index.mjs --help开发模式:
bun run dev --help切换语言:
bun run dev --locale en --help命令示例
下载文件:
bun run dev download https://example.com/file.zip --via python --output ./downloads/file.zip使用 yt-dlp 下载视频:
bun run dev video "https://www.youtube.com/watch?v=dQw4w9WgXcQ" --output "%(title)s.%(ext)s"生成密码:
bun run dev password 24 --count 3 --exclude-similar检查 GitHub API Rate Limit:
GITHUB_TOKEN=ghp_xxx bun run dev github-rate-limit架构概览
src/
cli/ # 入口、全局选项、运行时装配
commands/ # download / video / password / github-rate-limit 命令
workflows/ # 交互式输入与共享 prompt 封装
services/ # 任务执行、工具发现
executors/ # Node / shell / PowerShell / external tool 抽象
integrations/ # curl / wget / yt-dlp 参数适配
config/ # 默认配置与用户配置加载
utils/ # 错误模型与日志
test/
unit/ # 核心单元测试配置
默认会从 ~/.aliuq/config.json 读取配置,可覆盖下载目录、日志级别、工具优先级和密码默认策略
示例:
{
"locale": "zh-CN",
"fallbackLocale": "en",
"paths": {
"downloadDir": "./downloads"
},
"tools": {
"downloadPreference": ["python", "curl", "node", "wget"]
},
"password": {
"defaultLength": 24,
"excludeSimilar": true
}
}流程图设计文件
每个功能目录下都包含对应的 flow.json,用于描述步骤、条件分支和流向:
src/commands/download/flow.jsonsrc/commands/video/flow.jsonsrc/commands/password/flow.jsonsrc/commands/github-rate-limit/flow.json
常用脚本
bun run lint
bun run typecheck
bun run test
bun run build
bun run check发布
- CI:
.github/workflows/ci.yml - npm 发布:
.github/workflows/publish.yml - 版本升级:
bun run release
