xiaozhi-client 1.7.1 → 1.7.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +29 -397
- package/dist/WebServerStandalone.js +34 -13
- package/dist/WebServerStandalone.js.map +1 -1
- package/dist/cli.js +37 -16
- package/dist/cli.js.map +1 -1
- package/dist/mcpServerProxy.js +28 -7
- package/dist/mcpServerProxy.js.map +1 -1
- package/dist/package.json +10 -5
- package/docs/{Architecture.md → development/architecture.mdx} +4 -1
- package/docs/docs.json +51 -0
- package/docs/getting-started/install.mdx +191 -0
- package/docs/getting-started/intro.mdx +11 -0
- package/docs/getting-started/quickstart.mdx +108 -0
- package/docs/images/preview.png +0 -0
- package/docs/reference/command.mdx +15 -0
- package/docs/usage/add-mcp-server.mdx +6 -0
- package/docs/usage/as-a-mcp-server.mdx +6 -0
- package/docs/usage/docker.mdx +99 -0
- package/docs/usage/modelscope.mdx +6 -0
- package/docs/usage/web-control.mdx +6 -0
- package/package.json +10 -5
- package/web/dist/assets/{form-utils-DmILtYcF.js → form-utils-RpkiEEz8.js} +2 -2
- package/web/dist/assets/{form-utils-DmILtYcF.js.map → form-utils-RpkiEEz8.js.map} +1 -1
- package/web/dist/assets/index-BjG6tl-5.css +1 -0
- package/web/dist/assets/index-BvDVeF-B.js +31 -0
- package/web/dist/assets/index-BvDVeF-B.js.map +1 -0
- package/web/dist/assets/radix-ui-BA32w1ww.js +2 -0
- package/web/dist/assets/radix-ui-BA32w1ww.js.map +1 -0
- package/web/dist/assets/react-vendor-CoesXubw.js +234 -0
- package/web/dist/assets/react-vendor-CoesXubw.js.map +1 -0
- package/web/dist/assets/{utils-DYeV2b9J.js → utils-N_0RTAPv.js} +2 -2
- package/web/dist/assets/{utils-DYeV2b9J.js.map → utils-N_0RTAPv.js.map} +1 -1
- package/web/dist/index.html +6 -6
- package/docs/CLI.md +0 -928
- package/docs/examples-usage.md +0 -647
- package/web/dist/assets/index-CQVdYi7r.js +0 -31
- package/web/dist/assets/index-CQVdYi7r.js.map +0 -1
- package/web/dist/assets/index-Cz9EK1KU.css +0 -1
- package/web/dist/assets/radix-ui-DW48STyt.js +0 -2
- package/web/dist/assets/radix-ui-DW48STyt.js.map +0 -1
- package/web/dist/assets/react-vendor-CP-QpYlg.js +0 -189
- package/web/dist/assets/react-vendor-CP-QpYlg.js.map +0 -1
- /package/docs/{RELEASE_GUIDE.md → development/todo__release-guide.md} +0 -0
- /package/docs/{SettingManager.md → development/todo__setting-manager.md} +0 -0
package/dist/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "xiaozhi-client",
|
|
3
|
-
"version": "1.7.
|
|
3
|
+
"version": "1.7.3",
|
|
4
4
|
"description": "小智 AI 客户端 命令行工具",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/cli.js",
|
|
@@ -25,6 +25,7 @@
|
|
|
25
25
|
"build:web": "cd web && pnpm install && pnpm run build",
|
|
26
26
|
"dev": "cross-env NODE_ENV=development tsup --watch",
|
|
27
27
|
"test": "vitest run",
|
|
28
|
+
"test:silent": "vitest run --silent=true",
|
|
28
29
|
"test:watch": "vitest",
|
|
29
30
|
"test:coverage": "vitest run --coverage",
|
|
30
31
|
"test:ui": "vitest --ui",
|
|
@@ -37,7 +38,8 @@
|
|
|
37
38
|
"spell:check": "cspell \"src/**/*.ts\" \"*.md\" \"*.json\"",
|
|
38
39
|
"duplicate:check": "jscpd src/",
|
|
39
40
|
"docker:update-version": "node scripts/update-dockerfile-version.js",
|
|
40
|
-
"example": "node --loader ts-node/esm"
|
|
41
|
+
"example": "node --loader ts-node/esm",
|
|
42
|
+
"docs:dev": "cd docs && mintlify dev"
|
|
41
43
|
},
|
|
42
44
|
"keywords": [
|
|
43
45
|
"xiaozhi",
|
|
@@ -61,7 +63,7 @@
|
|
|
61
63
|
"dotenv": "^17.2.1",
|
|
62
64
|
"eventsource": "^4.0.0",
|
|
63
65
|
"express": "^5.1.0",
|
|
64
|
-
"hono": "^4.9.
|
|
66
|
+
"hono": "^4.9.7",
|
|
65
67
|
"json5": "^2.2.3",
|
|
66
68
|
"json5-writer": "^0.2.0",
|
|
67
69
|
"jsonc-parser": "^3.3.1",
|
|
@@ -90,6 +92,7 @@
|
|
|
90
92
|
"glob": "^11.0.3",
|
|
91
93
|
"happy-dom": "^18.0.1",
|
|
92
94
|
"jscpd": "^4.0.5",
|
|
95
|
+
"mintlify": "^4.2.107",
|
|
93
96
|
"release-it": "^19.0.4",
|
|
94
97
|
"semver": "^7.7.2",
|
|
95
98
|
"supertest": "^7.1.4",
|
|
@@ -103,7 +106,9 @@
|
|
|
103
106
|
"overrides": {
|
|
104
107
|
"form-data": "^4.0.4",
|
|
105
108
|
"braces": ">=3.0.3",
|
|
106
|
-
"micromatch": ">=4.0.8"
|
|
109
|
+
"micromatch": ">=4.0.8",
|
|
110
|
+
"axios": ">=1.12.0"
|
|
107
111
|
}
|
|
108
|
-
}
|
|
112
|
+
},
|
|
113
|
+
"packageManager": "pnpm@10.13.1"
|
|
109
114
|
}
|
package/docs/docs.json
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://mintlify.com/docs.json",
|
|
3
|
+
"theme": "mint",
|
|
4
|
+
"name": "Xiaozhi Client",
|
|
5
|
+
"description": "用于聚合MCP Server的命令行工具",
|
|
6
|
+
"colors": {
|
|
7
|
+
"primary": "#3B82F6",
|
|
8
|
+
"light": "#F8FAFC",
|
|
9
|
+
"dark": "#0F172A"
|
|
10
|
+
},
|
|
11
|
+
"navigation": {
|
|
12
|
+
"pages": [
|
|
13
|
+
"getting-started/intro",
|
|
14
|
+
"getting-started/quickstart",
|
|
15
|
+
"usage/docker",
|
|
16
|
+
"reference/command"
|
|
17
|
+
]
|
|
18
|
+
},
|
|
19
|
+
"navbar": {
|
|
20
|
+
"links": [
|
|
21
|
+
{
|
|
22
|
+
"icon": "qq",
|
|
23
|
+
"label": "QQ群",
|
|
24
|
+
"href": "https://qun.qq.com/universal-share/share?ac=1&authKey=c08PvS2zvAF1NN%2F%2BuaOi0ze1AElTIsvFBLwbWUMFc2ixjaZYxqZTUQHzipwd8Kka&busi_data=eyJncm91cENvZGUiOiIxMDU0ODg4NDczIiwidG9rZW4iOiJuSmJUN2cyUEVkNEQ5WXovM3RQbFVNcDluMGVibUNZTUQvL1RuQnFJRjBkZmRZQnRBRTdwU0szL3V2Y0dLc1ZmIiwidWluIjoiMzkxMTcyMDYwMCJ9&data=9cH6_zEC-sN3xYlwzKEWiYF71RLY9CId5taN-gy6XZo7axSlSWDpd1Ojui5hYMQKIgEJYSPw59XYgF5vH2wLog&svctype=4&tempid=h5_group_info"
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"icon": "github",
|
|
28
|
+
"label": "GitHub",
|
|
29
|
+
"href": "https://github.com/shenjingnan/xiaozhi-client"
|
|
30
|
+
}
|
|
31
|
+
]
|
|
32
|
+
},
|
|
33
|
+
"footer": {
|
|
34
|
+
"socials": {
|
|
35
|
+
"github": "https://github.com/shenjingnan/xiaozhi-client"
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
"integrations": {
|
|
39
|
+
"telemetry": {
|
|
40
|
+
"enabled": true
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
"contextual": {
|
|
44
|
+
"options": ["copy", "view"]
|
|
45
|
+
},
|
|
46
|
+
"errors": {
|
|
47
|
+
"404": {
|
|
48
|
+
"redirect": true
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
# CLI installation
|
|
2
|
+
|
|
3
|
+
> Install the CLI to preview and develop your docs locally
|
|
4
|
+
|
|
5
|
+
<img className="block dark:hidden my-0 pointer-events-none" src="https://mintcdn.com/mintlify/Y6rP0BmbzgwHuEoU/images/installation/local-development-light.png?fit=max&auto=format&n=Y6rP0BmbzgwHuEoU&q=85&s=ffd8bc88d87fc00fe1919a33a292fa01" width="1184" height="320" data-path="images/installation/local-development-light.png" srcset="https://mintcdn.com/mintlify/Y6rP0BmbzgwHuEoU/images/installation/local-development-light.png?w=280&fit=max&auto=format&n=Y6rP0BmbzgwHuEoU&q=85&s=511ef7cd18fd4fb900f2701d062ca11b 280w, https://mintcdn.com/mintlify/Y6rP0BmbzgwHuEoU/images/installation/local-development-light.png?w=560&fit=max&auto=format&n=Y6rP0BmbzgwHuEoU&q=85&s=3d88dd1c1b9502ecf779bae2a125bfa0 560w, https://mintcdn.com/mintlify/Y6rP0BmbzgwHuEoU/images/installation/local-development-light.png?w=840&fit=max&auto=format&n=Y6rP0BmbzgwHuEoU&q=85&s=b5c7231e4a48c366bc9fadc00ad67fc2 840w, https://mintcdn.com/mintlify/Y6rP0BmbzgwHuEoU/images/installation/local-development-light.png?w=1100&fit=max&auto=format&n=Y6rP0BmbzgwHuEoU&q=85&s=43e8d5fa61bcd586ccece993dc0c3f4d 1100w, https://mintcdn.com/mintlify/Y6rP0BmbzgwHuEoU/images/installation/local-development-light.png?w=1650&fit=max&auto=format&n=Y6rP0BmbzgwHuEoU&q=85&s=c06a3f73ae2ed6cc36cfc6a15a539baf 1650w, https://mintcdn.com/mintlify/Y6rP0BmbzgwHuEoU/images/installation/local-development-light.png?w=2500&fit=max&auto=format&n=Y6rP0BmbzgwHuEoU&q=85&s=6a946dbec95af5df7dc3f71daf25fed5 2500w" data-optimize="true" data-opv="2" />
|
|
6
|
+
|
|
7
|
+
<img className="hidden dark:block my-0 pointer-events-none" src="https://mintcdn.com/mintlify/Y6rP0BmbzgwHuEoU/images/installation/local-development-dark.png?fit=max&auto=format&n=Y6rP0BmbzgwHuEoU&q=85&s=ef0bb527eb258f8d720180d106ea6625" width="1184" height="320" data-path="images/installation/local-development-dark.png" srcset="https://mintcdn.com/mintlify/Y6rP0BmbzgwHuEoU/images/installation/local-development-dark.png?w=280&fit=max&auto=format&n=Y6rP0BmbzgwHuEoU&q=85&s=b6ab6647def97748df5303d2add7877c 280w, https://mintcdn.com/mintlify/Y6rP0BmbzgwHuEoU/images/installation/local-development-dark.png?w=560&fit=max&auto=format&n=Y6rP0BmbzgwHuEoU&q=85&s=83a49f961c12baf9aa9755d972160915 560w, https://mintcdn.com/mintlify/Y6rP0BmbzgwHuEoU/images/installation/local-development-dark.png?w=840&fit=max&auto=format&n=Y6rP0BmbzgwHuEoU&q=85&s=9f44e898560aaa47af54ff0f6079ca6e 840w, https://mintcdn.com/mintlify/Y6rP0BmbzgwHuEoU/images/installation/local-development-dark.png?w=1100&fit=max&auto=format&n=Y6rP0BmbzgwHuEoU&q=85&s=1bc3413b87f72bb848de2a518cf16c3a 1100w, https://mintcdn.com/mintlify/Y6rP0BmbzgwHuEoU/images/installation/local-development-dark.png?w=1650&fit=max&auto=format&n=Y6rP0BmbzgwHuEoU&q=85&s=9b79a51b960489e0d41ffd61b9d7120d 1650w, https://mintcdn.com/mintlify/Y6rP0BmbzgwHuEoU/images/installation/local-development-dark.png?w=2500&fit=max&auto=format&n=Y6rP0BmbzgwHuEoU&q=85&s=db35248ff88939a314d4ecc547ffd463 2500w" data-optimize="true" data-opv="2" />
|
|
8
|
+
|
|
9
|
+
## Installing the CLI
|
|
10
|
+
|
|
11
|
+
<Info>
|
|
12
|
+
**Prerequisite**: Please install [Node.js](https://nodejs.org/en) before proceeding.
|
|
13
|
+
</Info>
|
|
14
|
+
|
|
15
|
+
<Steps>
|
|
16
|
+
<Step title="Install the CLI.">
|
|
17
|
+
Run the following command to install the [CLI](https://www.npmjs.com/package/mint):
|
|
18
|
+
|
|
19
|
+
<CodeGroup>
|
|
20
|
+
```bash npm
|
|
21
|
+
npm i -g mint
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
```bash pnpm
|
|
25
|
+
pnpm add -g mint
|
|
26
|
+
```
|
|
27
|
+
</CodeGroup>
|
|
28
|
+
</Step>
|
|
29
|
+
|
|
30
|
+
<Step title="Preview locally.">
|
|
31
|
+
Navigate to your docs directory (where your `docs.json` file is located) and execute the following command:
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
mint dev
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
A local preview of your documentation will be available at `http://localhost:3000`.
|
|
38
|
+
</Step>
|
|
39
|
+
</Steps>
|
|
40
|
+
|
|
41
|
+
Alternatively, if you do not want to install the CLI globally, you can run a one-time script:
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
npx mint dev
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Updates
|
|
48
|
+
|
|
49
|
+
If your local preview is out of sync with what you see on the web in the production version, update your local CLI:
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
mint update
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
If this `mint update` command is not available on your local version, re-install the CLI with the latest version:
|
|
56
|
+
|
|
57
|
+
<CodeGroup>
|
|
58
|
+
```bash npm
|
|
59
|
+
npm i -g mint@latest
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
```bash pnpm
|
|
63
|
+
pnpm add -g mint@latest
|
|
64
|
+
```
|
|
65
|
+
</CodeGroup>
|
|
66
|
+
|
|
67
|
+
## Custom ports
|
|
68
|
+
|
|
69
|
+
By default, the CLI uses port 3000. You can customize the port using the `--port` flag. To run the CLI on port 3333, for instance, use this command:
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
mint dev --port 3333
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
If you attempt to run on a port that is already in use, it will use the next available port:
|
|
76
|
+
|
|
77
|
+
```mdx
|
|
78
|
+
Port 3000 is already in use. Trying 3001 instead.
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
## Previewing as a specific group
|
|
82
|
+
|
|
83
|
+
If you use partial authentication to restrict access to your documentation, you can preview as a specific authentication group by using the `--group [groupname]` flag.
|
|
84
|
+
|
|
85
|
+
For example, if you have a group named `admin`, you can preview as a member of that group with the command:
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
mint dev --group admin
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
## Additional commands
|
|
92
|
+
|
|
93
|
+
While `mint dev` is the most commonly used command, there are other commands you can use to manage your documentation.
|
|
94
|
+
|
|
95
|
+
### Finding broken links
|
|
96
|
+
|
|
97
|
+
The CLI can assist with validating reference links made in your documentation. To identify any broken links, use the following command:
|
|
98
|
+
|
|
99
|
+
```bash
|
|
100
|
+
mint broken-links
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
### Checking OpenAPI spec
|
|
104
|
+
|
|
105
|
+
You can use the CLI to check your OpenAPI file for errors using the following command:
|
|
106
|
+
|
|
107
|
+
```bash
|
|
108
|
+
mint openapi-check <openapiFilenameOrUrl>
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
You can pass in a filename (e.g. `./openapi.yaml`) or a URL (e.g. `https://petstore3.swagger.io/api/v3/openapi.json`).
|
|
112
|
+
|
|
113
|
+
### Renaming files
|
|
114
|
+
|
|
115
|
+
You can rename and update all references to files using the following command:
|
|
116
|
+
|
|
117
|
+
```bash
|
|
118
|
+
mint rename <oldFilename> <newFilename>
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
### Migrating MDX endpoint pages
|
|
122
|
+
|
|
123
|
+
You can migrate MDX endpoint pages to autogenerated pages from your OpenAPI specification using the following command:
|
|
124
|
+
|
|
125
|
+
```bash
|
|
126
|
+
mint migrate-mdx
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
This command converts individual MDX endpoint pages to autogenerated pages defined in your `docs.json`, moves MDX content to the `x-mint` extension in your OpenAPI specification, and updates your navigation. See [Migrating from MDX](/api-playground/migrating-from-mdx) for detailed information.
|
|
130
|
+
|
|
131
|
+
## Formatting
|
|
132
|
+
|
|
133
|
+
While developing locally, we recommend using extensions in your IDE to recognize and format `MDX` files.
|
|
134
|
+
|
|
135
|
+
If you use Cursor, Windsurf, or VS Code, we recommend the [MDX VS Code extension](https://marketplace.visualstudio.com/items?itemName=unifiedjs.vscode-mdx) for syntax highlighting, and [Prettier](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode) for code formatting.
|
|
136
|
+
|
|
137
|
+
If you use JetBrains, we recommend the [MDX IntelliJ IDEA plugin](https://plugins.jetbrains.com/plugin/14944-mdx) for syntax highlighting, and setting up [Prettier](https://prettier.io/docs/webstorm) for code formatting.
|
|
138
|
+
|
|
139
|
+
## Troubleshooting
|
|
140
|
+
|
|
141
|
+
<AccordionGroup>
|
|
142
|
+
<Accordion title="Error: Could not load the "sharp" module using the darwin-arm64 runtime">
|
|
143
|
+
This may be due to an outdated version of node. Try the following:
|
|
144
|
+
|
|
145
|
+
1. Remove the currently-installed version of the mint CLI: `npm uninstall -g mint`
|
|
146
|
+
2. Upgrade to Node.js.
|
|
147
|
+
3. Reinstall the mint CLI: `npm install -g mint`
|
|
148
|
+
</Accordion>
|
|
149
|
+
|
|
150
|
+
<Accordion title="Issue: Encountering an unknown error">
|
|
151
|
+
**Solution**: Go to the root of your device and delete the `~/.mintlify` folder. Afterwards, run `mint dev` again.
|
|
152
|
+
</Accordion>
|
|
153
|
+
|
|
154
|
+
<Accordion title="Error: permission denied">
|
|
155
|
+
This is due to not having the required permissions to globally install node packages.
|
|
156
|
+
|
|
157
|
+
**Solution**: Try running `sudo npm i -g mint`. You will be prompted for your password, which is the one you use to unlock your computer.
|
|
158
|
+
</Accordion>
|
|
159
|
+
|
|
160
|
+
<Accordion title="The local preview doesn't look the same as my docs do on the web">
|
|
161
|
+
This is likely due to an outdated version of the CLI.
|
|
162
|
+
|
|
163
|
+
**Solution:** Run `mint update` to get the latest changes.
|
|
164
|
+
</Accordion>
|
|
165
|
+
|
|
166
|
+
<Accordion title="mintlify vs. mint package">
|
|
167
|
+
If you have any problems with the CLI package, you should first run `npm ls -g`. This command shows what packages are globally installed on your machine.
|
|
168
|
+
|
|
169
|
+
If you don't use npm or don't see it in the -g list, try `which mint` to locate the installation.
|
|
170
|
+
|
|
171
|
+
If you have a package named `mint` and a package named `mintlify` installed, you should uninstall `mintlify`.
|
|
172
|
+
|
|
173
|
+
1. Uninstall the old package:
|
|
174
|
+
|
|
175
|
+
```bash
|
|
176
|
+
npm uninstall -g mintlify
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
2. Clear your npm cache:
|
|
180
|
+
|
|
181
|
+
```bash
|
|
182
|
+
npm cache clean --force
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
3. Reinstall the new package:
|
|
186
|
+
|
|
187
|
+
```bash
|
|
188
|
+
npm i -g mint
|
|
189
|
+
```
|
|
190
|
+
</Accordion>
|
|
191
|
+
</AccordionGroup>
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: 快速上手
|
|
3
|
+
sidebarTitle: 快速上手
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
快速入门指南将会向你展示最快速的安装、配置、启动方式。
|
|
7
|
+
|
|
8
|
+
完成本指南后,你将拥有一个可以自由集成不同 MCP 的服务,允许你可有控制提供给小智的 MCP 工具。
|
|
9
|
+
|
|
10
|
+
<Info>
|
|
11
|
+
**前期准备**:
|
|
12
|
+
在开始之前,你至少需要有一个小智硬件设备,并已添加至小智官方服务端。
|
|
13
|
+
</Info>
|
|
14
|
+
|
|
15
|
+
## 环境准备
|
|
16
|
+
|
|
17
|
+
请先安装好 node 与 pnpm。
|
|
18
|
+
|
|
19
|
+
<Info>如果你已经准备好 node & pnpm 可以跳过此步骤</Info>
|
|
20
|
+
|
|
21
|
+
<Steps>
|
|
22
|
+
<Step title="安装Node">
|
|
23
|
+
请前往 [Node官方安装地址](https://nodejs.org/en/download) 进行安装,并验证安装是否成功。
|
|
24
|
+
|
|
25
|
+
以下为 node:22(LTS) + pnpm 的安装方式
|
|
26
|
+
<CodeGroup>
|
|
27
|
+
```bash macos / linux
|
|
28
|
+
# 下载并安装 nvm:
|
|
29
|
+
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash
|
|
30
|
+
|
|
31
|
+
# 重启shell
|
|
32
|
+
\. "$HOME/.nvm/nvm.sh"
|
|
33
|
+
|
|
34
|
+
# 下载并安装 Node.js:
|
|
35
|
+
nvm install 22
|
|
36
|
+
|
|
37
|
+
# 验证 Node.js 版本:
|
|
38
|
+
node -v # 应该打印出 "v22.19.0".
|
|
39
|
+
|
|
40
|
+
# 下载并安装 pnpm:
|
|
41
|
+
corepack enable pnpm
|
|
42
|
+
|
|
43
|
+
# 验证 pnpm 版本:
|
|
44
|
+
pnpm -v
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
```bash windows
|
|
48
|
+
# 下载并安装 Chocolatey:
|
|
49
|
+
powershell -c "irm https://community.chocolatey.org/install.ps1|iex"
|
|
50
|
+
|
|
51
|
+
# 下载并安装 Node.js:
|
|
52
|
+
choco install nodejs --version="22.19.0"
|
|
53
|
+
|
|
54
|
+
# 验证 Node.js 版本:
|
|
55
|
+
node -v # 应该打印出 "v22.19.0".
|
|
56
|
+
|
|
57
|
+
# 下载并安装 pnpm:
|
|
58
|
+
corepack enable pnpm
|
|
59
|
+
|
|
60
|
+
# 验证 pnpm 版本:
|
|
61
|
+
pnpm -v
|
|
62
|
+
```
|
|
63
|
+
</CodeGroup>
|
|
64
|
+
|
|
65
|
+
</Step>
|
|
66
|
+
|
|
67
|
+
<Step title="安装 xiaozhi-client 命令行工具">
|
|
68
|
+
<CodeGroup>
|
|
69
|
+
```bash pnpm
|
|
70
|
+
pnpm install -g xiaozhi-client
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
```bash npm
|
|
74
|
+
npm install -g xiaozhi-client
|
|
75
|
+
```
|
|
76
|
+
</CodeGroup>
|
|
77
|
+
</Step>
|
|
78
|
+
|
|
79
|
+
<Step title="创建应用">
|
|
80
|
+
```bash
|
|
81
|
+
# 创建应用
|
|
82
|
+
xiaozhi create my-app
|
|
83
|
+
|
|
84
|
+
# 进入应用目录
|
|
85
|
+
cd my-app
|
|
86
|
+
|
|
87
|
+
# 安装依赖
|
|
88
|
+
pnpm install
|
|
89
|
+
```
|
|
90
|
+
</Step>
|
|
91
|
+
|
|
92
|
+
<Step title="设置小智接入点">
|
|
93
|
+
小智AI配置MCP接入点的 [使用说明](https://ccnphfhqs21z.feishu.cn/wiki/HiPEwZ37XiitnwktX13cEM5KnSb)
|
|
94
|
+
```bash
|
|
95
|
+
xiaozhi config set mcpEndpoint "<从小智服务端获取到的接入点地址>"
|
|
96
|
+
```
|
|
97
|
+
</Step>
|
|
98
|
+
|
|
99
|
+
<Step title="启动服务">
|
|
100
|
+
```bash
|
|
101
|
+
xiaozhi start
|
|
102
|
+
```
|
|
103
|
+
</Step>
|
|
104
|
+
|
|
105
|
+
<Step title="验证是否成功">
|
|
106
|
+
最后,请前往小智服务端,检查对应的接入点,刷新后是否能获取到工具列表
|
|
107
|
+
</Step>
|
|
108
|
+
</Steps>
|
package/docs/images/preview.png
CHANGED
|
Binary file
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: 常用命令
|
|
3
|
+
sidebarTitle: 常用命令
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
| 命令 | 说明 |
|
|
7
|
+
| --------------------------------------------- | --------------------------- |
|
|
8
|
+
| xiaozhi help | 帮助信息 |
|
|
9
|
+
| xiaozhi create | 创建应用 |
|
|
10
|
+
| xiaozhi start | 启动服务 |
|
|
11
|
+
| xiaozhi stop | 停止服务 |
|
|
12
|
+
| xiaozhi status | 查看服务状态 |
|
|
13
|
+
| xiaozhi config mcpEndpoint \<小智接入点地址\> | 设置小智接入点 |
|
|
14
|
+
| xiaozhi mcp list | 列出所有 MCP 服务 |
|
|
15
|
+
| xiaozhi mcp list --tools | 列出所有正在使用的 MCP 工具 |
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: 使用 Docker 部署
|
|
3
|
+
sidebarTitle: 使用 Docker 部署
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
<Info>
|
|
7
|
+
**前期准备**:
|
|
8
|
+
在开始之前,你至少需要有一个小智硬件设备,并已添加至小智官方服务端。并且已准备好
|
|
9
|
+
Docker 环境
|
|
10
|
+
</Info>
|
|
11
|
+
|
|
12
|
+
## 安装方式
|
|
13
|
+
|
|
14
|
+
### 方式一:使用启动脚本(推荐)
|
|
15
|
+
|
|
16
|
+
<Info>
|
|
17
|
+
如果你的网络环境无法访问 github ,可以使用 gitee 进行安装
|
|
18
|
+
</Info>
|
|
19
|
+
<CodeGroup>
|
|
20
|
+
```bash github
|
|
21
|
+
# 下载脚本
|
|
22
|
+
curl -fsSL https://raw.githubusercontent.com/shenjingnan/xiaozhi-client/main/docker-start.sh | bash
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
```bash gitee
|
|
26
|
+
curl -fsSL https://gitee.com/shenjingnan/xiaozhi-client/raw/main/docker-start.sh | bash
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
</CodeGroup>
|
|
30
|
+
|
|
31
|
+
### 方式二:使用 Docker Compose
|
|
32
|
+
|
|
33
|
+
<Steps>
|
|
34
|
+
<Step title="获取 docker-compose.yml">
|
|
35
|
+
<CodeGroup>
|
|
36
|
+
```bash github
|
|
37
|
+
curl -O https://raw.githubusercontent.com/shenjingnan/xiaozhi-client/main/docker-compose.yml
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
```bash gitee
|
|
41
|
+
curl -O https://gitee.com/shenjingnan/xiaozhi-client/raw/main/docker-compose.yml
|
|
42
|
+
```
|
|
43
|
+
</CodeGroup>
|
|
44
|
+
|
|
45
|
+
</Step>
|
|
46
|
+
|
|
47
|
+
<Step title="启动服务">
|
|
48
|
+
<CodeGroup>
|
|
49
|
+
```bash
|
|
50
|
+
docker-compose up -d
|
|
51
|
+
```
|
|
52
|
+
</CodeGroup>
|
|
53
|
+
</Step>
|
|
54
|
+
</Steps>
|
|
55
|
+
|
|
56
|
+
### 方式三:手动启动
|
|
57
|
+
|
|
58
|
+
<Steps>
|
|
59
|
+
<Step title="创建挂载点目录">
|
|
60
|
+
<CodeGroup>
|
|
61
|
+
```bash macos / linux
|
|
62
|
+
mkdir -p ~/xiaozhi-client
|
|
63
|
+
```
|
|
64
|
+
</CodeGroup>
|
|
65
|
+
</Step>
|
|
66
|
+
|
|
67
|
+
<Step title="拉取镜像并启动服务">
|
|
68
|
+
<CodeGroup>
|
|
69
|
+
```bash
|
|
70
|
+
docker run -d \
|
|
71
|
+
--name xiaozhi-client \
|
|
72
|
+
-p 9999:9999 \
|
|
73
|
+
-v ~/xiaozhi-client:/workspaces \
|
|
74
|
+
--restart unless-stopped \
|
|
75
|
+
shenjingnan/xiaozhi-client
|
|
76
|
+
```
|
|
77
|
+
</CodeGroup>
|
|
78
|
+
</Step>
|
|
79
|
+
</Steps>
|
|
80
|
+
|
|
81
|
+
## 管理接入点
|
|
82
|
+
|
|
83
|
+
<Info>
|
|
84
|
+
在启动容器服务之后,我们需要配置小智接入点,才可以正常使用
|
|
85
|
+
</Info>
|
|
86
|
+
|
|
87
|
+
<Steps>
|
|
88
|
+
<Step title="打开管理界面">
|
|
89
|
+
如果你的容器和你的本机在一起,可以直接使用浏览器打开网址:http://localhost:9999
|
|
90
|
+
如果你是在单独的设备部署容器,请确保你的电脑和单独的容器设备在同一个局域网,然后打开对应IP地址:http://{容器IP}:9999
|
|
91
|
+
</Step>
|
|
92
|
+
|
|
93
|
+
<Step title="配置小智接入点">
|
|
94
|
+
TODO
|
|
95
|
+
</Step>
|
|
96
|
+
<Step title="重启服务">
|
|
97
|
+
TODO
|
|
98
|
+
</Step>
|
|
99
|
+
</Steps>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "xiaozhi-client",
|
|
3
|
-
"version": "1.7.
|
|
3
|
+
"version": "1.7.3",
|
|
4
4
|
"description": "小智 AI 客户端 命令行工具",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/cli.js",
|
|
@@ -25,6 +25,7 @@
|
|
|
25
25
|
"build:web": "cd web && pnpm install && pnpm run build",
|
|
26
26
|
"dev": "cross-env NODE_ENV=development tsup --watch",
|
|
27
27
|
"test": "vitest run",
|
|
28
|
+
"test:silent": "vitest run --silent=true",
|
|
28
29
|
"test:watch": "vitest",
|
|
29
30
|
"test:coverage": "vitest run --coverage",
|
|
30
31
|
"test:ui": "vitest --ui",
|
|
@@ -37,7 +38,8 @@
|
|
|
37
38
|
"spell:check": "cspell \"src/**/*.ts\" \"*.md\" \"*.json\"",
|
|
38
39
|
"duplicate:check": "jscpd src/",
|
|
39
40
|
"docker:update-version": "node scripts/update-dockerfile-version.js",
|
|
40
|
-
"example": "node --loader ts-node/esm"
|
|
41
|
+
"example": "node --loader ts-node/esm",
|
|
42
|
+
"docs:dev": "cd docs && mintlify dev"
|
|
41
43
|
},
|
|
42
44
|
"keywords": [
|
|
43
45
|
"xiaozhi",
|
|
@@ -61,7 +63,7 @@
|
|
|
61
63
|
"dotenv": "^17.2.1",
|
|
62
64
|
"eventsource": "^4.0.0",
|
|
63
65
|
"express": "^5.1.0",
|
|
64
|
-
"hono": "^4.9.
|
|
66
|
+
"hono": "^4.9.7",
|
|
65
67
|
"json5": "^2.2.3",
|
|
66
68
|
"json5-writer": "^0.2.0",
|
|
67
69
|
"jsonc-parser": "^3.3.1",
|
|
@@ -90,6 +92,7 @@
|
|
|
90
92
|
"glob": "^11.0.3",
|
|
91
93
|
"happy-dom": "^18.0.1",
|
|
92
94
|
"jscpd": "^4.0.5",
|
|
95
|
+
"mintlify": "^4.2.107",
|
|
93
96
|
"release-it": "^19.0.4",
|
|
94
97
|
"semver": "^7.7.2",
|
|
95
98
|
"supertest": "^7.1.4",
|
|
@@ -103,7 +106,9 @@
|
|
|
103
106
|
"overrides": {
|
|
104
107
|
"form-data": "^4.0.4",
|
|
105
108
|
"braces": ">=3.0.3",
|
|
106
|
-
"micromatch": ">=4.0.8"
|
|
109
|
+
"micromatch": ">=4.0.8",
|
|
110
|
+
"axios": ">=1.12.0"
|
|
107
111
|
}
|
|
108
|
-
}
|
|
112
|
+
},
|
|
113
|
+
"packageManager": "pnpm@10.13.1"
|
|
109
114
|
}
|