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 🙏

© 2025 – Pkg Stats / Ryan Hefner

cli-history

v1.0.1

Published

Cross-CLI memory sharing and session recovery for any project

Readme

ShareCLI - 跨 CLI 会话共享工具

ShareCLI 是一个强大的工具,允许在不同 AI CLI 工具之间共享会话历史和上下文。通过简单的初始化,您可以在任何项目中使用 /history 命令来查看和恢复跨 CLI 的会话历史。

🚀 功能特性

  • 自动 CLI 扫描 - 自动检测本地安装的 AI CLI 工具
  • 交互式配置 - 通过友好的界面选择要集成的 CLI 工具
  • 项目感知 - 只显示当前项目相关的会话历史
  • 时间排序 - 按时间从近到远排序,最新的会话优先显示
  • 跨 CLI 搜索 - 在所有支持的 CLI 工具中搜索会话内容
  • 上下文恢复 - 一键恢复之前的讨论上下文,无缝继续工作

🛠️ 支持的 CLI 工具

| CLI 工具 | 支持级别 | 状态 | |---------|---------|------| | 🟢 Claude CLI | Native | ✅ 完全支持 | | 🔵 Gemini CLI | Native | ✅ 完全支持 | | 🟡 Qwen CLI | Native | ✅ 完全支持 | | 🔴 IFlow CLI | Hook-based | ✅ 支持 | | 🟣 CodeBuddy CLI | External | ✅ 支持 | | 🟠 QoderCLI | External | ✅ 支持 | | 🟪 Codex CLI | External | ✅ 支持 |

📦 安装

npm install -g sharecli

🎯 快速开始

1. 初始化项目

在您的项目目录中运行:

sharecli init

ShareCLI 将:

  • 🔍 扫描本地可用的 CLI 工具
  • 🎛️ 让您交互式选择要集成的工具
  • 🔨 自动生成集成代码
  • 📁 创建配置文件

2. 使用 /history 命令

在已集成的 CLI 工具中使用:

# 显示所有项目会话(最新优先)
/history

# 显示特定 CLI 的会话
/history --cli claude

# 搜索特定内容
/history --search "react"

# 显示今天的会话
/history --today

# 时间线视图
/history --format timeline

# 获取上下文恢复
/history --format context

📖 详细使用指南

命令选项

| 选项 | 描述 | 示例 | |------|------|------| | --cli <工具> | 显示特定 CLI 的会话 | /history --cli gemini | | --search <关键词> | 搜索会话内容 | /history --search "组件" | | --limit <数量> | 限制显示的会话数 | /history --limit 5 | | --format <格式> | 显示格式 | /history --format timeline | | --today | 今天的会话 | /history --today | | --week | 最近 7 天的会话 | /history --week | | --month | 最近 30 天的会话 | /history --month |

显示格式

  • summary (默认) - 摘要视图,按 CLI 分组显示
  • timeline - 时间线视图,按时间顺序显示
  • detailed - 详细视图,显示完整会话信息
  • context - 上下文视图,用于恢复讨论

🏗️ 项目结构

初始化后,您的项目将包含以下文件:

project-folder/
├── .sharecli                    # ShareCLI 配置文件
├── .claude/
│   └── hooks/
│       └── sharecli-history.js # Claude CLI 集成
├── .gemini/
│   └── extensions/
│       └── sharecli-history.js # Gemini CLI 集成
├── .qwen/
│   └── plugins/
│       └── sharecli-history.js # Qwen CLI 集成
├── stigmergy/
│   └── commands/
│       └── history.js          # IFlow CLI 集成
└── SHARECLI.md                 # 使用说明

🔧 命令参考

sharecli init

初始化项目以使用 ShareCLI。

sharecli init [options]

选项:

  • -f, --force - 强制重新初始化

sharecli status

查看当前项目的状态。

sharecli status

sharecli scan

扫描系统中可用的 CLI 工具。

sharecli scan [options]

选项:

  • -v, --verbose - 显示详细信息

🎮 使用场景

场景 1: 跨 CLI 继续工作

# 第一天:在 Claude CLI 中讨论 React 架构
# 第二天:在 Gemini CLI 中想继续昨天的工作

# 在项目中运行:
/history --format context

# 结果:自动获取昨天的讨论内容,无缝继续

场景 2: 项目知识搜索

# 查找项目中所有关于 "数据库优化" 的讨论
/history --search "数据库优化"

# 结果:显示所有 CLI 工具中相关的会话

场景 3: 团队协作

# 查看团队成员在不同 CLI 工具中的讨论
/history --format timeline

# 结果:按时间顺序显示所有相关讨论

🔍 工作原理

  1. CLI 检测 - ShareMem 扫描系统中的 AI CLI 工具
  2. 会话扫描 - 读取各 CLI 工具的会话文件
  3. 项目匹配 - 根据项目路径过滤相关会话
  4. 智能排序 - 按时间戳排序(最新优先)
  5. 上下文恢复 - 提供完整的讨论上下文

🤝 贡献

欢迎提交 Issue 和 Pull Request!

📄 许可证

MIT License

🆘 支持


ShareCLI - 让 AI CLI 工具之间的协作变得简单!🚀