qcli 2.4.1

dotnet tool install --global qcli --version 2.4.1
                    
This package contains a .NET tool you can call from the shell/command line.
dotnet new tool-manifest
                    
if you are setting up this repo
dotnet tool install --local qcli --version 2.4.1
                    
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=qcli&version=2.4.1
                    
nuke :add-package qcli --version 2.4.1
                    

QuickCli - 跨平台快速启动器

一个跨平台快速启动工具,通过命令行快速打开文件夹、文件、URL,支持别名管理和 CLI 工具桥接。

安装

跨平台安装 (推荐)

# 安装 .NET SDK (如果尚未安装)
# Windows: https://dotnet.microsoft.com/download
# Linux: curl -sSL https://dot.net/v/dotnet-sdk.sh | sudo -E bash -s

# 安装工具
dotnet tool install -g qcli

# 验证安装
q --help

dotnet tool install -g qcli

如果安装在非 PATH 位置,添加路径

echo 'export PATH="$HOME/.dotnet/tools:$PATH"' >> ~/.bashrc source ~/.bashrc


安装后使用 `q` 命令:

```bash
q --help

快速开始

# 添加别名(自动识别类型)
q add soft ~/Software           # 路径别名 (Linux)
q add soft D:/Software          # 路径别名 (Windows)
q add gh https://github.com     # Web 别名
q add c claude                  # CLI 工具别名

# 使用别名
q soft                          # 打开文件夹
q gh                            # 打开 URL
q c --help                      # 执行 claude --help

命令参考

别名管理

命令 说明 示例
q add <name> <target> 添加别名(自动识别类型) q add soft ~/Software
q edit <name> <target> 更新别名 q edit soft ~/Apps
q del <name> 删除别名 q del soft
q list [type] 列出别名 q list
q search <keyword> 搜索别名 q search soft

打开方式

命令 说明 示例
q <name> 打开别名(自动识别) q soft
q cd <target> 打开文件夹 q cd ~/Work
q web <target> 打开 URL q web github.com
q add <name> <target> [type] 添加别名 q add mycmd "ps: Get-Process"

文本模板

命令 说明 示例
q t 列出模板 q t
q t <name> 复制到剪贴板 q t mail
q t <text> <name> 添加模板 q t my@email.com mail

其他命令

命令 说明
q clean 清理无效配置
q setup 安装系统快捷命令
q del setup 卸载系统快捷命令
q --version 显示版本
q --help 显示帮助

快捷别名

单字符快捷命令,安装后可直接使用:

命令 说明
qt [name] 文本模板
qa <name> <target> 添加别名
qe <name> <target> 编辑别名
qd <name> 删除别名
ql [type] 列出别名
qs <keyword> 搜索别名
qc 清理无效配置

安装快捷命令:q setup

跨平台配置

数据存储

Windows:

  • 数据库:%APPDATA%/Quick/qcli.db3 (SQLite)
  • 日志:%APPDATA%/Quick/logs/

Linux (XDG 标准):

  • 数据库:~/.local/share/qcli/qcli.db3 (SQLite)
  • 日志:~/.local/share/qcli/logs/

系统快捷命令

Windows:

  • 位置:%USERPROFILE%/.dotnet/tools/*.cmd
  • 示例:qt.cmd, qa.cmd

Linux:

  • 位置:~/.local/bin/q*
  • 示例:qt, qa
  • 需要将 ~/.local/bin 添加到 PATH

自动类型识别

q add 命令会自动识别目标类型:

目标格式 识别类型 示例
http(s)://... Web URL https://github.com
存在的路径 文件/文件夹 ~/Software
其他 CLI 命令 claude

使用示例

路径别名

q add work ~/Work           # 添加路径别名 (Linux)
q work                       # 打开文件夹
q cd work                    # 同上(明确指定类型)

Web 别名

q add gh https://github.com  # 添加 Web 别名
q gh                         # 打开 URL
q web gh                     # 同上

CLI 工具桥接

q add c claude               # 添加 CLI 别名
q c --help                   # 执行 claude --help
q c chat                     # 执行 claude chat

文本模板

q t my@email.com mail        # 添加文本模板
q t mail                     # 复制到剪贴板

搜索别名

q search work                # 搜索包含 "work" 的别名
q s soft                     # 简写形式

开发

构建

构建

dotnet build src/Quick/Quick.csproj -c Release

运行测试

dotnet test src/Quick.Tests/Quick.Tests.csproj

AOT 发布 (可选,用于独立分发)

Windows AOT:

dotnet publish src/Quick/Quick.csproj -c Release -r win-x64 --self-contained -p:PublishSingleFile=true -p:PublishAot=true -o ./publish/win-x64

Linux AOT:

dotnet publish src/Quick/Quick.csproj -c Release -r linux-x64 --self-contained -p:PublishSingleFile=true -p:PublishAot=true -o ./publish/linux-x64

打包工具

dotnet pack src/Quick/Quick.csproj -c Release
dotnet pack -c Release

安装本地版本

dotnet tool install -g --add-source ./src/Quick/nupkg qcli

平台特定功能

功能 Windows Linux
.lnk 快捷方式 支持 不支持(显示警告)
explorer.exe 打开文件夹 支持 使用 xdg-open
系统快捷命令 .cmd 文件 Shell 脚本

更新日志

v2.3.2

  • 新增跨平台支持(Linux)
  • 添加 IPlatformService 抽象层
  • 支持 XDG 标准路径(Linux)
  • 使用 xdg-open 替代 explorer.exe(Linux)

v2.3.1

  • 修复 Windows CMD 中文编码问题(添加 chcp 65001)
  • 新增系统快捷命令安装/卸载(q setup / q del setup)
  • 快捷别名支持(qt, qa, qd, ql, qs, qe, qc)

v2.3.0

  • 从 LiteDB 迁移到 SQLite(AOT 兼容)
  • 移除 Serilog,使用内置日志
  • 添加 Source Generated JSON

v2.2.2

  • 新增 q edit 命令更新别名
  • 新增 q search 命令搜索别名
  • 新增 q --version 显示版本
  • 优化代码结构,提取 CommandExecutor
  • 修复异步调用模式
  • 改进测试隔离,避免数据库锁定

v2.2.0

  • 使用 LiteDB 替代 JSON 存储
  • 统一 q add 命令自动识别类型
  • 新增文本模板功能
  • 新增 CLI 工具桥接
  • 新增 q clean 清理无效配置

许可证

MIT License

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

Version Downloads Last Updated
2.4.1 113 4/18/2026
2.3.7 108 4/6/2026
2.3.6 99 4/5/2026
2.3.5 109 4/5/2026
2.3.2 107 4/5/2026
2.3.1 103 4/5/2026
2.2.0 111 4/5/2026
2.1.0 115 4/5/2026
2.0.0 105 4/5/2026