几分钟内构建和部署AI应用程序。全部使用纯Markdown。零样板代码。
</div>源代码:https://github.com/statespace-tech/toolfront
ToolFront是一个声明式框架,用于使用Markdown构建模块化AI应用程序。在.md文件中编写工具和指令,并获得一个实时AI应用程序。
从一个文件开始:README.md
---
tools:
- [curl, -X, GET, "https://httpbin.org/status/200"]
---
# 指令
- 使用`curl`检查服务是否运行
在你的机器上运行你的应用:
toolfront serve .
在
http://127.0.0.1:8000运行
导出你的OPENAI_API_KEY并查询你的应用:
from toolfront import Application
app = Application(url="http://127.0.0.1:8000")
result = app.ask("服务是否运行?", model="openai:gpt-5")
</details>
<details>
<summary><b>MCP服务器</b></summary>
{
"mcpServers": {
"toolfront": {
"command": "uvx",
"args": ["toolfront", "mcp", "http://127.0.0.1:8000"]
}
}
}
</details>
<details>
<summary><b>命令行</b></summary>
toolfront ask http://127.0.0.1:8000 "服务是否运行?"
</details>
你的应用可以扩展成一个完整的项目:
项目/
├── README.md # 主要指令及导航工具
├── src/
│ ├── rag.md # 文档搜索
│ ├── text2sql.md # 数据库查询
│ └── toolkit.md # 自定义工作流
├── data/
└── tools/
4个目录,10个文件
更新README.md以添加浏览项目的工具。
---
tools:
- [curl, -X, GET, "https://httpbin.org/status/200"]
- [ls]
- [cat]
---
# 指令
- 使用`curl`检查服务是否运行
- 使用`ls`和`cat`浏览其他文件
通过扩展专用工作流来扩展你的应用。
<details open> <summary><b>文档搜索</b></summary>---
tools:
- [grep]
---
# 文档搜索
- 使用`grep`在`data/`中进行关键词搜索
</details>
<details>
<summary><b>文本到SQL</b></summary>
---
tools:
- [psql, -U, $USER, -d, $DB, -c, { regex: "^SELECT\b.*" }]
---
# 数据库访问
- 调用`psql`使用只读SELECT语句查询数据库
</details>
<details>
<summary><b>自定义脚本</b></summary>
---
tools:
- [python3, tools/analyze.py]
---
# 自定义工具
- 运行`analyze.py`处理数据,根据需要传递`--input`
</details>
创建一个免费的Statespace账户1并通过一条命令部署你的应用。
toolfront deploy .
部署到
https://your-app.toolfront.app。与社区或团队分享!
使用你喜欢的PyPI包管理器安装toolfront(需要Python 3.10+)。
pip install toolfront
</details>
<details>
<summary><b>uv</b></summary>
uv add toolfront
</details>
<details>
<summary><b>poetry</b></summary>
poetry add toolfront
</details>
此项目根据MIT许可证的条款进行许可。