返回市场
工具前端

工具前端

作者:statespace-tech787 星标更新:2025-11-21

项目介绍

<p align="center"> <a href="https://github.com/statespace-tech/toolfront"> <img src="https://raw.githubusercontent.com/statespace-tech/toolfront/main/docs/assets/images/favicon.svg" width="150" alt="ToolFront"> </a> </p> <div align="center">

ToolFront

几分钟内构建和部署AI应用程序。全部使用纯Markdown。零样板代码。

测试套件 PyPI包 Discord X

</div>

文档:docs.toolfront.ai

源代码: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并查询你的应用:

<details open> <summary><b>Python SDK</b></summary>
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+)。

<details open> <summary><b>pip</b></summary>
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许可证的条款进行许可。

Footnotes

  1. Statespace目前处于测试阶段。发送邮件至esteban[at]statespace[dot]com或加入我们的Discord获取API密钥