# Javris-Cli **Repository Path**: sddrjack/javris-cli ## Basic Information - **Project Name**: Javris-Cli - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 1 - **Forks**: 0 - **Created**: 2026-06-09 - **Last Updated**: 2026-06-22 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # javris-cli 一个基于 DeepSeek LLM 的智能命令行 Agent,支持 ReAct 和 Plan-Supervise-Execute 两种执行模式。 ## 特性 - **双模式执行**: 支持 ReAct 模式(默认)和 Plan-Supervise-Execute 模式 - **工具系统**: 内置多种工具(文件操作、Shell 命令、网络搜索、天气查询等) - **REPL 交互**: 彩色输出的交互式命令行界面 - **可扩展工具注册**: 基于注解的工具自动注册机制 ## 技术栈 - Java 17 - Spring Boot - DeepSeek API (LLM) - OkHttp (HTTP 客户端) - Jackson (JSON 处理) ## 快速开始 ### 配置 在 `src/main/resources/application.yml` 中配置 DeepSeek API: ```yaml javris: llm: api-url: "https://api.deepseek.com/v1/chat/completions" api-key: "your-api-key" model: "deepseek-chat" ``` ### 编译 ```bash mvn clean compile -Dparameters ``` ### 运行 ```bash mvn spring-boot:run ``` 或编译后直接运行: ```bash java -cp target/classes:$(classpath) com.javriscli.JavrisCliApplication ``` ## 使用方法 启动后进入 REPL 交互界面,直接输入问题或任务即可。 ### 切换执行模式 默认使用 ReAct 模式。通过配置切换到 Plan-Supervise-Execute 模式: ```yaml javris: agent: use-planning: true ``` ### 可用工具 | 工具名称 | 描述 | |---------|------| | read_file | 读取本地文件 | | write_file | 写入文件 | | edit_file | 编辑文件 | | list_dir | 列出目录内容 | | create_dir | 创建目录 | | execute_shell | 执行 Shell 命令 | | web_search | 网络搜索 | | get_weather | 查询天气 | | ask_user | 向用户提问 | ## 架构 ### 核心组件 - **Agent**: ReAct 模式执行器 - **PlanSuperviseAgent**: Plan-Supervise-Execute 模式执行器 - **ToolRegistry**: 工具注册表 - **DeepSeekClient**: DeepSeek API 客户端 - **DagExecutor**: DAG 任务调度器 - **LlmPlanner**: LLM 驱动的任务规划器 ### 执行流程 1. **ReAct 模式**: 用户输入 → LLM 推理 → 工具调用 → 结果反馈 → 循环直至完成 2. **PSE 模式**: 用户输入 → Planner 生成执行计划 → Supervisor 监督 → DagExecutor 并行执行任务 ## 配置说明 | 配置项 | 说明 | 默认值 | |--------|------|--------| | javris.llm.api-url | DeepSeek API 地址 | - | | javris.llm.api-key | API 密钥 | - | | javris.llm.model | 模型名称 | deepseek-chat | | javris.agent.maxIterations | 最大迭代次数 | 10 | | javris.agent.usePlanning | 启用规划模式 | false | | javris.execution.parallelThreads | 并行线程数 | 4 | | javris.execution.taskTimeoutMs | 任务超时时间 | 60000 | ## 添加新工具 通过 `@Tool` 和 `@ToolParam` 注解注册新工具: ```java public class MyTool { @Tool(name = "my_tool", description = "工具描述") public String myTool( @ToolParam(name = "param1", description = "参数描述", required = true) String param1 ) { return "执行结果"; } } ``` 然后将工具类注册到 ToolRegistry 即可。 ## 许可证 MIT License