YCode.CLI
1.0.3
dotnet tool install --global YCode.CLI --version 1.0.3
This package contains a .NET tool you can call from the shell/command line.
dotnet new tool-manifest
dotnet tool install --local YCode.CLI --version 1.0.3
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=YCode.CLI&version=1.0.3
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
nuke :add-package YCode.CLI --version 1.0.3
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
YCode CLI
.NET 10 的命令行 AI 代理项目,结合 Subagent、MCP 工具、记忆管理与技能加载,用于学习与二次扩展。
特性
- Subagent:explore / plan / code 子代理隔离上下文
- MCP 工具:通过 Model Context Protocol 扩展文件与系统能力
- 记忆管理:profile / daily / project 三级记忆与检索
- 技能加载:YAML + Markdown 的技能包按需加载
- 交互式体验:流式输出与可视化工具调用提示
快速开始
# 构建
dotnet build
# 运行(本地调试)
dotnet run --project YCode.CLI\YCode.CLI.csproj
配置
YCODE_AUTH_TOKEN=your_api_key
YCODE_API_BASE_URI=https://api.deepseek.com
YCODE_MODEL=deepseek-chat
# 可选(Context7 MCP)
YCODE_CONTEXT7=your_context7_api_key
设计分层
flowchart TD
UI[CLI UI / Console] --> Core[Program.cs: Orchestrator]
Core --> DI[ServiceRegistration: Register + Inject]
DI --> Managers[Managers]
DI --> Tools[IAgentTool implementations]
Managers --> AgentMgr[AgentManager: subagent catalog]
Managers --> ToolMgr[ToolManager: Register/GetTools]
Managers --> MemoryMgr[MemoryManager]
Managers --> SkillsMgr[SkillsManager]
Managers --> TodoMgr[TodoManager]
Managers --> Context[AgentContext]
ToolMgr --> MCP[MCP Tools]
ToolMgr --> Agent[Agent runtime]
消息注入流程
flowchart TD
Input[User input] --> Blocks[AgentContext.PendingContextBlocks]
Blocks --> Build[MemoryManager.BuildContextBlock]
Build --> HasBlock{Context block exists?}
HasBlock -- Yes --> Attach[Attach context block]
HasBlock -- No --> Direct[Skip context block]
Attach --> Msg[Create ChatMessage]
Direct --> Msg
Msg --> Send[Send to agent]
Send --> Update[Update AgentContext state]
Update --> Window{Reached reminder threshold?}
Window -- Yes --> Reminder[AgentContext.EnsureContextBlock]
Window -- No --> Idle
贡献与反馈
这是一个学习项目,欢迎:
- 提出问题:报告 bug 或建议改进
- 分享经验:交流 Microsoft Agents AI 使用心得
- 扩展功能:基于项目实现更多代理类型或技能
- 改进文档:帮助完善使用说明和示例
参考资源
- Microsoft Agents AI 文档
- MCP 协议规范
- Kode 项目 (Python实现的参考)
Star History
许可证
MIT License
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
This package has no dependencies.
Fixed apphost issue - tool now works with various .NET installations including snap