setup-fling

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Setup Fling

搭建Fling项目

If the user wants to build a project with Fling, you'll need an empty directory. Offer to create one, like
~/flings/my-new-fling
, but go with whatever the user wants. Make sure it's empty.
Then, in that directory, initialize the Fling project with:
bash
npm init --yes && npm i flingit && npm exec -- fling init --force && npm i
That installs the
flingit
package and scaffolds a Fling project, which supports React frontend, Hono API backend, database, storage, cron jobs, secrets, Slack&Discord bots.
After init completes, read the
fling
skill (in
.claude/skills/fling/SKILL.md
) for how to build and deploy the app, and build the project for the user. Ask them what they want to build, if they haven't told you already.
如果用户想要使用Fling构建项目,你需要一个空目录。你可以提议创建一个,比如
~/flings/my-new-fling
,但最终以用户的需求为准,确保目录为空。
接下来,在该目录中,使用以下命令初始化Fling项目:
bash
npm init --yes && npm i flingit && npm exec -- fling init --force && npm i
上述命令会安装
flingit
包并生成Fling项目的基础脚手架,该脚手架支持React前端、Hono API后端、数据库、存储、cron定时任务、密钥管理、Slack&Discord机器人开发。
初始化完成后,阅读
fling
技能说明(位于
.claude/skills/fling/SKILL.md
)了解如何构建和部署应用,并为用户搭建项目。如果用户还未告知具体需求,询问他们想要构建什么内容。

Troubleshooting

故障排查

If the installation fails, diagnose and try to fix it, but consult with the user. Potential issues:
  • npm
    not installed: Install Node.js 22 or later via NVM: https://github.com/nvm-sh/nvm
  • Node.js version too old: Update to Node.js 22 or later via NVM
如果安装失败,先诊断问题并尝试修复,同时同步用户确认。可能存在的问题:
  • 未安装
    npm
    :通过NVM安装Node.js 22或更高版本:https://github.com/nvm-sh/nvm
  • Node.js版本过低:通过NVM更新到Node.js 22或更高版本