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

aictx-cli

v1.2.1

Published

Context as Code (CaC) CLI for AI-Assisted Engineering

Downloads

37

Readme

License: MIT npm version Build Status PRs Welcome

aictx-cli (AI Context CLI) 是一款专为 AI 辅助编程(Trae/Cursor/Windsurf 等)打造的 Context as Code (CaC) 基础设施。它就像是给你的 AI 助手外接了一个永久记忆与防腐装甲。

我们只解决 AI 编程时代最折磨人的两个痛点:

  1. “金鱼记忆”的 AI:每次开新窗口都要重复交代技术栈,AI 动不动就写错库、用错 API。
  2. “上下文撑爆”的 AI:每次让 AI 看旧代码都要消耗海量 Token,不仅贵,而且极易导致 AI 胡编乱造(幻觉)。

aictx 通过独创的 MOC (Map of Content) 双链路由纯本地 AST 逆向接盘引擎,帮你白嫖大模型、秒接盘烂代码


💡 为什么你需要 aictx?

无论你是追求极客效率的独立开发者,还是天天接外包修 Bug 的“接单侠”,aictx 都能带来物理级别的降维打击。

🥷 场景 A:独立黑客 (Indie Hacker) 的永久外脑

当你同时维护 3 个独立产品时,每次切换项目,AI 都会搞混技术栈。 有了 aictx,只需在根目录执行 aictx sync,你个人的数据库偏好、UI 组件库版本、API 封装规范瞬间无缝写入 Cursor/Trae 的底层配置。AI 瞬间切换大脑,沟通成本直降 40%,接下来的每一行代码都完美契合该项目的架构。

🌍 场景 B:跨 AI IDE 游牧者 (AI Nomad) 的统一底座

白天在公司用 Cursor(有团队额度),晚上回家用 Trae(因为免费),偶尔尝鲜 Windsurf。不同的 AI IDE 性格迥异,经常把同一个项目的代码风格写得四分五裂。 通过 aictx,你只需要维护一份核心架构规则,执行 aictx sync 就能一键同时分发到所有 IDE(.cursorrules, .trae/rules 等)。无论用什么工具,AI 吐出的代码规范永远 100% 保持一致,彻底终结“不同 AI 写代码打架”的惨状。

🛠️ 场景 C:外包接单侠 (Freelancer) 秒接盘“祖传屎山”

客户丢来一个 5 年历史、十几万行的屎山项目让你修 Bug。直接让 AI 看?不仅 Token 爆炸,还疯狂产生幻觉。 执行 aictx init --onboard。1 秒内,aictx 在**纯本地(零 Token、不泄露代码)**扫描提取出精准的物理依赖拓扑。再复制生成的“上帝提示词”给 AI,它就能瞬间给你出一份真实的 PRD 和架构分析。让 AI 读高浓度摘要,而不是读全集,Token 消耗直降 90%。

🏢 终极形态:绑架企业级架构 (Tech Lead)

当团队里的个人开发者因为用了 aictx 效率翻倍且从不犯错后,顺理成章将 .trae/rules 提交到 Git 仓库。从此,“10 个 AI 助手写出 10 种不同架构”的灾难被彻底终结,团队级 AI 架构实现了强制统一。

✨ 核心特性

  • 🕵️ 逆向接盘神器 (Zero-LLM Onboarding) 专为棕地 (Brownfield) 项目设计。底层集成纯本地 Graphify AST 引擎,将十几万行代码压缩为千字物理拓扑图 (system-graph.md)。零云端 API 调用、绝对隐私安全,引导 IDE 完美反推现状,不再虚构重构计划。
  • 🗂️ 极致抠门:MOC 双链路由 (Index) 内置基于 Markdown Frontmatter 的 MOC 路由机制。大模型只需读取几十行的索引表,就能顺藤摸瓜精准命中所需的原子化文档。彻底抛弃昂贵且低效的“全局检索”,榨干每一滴 Token 的价值。
  • 🧩 开箱即用,零侵入 (Context Assembler) aictx sync 自动拉取你的模板,根据 tags 动态过滤,并一键注入到 Trae/Cursor/Windsurf 等 IDE。无需更改现有业务代码,只需一行命令即可为项目挂载 AI 防护装甲。
  • 让 AI 学会用工具 (IDE Skill Injection) 自动为项目挂载如 aictx-graphify (AST 本地查询) 等本地大模型 Skill。你只需对 AI 说“查一下依赖”,AI 就会自己调用本地引擎挖掘图谱。

🚀 快速开始

1. 安装

作为全局工具安装:

npm install -g aictx-cli
# 或使用 pnpm/yarn
pnpm add -g aictx-cli

2. 初始化配置

在你的项目根目录下执行:

# 全新项目 (Greenfield)
aictx init

# 存量老项目逆向接盘 (Brownfield) - 强烈推荐!
aictx init --onboard

老项目会自动进行零模型 AST 提取,并生成 IDE 引导上帝提示词 (God Prompt)。

3. 一键同步你的 AI 大脑

拉取并动态注入最新的上下文规范到当前 IDE:

aictx sync

🛠️ CLI 命令一览

设计哲学:无感化 (Invisible CLI) aictx 提倡降低开发者的认知负担。绝大多数命令由 AI 助手自动调用或通过工程钩子静默触发。

| 命令 | 描述 | 触发方式 (适用场景) | |---|---|---| | aictx init | 智能向导初始化 (支持新项目与存量项目逆向接管 --onboard) | 👤 人类手动 (首次接入 aictx 时执行一次) | | aictx sync | 解析、过滤并向 IDE 动态注入 AI 上下文规则 (Context Assembler) | 🪝 钩子静默 / 🤖 AI (拉取最新规约时) | | aictx index| 编译生成 MOC 双链路由表 | 🤖 AI 自动 (新建或修改文档后,刷新 AI 索引) | | aictx resolve| 交互式解决业务上下文冲突 | 👤 人类手动 (发现多个规则描述同一边界时介入) | | aictx doctor | 诊断本地规则漂移与 Token 健康度 | 🪝 钩子静默 (推荐绑定 Git pre-commit 钩子) |

输入 aictx <command> --help 可查看任何命令的详细用法。

🏗️ 架构愿景 (Roadmap)

aictx 致力于成为 AI 辅助编程时代的标准基础设施。无论是帮助个人开发者实现低 Token 的本地知识库闭环,还是帮助研发团队实现架构一致性:

  • [x] Phase 1: CLI 基础设施搭建
    • 核心指令脚手架 (init, sync, index, doctor, resolve, info)
    • 跨平台兼容构建
    • 自动 MOC 双链索引机制
  • [x] Phase 2: 规则解析与组装器引擎 (Context Assembler)
    • 动态 YAML 解析与 tags 路由过滤
    • 存量项目零模型 AST 逆向提取 (Zero-LLM Onboarding)
    • 终端 God Prompt 动态拼装
  • [x] Phase 3: IDE 与工作流深度集成
    • Trae / Cursor / Windsurf 原生配置注入 (.trae/rules, .cursorrules 等)
    • IDE 本地 Skill 智能生态融合 (aictx-graphify)
  • [ ] Phase 4: 企业级协同基建
    • 支持多源(Git, Local, HTTP)规则拉取与远端分发
    • CI/CD 流水线防腐拦截与架构卡点

🤝 参与贡献

我们非常欢迎来自社区的贡献!无论是提出 Issue、提交 PR,还是分享你在 Context as Code 方面的最佳实践。

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

📄 开源协议

本项目基于 MIT License 协议开源。