Skip to content

Commit 4757e81

Browse files
committed
[docs] Add docs of wizard
1 parent e2101a4 commit 4757e81

2 files changed

Lines changed: 62 additions & 110 deletions

File tree

docs/content/docs/deployment/cli/index.mdx

Lines changed: 39 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -36,37 +36,62 @@ npm i -g pnpm
3636

3737
Fraq 会按照 `pnpm -> yarn -> npm` 的顺序查找可用的包管理器,并使用第一个找到的包管理器来安装依赖。
3838

39-
## 创建 `fraq.yml`
39+
## 初始化 `fraq.yml`
4040

41-
新建一个空的目录,然后在目录下创建一个名为 `fraq.yml` 的文件,并且添加以下内容
41+
在命令行中执行 `fraq wizard` 命令来初始化一个新的 Fraq 机器人项目。Fraq CLI 会询问你一些问题来生成一个默认的 `fraq.yml` 配置文件,你可以在命令行中直接输入答案,或者按 `Enter` 键使用默认值。最后,Fraq CLI 会打印出生成的配置文件内容,并且询问你是否确认创建该配置文件。命令行输出形如
4242

43-
```yaml
44-
configVersion: 1
43+
```
44+
> fraq wizard
45+
Fraq CLI v0.6.0
46+
47+
✔ Project name: my-fraq-app
48+
✔ Fraq version to use: 0.14.0
49+
✔ Milky server address: localhost
50+
✔ Milky server port: 30001
4551
46-
fraqVersion: 0.14.0 # 可以替换为最新的 Fraq 版本号(在网页左上角查看)
52+
Fraq CLI is going to create my-fraq-app/fraq.yml with the following content:
4753
54+
configVersion: 1
55+
fraqVersion: 0.14.0
4856
milky:
49-
url: <替换为你的协议端的 HTTP API 地址, 例如 http://localhost:30001>
50-
# accessToken: <如果你配置了 accessToken,请在这里填写,并且取消这一行的注释>
57+
url: http://localhost:30001/
58+
59+
✔ Is it ok? Yes
60+
61+
Configuration file created succesfully.
62+
63+
Please run:
64+
cd my-fraq-app
65+
fraq start
66+
to start your Fraq application.
5167
```
5268

69+
随后,你可以 `cd` 到指定的项目目录下,查看和修改生成的 `fraq.yml` 配置文件。
70+
71+
你可以在在命令行中执行 `fraq start` 来启动。Fraq CLI 会在当前目录的 `app` 子目录下创建一个默认的 Fraq 机器人项目,并且自动安装依赖。安装完成后,Fraq CLI 会启动 Fraq 机器人,并且在命令行中打印出启动日志。如果你安装了 `pnpm`,日志可能形如:
72+
5373
{/* prettier-ignore */}
5474
<Callout>
5575
YAML 是一种表达力较强但也较为复杂的配置文件格式。你可以在[这里](https://quickref.me/yaml.html)快速查阅 YAML 的语法规则。
5676
</Callout>
5777
{/* prettier-ignore-end */}
5878

59-
保存完成后,你可以在命令行中执行 `fraq start` 来启动 Fraq 机器人。Fraq CLI 会在当前目录的 `app` 子目录下创建一个默认的 Fraq 机器人项目,并且自动安装依赖。安装完成后,Fraq CLI 会启动 Fraq 机器人,并且在命令行中打印出启动日志。如果你安装了 `pnpm`,日志可能形如:
60-
6179
```
6280
> fraq start
63-
Nothing to do since all plugin versions are already complete and aligned.
64-
✓ Lockfile passes supply-chain policies (verified 11h ago)
81+
Fraq CLI v0.6.0
82+
83+
Syncing lockfile versions...
84+
Successfully synced lockfile versions.
85+
86+
Installing application dependencies with pnpm...
87+
✓ Lockfile passes supply-chain policies (verified 8h ago)
6588
Lockfile is up to date, resolution step is skipped
6689
Already up to date
67-
Done in 310ms using pnpm v11.7.0
68-
2026/07/20 12:57:08 DEBUG context:root Connecting websocket (attempt=1)
69-
2026/07/20 12:57:08 INFO context:root websocket connected
90+
Done in 279ms using pnpm v11.7.0
91+
92+
Starting the Fraq application...
93+
2026/07/21 00:29:39 DEBUG context:root Connecting websocket (attempt=1)
94+
2026/07/21 00:29:39 INFO context:root websocket connected
7095
```
7196

7297
你可以随时使用 `Ctrl + C` 来停止 Fraq 机器人。

pnpm-lock.yaml

Lines changed: 23 additions & 96 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)