我的经纪人
使用以下工具构建自定义CLI代理的研讨会项目 快速代理.
目标是构建一个代理,该代理能够读取和写入本地文件系统中的文件,在终端中执行命令,并使用网络搜索收集信息。
使用Fast agent框架和Claude Code的架构来实现代理,以创建一个可以作为软件开发任务和自动化合作伙伴的自定义代理。
设置仓库
点击 Use this template 和 Create a new repository 在您的用户名下创建此仓库的副本;然后签出repo:
git checkout https://github.com/myusername/my-agent.git安装
首先安装包管理器 紫外线.
macOS和Linux:
curl -LsSf https://astral.sh/uv/install.sh | sh窗户:
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"然后同步这些包:
uv sync用法
使用以下命令运行代理:
uv run agent.py这将启动代理,代理将通过命令行与您交互。
有用的参考资料
有用的服务
有用的mcp服务器
提示
- Fast-Agent website has an [llms.txt](https://fast-agent.ai/llms.txt) file that will help your AI understand how it works and how to write code for it.
# claude code
If you want to use Claude Code, follow installation instructions [here](https://claude.com/product/claude-code).
Then copy the .env.example file to .env:cp .env.example .env
然后复制#trac25-my-agent通道中的密钥,将其粘贴到.env文件中,如下所示:
ANTHROPIC_API_KEY=your_key_here
然后运行claude:
claude
按照提示与代理交互。