npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@imkratos/tm-cli

v1.0.0

Published

一个基于CLI的任务管理工具,支持四象限模型和Vim风格交互

Readme

TM-CLI

NPM Version License: MIT TypeScript

一个基于四象限时间管理法的命令行任务管理工具,带有 Vim 风格的交互界面

特性安装使用命令开发贡献许可证

中文 | English


特性

  • 任务管理 - 创建、查看、完成、删除任务
  • 四象限分类 - 基于艾森豪威尔矩阵组织任务
    • Q1: 重要且紧急
    • Q2: 重要不紧急
    • Q3: 紧急不重要
    • Q4: 不重要不紧急
  • 🎨 彩色输出 - 清晰的 CLI 可视化
  • ⌨️ Vim 模式 - 支持 Vim 风格的键盘导航
  • 💾 本地存储 - 使用 SQLite 数据库本地存储数据
  • 🚀 快速高效 - 使用纯命令行操作
  • 📝 TypeScript - 使用 TypeScript 开发,类型安全

安装

方式 1: 通过 npm 安装(推荐)

# 全局安装
npm install -g @imkratos/tm-cli

# 验证安装
tm --version

方式 2: 通过 Homebrew 安装(macOS/Linux)

# 添加 tap
brew tap imkratos/tap

# 安装
brew install tm-cli

# 验证安装
tm --version

方式 3: 从源码安装

# 克隆仓库
git clone https://github.com/imkratos/tm-cli.git
cd tm-cli

# 安装依赖并构建
npm install
npm run build

# 创建全局链接
npm link

# 验证安装
tm --version

使用

添加任务

# 添加一个重要且紧急的任务
tm task add "完成项目报告" -q 1

# 添加一个重要不紧急的任务
tm task add "学习新技术" -q 2

查看任务

# 查看所有任务
tm task list

# 查看指定象限的任务
tm quadrant show 1

完成任务

# 根据 ID 完成任务
tm task complete 1

交互模式

# 启动交互界面
tm interactive
# 或简写
tm i

命令

基本语法

tm [command] [options]

Task 命令

添加任务

tm task add <description> -q <quadrant>

选项:

  • -q, --quadrant <number> - 象限编号 (1-4)

示例:

tm task add "紧急会议" -q 1

列出任务

tm task list [options]

选项:

  • -q, --quadrant <number> - 按象限过滤
  • -s, --status <status> - 按状态过滤 (pending/completed)

示例:

tm task list -q 1 -s pending

完成任务

tm task complete <id>

删除任务

tm task delete <id>

Quadrant 命令

显示象限任务

tm quadrant show <number>

示例:

tm quadrant show 1  # 显示 Q1 象限任务

查看所有象限

tm quadrant list

Cleanup 命令

清理已完成任务

tm cleanup [options]

选项:

  • -d, --days <number> - 清理指定天数前的任务
  • -a, --all - 清理所有已完成任务

示例:

tm cleanup -d 30  # 清理 30 天前的已完成任务
tm cleanup -a     # 清理所有已完成任务

交互模式

交互模式提供类似 Vim 的键盘操作:

  • j/k - 上下移动
  • h/l - 切换象限
  • a - 添加任务
  • d - 删除任务
  • x - 标记/取消完成
  • q - 退出

项目结构

tm-cli/
├── src/
│   ├── app.ts              # 主入口
│   ├── config.ts           # 配置文件
│   ├── commands/           # 命令实现
│   │   ├── task.ts         # 任务命令
│   │   ├── quadrant.ts     # 象限命令
│   │   └── cleanup.ts      # 清理命令
│   ├── db/                 # 数据库层
│   │   └── database.ts     # 数据库操作
│   ├── ui/                 # 用户界面
│   │   ├── cli.ts          # CLI 界面
│   │   └── interactive.ts  # 交互模式
│   └── utils/              # 工具函数
│       └── colors.ts       # 颜色工具
├── dist/                   # 编译输出
├── test/                   # 测试文件
├── package.json
├── tsconfig.json
└── README.md

开发

环境要求

  • Node.js >= 14.0.0
  • npm >= 6.0.0

开发流程

# 克隆仓库
git clone https://github.com/imkratos/tm-cli.git
cd tm-cli

# 安装依赖
npm install

# 开发模式
npm run dev

# 构建
npm run build

# 运行测试
npm test

技术栈

  • TypeScript - 类型安全的 JavaScript 超集
  • Commander.js - 命令行界面框架
  • Inquirer.js - 交互式命令行用户界面
  • Better-SQLite3 - 快速 SQLite3 数据库
  • Chalk - 终端字符串样式
  • Jest - JavaScript 测试框架

测试

# 运行所有测试
npm test

# 运行测试并生成覆盖率报告
npm test -- --coverage

贡献

欢迎贡献!请随时提交问题和拉取请求。

贡献流程

  1. Fork 本仓库
  2. 创建您的特性分支 (git checkout -b feature/AmazingFeature)
  3. 提交您的更改 (git commit -m 'Add some AmazingFeature')
  4. 推送到分支 (git push origin feature/AmazingFeature)
  5. 开启一个 Pull Request

代码规范

  • 使用 TypeScript
  • 遵循现有代码风格
  • 为新功能添加测试
  • 更新相关文档

更新日志

[1.0.0] - 2025-11-18

新增

  • 基础任务管理功能
  • 四象限分类管理
  • 交互式 CLI 界面
  • SQLite 本地数据存储
  • 任务清理功能

问题反馈

如果您发现 bug 或有功能建议,请提交 Issue

许可证

本项目采用 MIT 许可证 - 查看 LICENSE 文件了解详情

致谢

联系方式


如果这个项目对您有帮助,请给它一个星标 ⭐

Made with ❤️ by imkratos