princekhan6496/CodeContext

GitHub: princekhan6496/CodeContext

一款离线跨平台的 CLI 代码文档生成工具,能自动扫描源码并输出适配开发者和 AI 的项目架构、依赖图及 API 映射等文档。

Stars: 0 | Forks: 0

# CodeContext ![Go](https://img.shields.io/badge/Go-1.22+-00ADD8?logo=go) ![License](https://img.shields.io/badge/License-MIT-blue) ![Platform](https://img.shields.io/badge/Platform-Windows%20%7C%20Linux%20%7C%20macOS-success) ## 功能 - 📄 适配 AI 的文档生成 - 🌳 文件夹树生成 - 🏗 架构概述 - 🔗 依赖关系图生成 - 📚 API 映射图生成 - ⚡ 增量缓存 - 🤖 通过 Ollama 可选的本地 AI 摘要生成 - 🔒 默认完全离线 - 🖥 跨平台(Windows、Linux、macOS) # 安装说明 ## 下载二进制文件(推荐) 从 **Releases** 页面下载最新的可执行文件。 | 平台 | 下载 | |----------|----------| | Windows x64 | `context-windows-amd64.exe` | | Linux x64 | `context-linux-amd64` | | Linux ARM64 | `context-linux-arm64` | | macOS Intel | `context-darwin-amd64` | | macOS Apple Silicon | `context-darwin-arm64` | 将其重命名为 `context`(或 `context.exe`),并根据需要添加到你的 PATH 中。 ## 从源码构建 需要 Go 1.22+ ``` git clone https://github.com/princekhan6496/CodeContext.git cd CodeContext go build -o bin/context ./cmd/context ``` # 快速开始 初始化 ``` context init ``` 生成文档 ``` context generate ``` 分析另一个项目 ``` context generate -path /path/to/project ``` # 生成的文档 ``` context-docs/ ├── context.md ├── architecture.md ├── folder_tree.md ├── dependency_graph.md └── api_map.md ``` # 启用 AI(可选) ``` context init -provider ollama -model llama3.1 -force context doctor context generate ``` # 架构 ``` cmd/context pkg/contextengine internal/ ├── analyzer ├── ai ├── cache ├── config ├── export ├── ignore ├── pipeline ├── scanner └── workerpool ``` # 嵌入 核心引擎以以下形式提供: ``` pkg/contextengine ``` 并且可以嵌入到编辑器、IDE 或桌面应用程序中。 # 测试 ``` go test ./... ``` 竞态检测器 ``` go test ./... -race ``` # 许可证 MIT 许可证
标签:AI辅助编程, AI风险缓解, C2, EVTX分析, Go, Ruby工具, SOC Prime, 代码分析, 凭证管理, 开发工具, 文档生成, 文档结构分析, 日志审计