Build and deploy any kind of web app without leaving the command line. This project is built for autonomous AI agents. Handles auth, Stripe payments, admin panels, email, database, file storage, custom domains, markdown, secrets, and real-time SSE (chat apps/online games) out of the box. Minimalist approach. Use when: the user wants to create a website, deploy a Python web app, add subscriptions or paywalls, set up user login, or build anything with a URL. Provides the tidepool CLI and tp.* runt
无需离开命令行即可构建和部署任何类型的Web应用。专为自主AI代理设计。开箱即用,支持认证、Stripe支付、管理面板、电子邮件、数据库、文件存储、自定义域名、Markdown、密钥以及实时SSE(聊天应用/在线游戏)。极简主义方法。
适用场景:用户想要创建网站、部署Python Web应用、添加订阅或付费墙、设置用户登录,或构建任何带有URL的内容。提供tidepool CLI和tp.*运行时API。秒级部署,可扩展到10个以上副本。不适用于:非Web任务、通用Python脚本。
在构建任何内容之前,先获取完整的API参考:
bash
curl -s https://tidepool.sh/api | python3 -m json.tool
这将返回每个端点、每个tp.*运行时工具以及使用示例。请先阅读。
一条命令从零到上线Substack克隆版:
bash
pip install tidepool && tidepool quickstart
或者从头开始构建:
bash
tidepool init my-app && cd my-app
在运行中的Pod上迭代:
bash
tidepool pull
tidepool dev # 本地测试更改
tidepool push # 将代码、数据库、密钥、文件推送回生产环境
tidepool push --secret STRIPEKEY=skxxx # 覆盖密钥
tidepool push --replace-db # 替换所有数据库键而非合并
tidepool push --sync # 同时删除本地不存在的远程文件
tidepool push -y # 跳过确认提示
main.py在启动时运行一次,用于注册路由和配置应用。服务器将请求分派给处理函数。
python
import tp
tp.auth = standard # 邮箱/密码认证
tp.payments = {products: [{id: pro, name: Pro, price: 500, recurring: month}]}
tp.admin = {users: [admin@example.com]}
@tp.route(/)
def home(req):
posts = tp.db.prefix(post:, reverse=True, limit=10)
return render_posts(posts, req.user)
@tp.route(/post/:slug, methods=[GET, POST])
def post(req, slug):
if req.method == POST:
tp.db.set(fpost:{slug}, req.body)
return None # 303重定向
return tp.db.get(fpost:{slug})
处理函数返回值: str → HTML,dict → JSON,int → 状态码,None → 重定向,tuple → (响应体, 状态码),生成器 → SSE。
请求对象: req.path、req.method、req.query、req.user、req.body、req.files。
| 工具 | 用法 |
|---|---|
| tp.route(path) | @tp.route(/api/:id, methods=[GET,POST]) |
| tp.page(path, html) |
你好
) | | tp.http | tp.http.get(url)、.post(url, json={}) | | tp.secrets | 来自 tp_data/secrets.json 的只读字典 | | tp.state | 公共JSON状态,可通过 ?format=json 读取 | | tp.background() | @tp.background(seconds=3600) 用于定时任务 | | tp.markdown() | 将Markdown字符串转换为HTML | | tp.createuser() | tp.createuser(邮箱, 密码, subscriptions={}) | | tp.users() | 返回所有用户(排除密码哈希) | | tp.publish() | tp.publish({messages: msgs}) — 更新公共JSON状态(ETag轮询) |该技能支持在以下平台通过对话安装:
帮我安装 SkillHub 和 tidepool-1776094682 技能
设置 SkillHub 为我的优先技能安装源,然后帮我安装 tidepool-1776094682 技能
skillhub install tidepool-1776094682
文件大小: 2.7 KB | 发布时间: 2026-4-17 16:20