
Security News
GitHub Actions Checkout Now Blocks Risky pull_request_target Checkouts
GitHub Actions checkout now blocks risky pull_request_target checkouts by default to help prevent pwn request supply chain attacks.
create-context-template
Advanced tools
CLI tool to scaffold LLM projects with context engineering architecture
CLI tool to scaffold context-template-cli projects - 快速创建基于上下文工程的 LLM 应用开发项目
# 使用 npm
npm install -g context-cli
# 使用 pnpm
pnpm add -g context-cli
# 使用 bun
bun add -g context-cli
创建新项目:
context-cli
# 或
create-context-app
然后按照提示操作:
创建项目后:
# 进入项目目录
cd my-ai-app
# 配置环境变量
cp .env.example .env
# 编辑 .env 文件,添加你的 DEEPSEEK_API_KEY
# 运行示例
npm run dev # 简单对话示例
npm run dev:tool # 工具调用示例
# 运行测试
npm run test
# 构建项目
npm run build
生成的项目包含以下模块:
my-ai-app/
├── llm/ # LLM 服务层
│ ├── services/ # LLM 提供商实现(DeepSeek)
│ ├── utils/ # 工具函数(executeToolLoop)
│ └── factory.ts # LLM 服务工厂
├── context/ # 上下文管理系统
│ ├── modules/ # 6 种上下文模块
│ └── ContextManager.ts # 统一管理器
├── tool/ # 工具管理系统
│ ├── FileReadTool/ # 文件读取工具
│ ├── GrepTool/ # 正则搜索工具
│ └── ToolManager.ts # 工具管理器
├── agent/ # Agent 编排(预留)
├── evaluationTemplate/ # 测试评估系统
├── utils/ # 工具函数
│ └── logger.ts # 日志工具
├── config/ # 配置管理
│ └── env.ts # 环境变量加载
└── examples/ # 使用示例
├── simple-chat.ts # 简单对话
└── tool-calling.ts # 工具调用
6 种上下文类型:
内置工具:
易于扩展,支持自定义工具。
import { createLLMService } from './llm/index.js';
import { loadEnv } from './config/env.js';
loadEnv();
const service = await createLLMService({
provider: 'deepseek',
model: 'deepseek-chat',
apiKey: process.env.DEEPSEEK_API_KEY,
});
const response = await service.simpleChat(
'Hello! Can you introduce yourself?',
'You are a helpful AI assistant.'
);
console.log('Assistant:', response);
import { createLLMService } from './llm/index.js';
import { ContextManager } from './context/index.js';
import { ToolManager } from './tool/index.js';
// 初始化上下文和工具
const contextManager = new ContextManager();
await contextManager.init();
const toolManager = new ToolManager();
// 创建 LLM 服务
const service = await createLLMService({
provider: 'deepseek',
model: 'deepseek-chat',
apiKey: process.env.DEEPSEEK_API_KEY,
}, toolManager);
// 调用 LLM
const messages = contextManager.getFormattedContext();
const tools = toolManager.getTools();
const response = await service.complete(messages, tools);
# 克隆仓库
git clone https://github.com/yourusername/context-cli.git
cd context-cli
# 安装依赖
npm install
# 开发模式
npm run dev
# 构建
npm run build
# 本地测试
npm link
context-cli
欢迎贡献!请查看 贡献指南 了解如何参与项目开发。
感谢所有为这个项目做出贡献的开发者!
Made with ❤️ by the Context-CLI Team
FAQs
CLI tool to scaffold LLM projects with context engineering architecture
The npm package create-context-template receives a total of 0 weekly downloads. As such, create-context-template popularity was classified as not popular.
We found that create-context-template demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
GitHub Actions checkout now blocks risky pull_request_target checkouts by default to help prevent pwn request supply chain attacks.

Product
Socket now supports Custom Roles and Repository Access Permissions so organizations can control who can access specific repositories and actions.

Product
Socket MCP now lets AI assistants review org alerts, investigate threats using the Socket threat feed, and inspect package files in addition to dependency scoring.