update
This commit is contained in:
15
cli-center-docs/src/data/docs/00-intro.md
Normal file
15
cli-center-docs/src/data/docs/00-intro.md
Normal file
@@ -0,0 +1,15 @@
|
||||
---
|
||||
title: '介绍'
|
||||
tags: ['introduce']
|
||||
createdAt: '2025-12-18 20:00:00'
|
||||
---
|
||||
|
||||
# @kevisual/cli 目的?
|
||||
|
||||
对于每一个人来说,搭建知识库,自动化,数据可视化,都是一件非常复杂的事情。但是,我们希望通过 `@kevisual/cli` 让这件事情变得非常简单。
|
||||
|
||||
AI 时代,人人都可以成为开发者,每一个人的灵感和想法都能变成代码,而把代码运行起来,把自己的知识库运行起来,也应该有一个体系化的解决方案。而这就是基于这个初衷。
|
||||
|
||||
## 数据代理
|
||||
|
||||
https://kevisual.cn 只作为一个用户管理的平台,而每一个人的设备,都需要运行一个cli,而这个cli负责管理所有的程序的运行,但是通过公网去访问到自己的服务。
|
||||
13
cli-center-docs/src/data/docs/01-login-first.md
Normal file
13
cli-center-docs/src/data/docs/01-login-first.md
Normal file
@@ -0,0 +1,13 @@
|
||||
---
|
||||
title: '第一次登录'
|
||||
tags: ['settings']
|
||||
createdAt: '2025-12-18 20:00:00'
|
||||
---
|
||||
|
||||
## 第一次登录设备
|
||||
|
||||
每一台设备需要有自己的管理员信息,第一次登录的时候,用kevisual.cn 的账号密码登录,就会把这个账号设置为这个设备的管理员账号。
|
||||
|
||||
下一次修改管理员配置,必须管理员才能操作。
|
||||
|
||||
或者自己在 `kevisual/assistant-app/assistant-config.json` 里面修改管理员账号.
|
||||
424
cli-center-docs/src/data/docs/10-config.md
Normal file
424
cli-center-docs/src/data/docs/10-config.md
Normal file
@@ -0,0 +1,424 @@
|
||||
---
|
||||
title: '配置项介绍'
|
||||
description: 'Assistant 应用配置项完整说明文档,包括应用信息、代理、服务器、认证、AI、存储等各项配置详解'
|
||||
tags: ['config', 'configuration', 'settings', 'assistant']
|
||||
createdAt: '2025-12-18'
|
||||
---
|
||||
|
||||
# 配置项介绍
|
||||
|
||||
本文档详细介绍 Assistant 应用的所有配置项。配置文件通常为 JSON 格式,用于定制应用的行为和功能。
|
||||
|
||||
## app - 应用信息
|
||||
|
||||
应用的基本标识信息。
|
||||
|
||||
```json
|
||||
{
|
||||
"app": {
|
||||
"id": "my-assistant-001",
|
||||
"url": "https://my-app.example.com"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
| 字段 | 类型 | 说明 |
|
||||
| ---- | -------- | ------------------------------------------ |
|
||||
| id | `string` | 应用唯一标识符,用于识别具体设备或应用实例 |
|
||||
| url | `string` | 应用访问地址 |
|
||||
|
||||
## token - 访问令牌
|
||||
|
||||
用于身份验证的访问令牌。
|
||||
|
||||
```json
|
||||
{
|
||||
"token": "your-access-token"
|
||||
}
|
||||
```
|
||||
|
||||
| 字段 | 类型 | 说明 |
|
||||
| ----- | -------- | -------- |
|
||||
| token | `string` | 访问令牌 |
|
||||
|
||||
## registry - 注册中心
|
||||
|
||||
注册中心地址,默认为 `https://kevisual.cn`。
|
||||
|
||||
```json
|
||||
{
|
||||
"registry": "https://kevisual.cn"
|
||||
}
|
||||
```
|
||||
|
||||
| 字段 | 类型 | 说明 |
|
||||
| -------- | -------- | ------------ |
|
||||
| registry | `string` | 注册中心地址 |
|
||||
|
||||
## proxy - 前端代理配置
|
||||
|
||||
前端路由代理配置,用于将特定路径转发到目标服务器。
|
||||
|
||||
```json
|
||||
{
|
||||
"proxy": [
|
||||
{
|
||||
"path": "/root/home",
|
||||
"target": "https://kevisual.cn",
|
||||
"pathname": "/root/home"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
| 字段 | 类型 | 说明 |
|
||||
| ---------------- | ------------- | ---------------------- |
|
||||
| proxy | `ProxyInfo[]` | 代理配置数组 |
|
||||
| proxy[].path | `string` | 匹配的路径前缀 |
|
||||
| proxy[].target | `string` | 目标服务器地址 |
|
||||
| proxy[].pathname | `string` | 转发到目标服务器的路径 |
|
||||
|
||||
示例:访问 `/root/home` 会被转发到 `https://kevisual.cn/root/home`
|
||||
|
||||
## api - API代理配置
|
||||
|
||||
专门用于 API 请求的代理配置,例如 `/api` 或 `/v1` 开头的请求。
|
||||
|
||||
```json
|
||||
{
|
||||
"api": {
|
||||
"proxy": [
|
||||
{
|
||||
"path": "/api",
|
||||
"target": "https://api.example.com"
|
||||
},
|
||||
{
|
||||
"path": "/v1",
|
||||
"target": "https://api-v1.example.com"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
| 字段 | 类型 | 说明 |
|
||||
|------|------|{------|
|
||||
| api.proxy | `ProxyInfo[]` | API代理配置数组 |
|
||||
|
||||
## router - 路由配置
|
||||
|
||||
配置应用的路由代理功能。
|
||||
|
||||
```json
|
||||
{
|
||||
"router": {
|
||||
"proxy": [
|
||||
{
|
||||
"type": "router",
|
||||
"router": {
|
||||
"url": "https://kevisual.cn/api/router"
|
||||
}
|
||||
}
|
||||
],
|
||||
"base": true
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
| 字段 | 类型 | 说明 |
|
||||
| ------------ | ------------- | ----------------------------------------------------------------- |
|
||||
| router.proxy | `ProxyInfo[]` | 代理配置数组 |
|
||||
| router.base | `boolean` | 是否注册基础路由,监听https://kevisual.cn/api/router,默认 `false` |
|
||||
|
||||
## description - 应用描述
|
||||
|
||||
应用的描述信息。
|
||||
|
||||
```json
|
||||
{
|
||||
"description": "我的助手应用"
|
||||
}
|
||||
```
|
||||
|
||||
| 字段 | 类型 | 说明 |
|
||||
| ----------- | -------- | ------------ |
|
||||
| description | `string` | 应用描述信息 |
|
||||
|
||||
## server - 服务器配置
|
||||
|
||||
配置本地服务器的监听地址和端口。
|
||||
|
||||
```json
|
||||
{
|
||||
"server": {
|
||||
"path": "127.0.0.1",
|
||||
"port": 3000
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
| 字段 | 类型 | 说明 |
|
||||
| ----------- | --------- | -------------------------------- |
|
||||
| server.path | `string`` | 服务器监听地址,默认 `127.0.0.1` |
|
||||
| server.port | `number` | 服务器监听端口号 |
|
||||
|
||||
## share - 远程访问配置
|
||||
|
||||
配置应用是否可被远程调用。
|
||||
|
||||
```json
|
||||
{
|
||||
"share": {
|
||||
"url": "https://kevisual.cn/ws/proxy",
|
||||
"enabled": true
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
| 字段 | 类型 | 说明 |
|
||||
| ------------- | --------- | -------------------- |
|
||||
| share.url | `string` | 远程应用代理地址 |
|
||||
| share.enabled | `boolean` | 是否启用远程访问功能 |
|
||||
|
||||
## watch - 文件监听配置
|
||||
|
||||
配置是否监听 pages 目录下的文件变化。
|
||||
|
||||
```json
|
||||
{
|
||||
"watch": {
|
||||
"enabled": true
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
| 字段 | 类型 | 说明 |
|
||||
| ------------- | --------- | ---------------- |
|
||||
| watch.enabled | `boolean` | 是否启用文件监听 |
|
||||
|
||||
## home - 首页路径
|
||||
|
||||
访问根路径 `/` 时自动重定向的首页地址。
|
||||
|
||||
```json
|
||||
{
|
||||
"home": "/root/home"
|
||||
}
|
||||
```
|
||||
|
||||
| 字段 | 类型 | 说明 |
|
||||
| ---- | -------- | -------- |
|
||||
| home | `string` | 首页路径 |
|
||||
|
||||
## ai - AI功能配置
|
||||
|
||||
启用和配置本地 AI 代理功能。
|
||||
|
||||
```json
|
||||
{
|
||||
"ai": {
|
||||
"enabled": true,
|
||||
"provider": "DeepSeek",
|
||||
"apiKey": "your-api-key",
|
||||
"model": "deepseek-chat"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
| 字段 | 类型 | 说明 |
|
||||
| ----------- | --------- | ---------------------------- | ---------- |
|
||||
| ai.enabled | `boolean` | 是否启用 AI 功能 |
|
||||
| ai.provider | `string` | AI 提供商,可选 `'DeepSeek'` | `'Custom'` |
|
||||
| ai.apiKey | `string` | API 密钥 |
|
||||
| ai.model | `string` | 使用的模型名称 |
|
||||
|
||||
## asr - 语音识别配置
|
||||
|
||||
配置阿里云语音识别服务。
|
||||
|
||||
```json
|
||||
{
|
||||
"asr": {
|
||||
"enabled": true,
|
||||
"token": "your-asr-token"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
| 字段 | 类型 | 说明 |
|
||||
| ----------- | --------- | -------------------- |
|
||||
| asr.enabled | `boolean` | 是否启用语音识别功能 |
|
||||
| asr.token | `string` | 阿里云 ASR 服务令牌 |
|
||||
|
||||
使用模型:`qwen3-asr-flash-realtime`
|
||||
|
||||
## auth - 认证和权限配置
|
||||
|
||||
配置应用的认证和访问权限策略。
|
||||
|
||||
```json
|
||||
{
|
||||
"auth": {
|
||||
"share": "protected"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
| 字段 | 类型 | 说明 |
|
||||
| ---------- | -------- | ------------------------------------------------- |
|
||||
| auth.share | `string` | 共享访问模式,影响 pages 目录下页面的对外共享权限 |
|
||||
|
||||
**share 可选值:**
|
||||
|
||||
- `"protected"` - 需要认证才能访问(默认)
|
||||
- `"public"` - 公开访问,无需认证
|
||||
- `"private"` - 私有访问,完全禁止外部访问
|
||||
|
||||
## storage - 存储配置
|
||||
|
||||
配置文件存储,支持本地文件系统和 S3/MinIO 两种存储方式。
|
||||
|
||||
### 本地文件存储 (FileStorage)
|
||||
|
||||
```json
|
||||
{
|
||||
"storage": [
|
||||
{
|
||||
"id": "local-storage",
|
||||
"path": "./uploads",
|
||||
"type": "local"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
### S3/MinIO 存储 (S3Storage)
|
||||
|
||||
```json
|
||||
{
|
||||
"storage": [
|
||||
{
|
||||
"id": "s3-storage",
|
||||
"bucket": "my-bucket",
|
||||
"region": "us-east-1",
|
||||
"accessKeyId": "AKIAXXXXXXXXXXXXXXXX",
|
||||
"secretAccessKey": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
|
||||
"endpoint": "https://s3.amazonaws.com",
|
||||
"type": "s3"
|
||||
},
|
||||
{
|
||||
"id": "minio-storage",
|
||||
"bucket": "my-bucket",
|
||||
"region": "us-east-1",
|
||||
"accessKeyId": "minioadmin",
|
||||
"secretAccessKey": "minioadmin",
|
||||
"endpoint": "http://localhost:9000",
|
||||
"type": "minio"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
| 字段 | 类型 | 说明 |
|
||||
| ------------------------- | ---------------------------- | ------------------------------------------------------- |
|
||||
| storage[].id | `string` | 存储标识符,唯一标识一个存储配置 |
|
||||
| storage[].type | `'local' \| 's3' \| 'minio'` | 存储类型 |
|
||||
| storage[].path | `string` | 本地存储路径(仅 type 为 `local` 时有效) |
|
||||
| storage[].bucket | `string` | 存储桶名称(仅 type 为 `s3` 或 `minio` 时有效) |
|
||||
| storage[].region | `string` | 存储区域(仅 type 为 `s3` 或 `minio` 时有效) |
|
||||
| storage[].accessKeyId | `string` | 访问密钥 ID(仅 type 为 `s3` 或 `minio` 时有效) |
|
||||
| storage[].secretAccessKey | `string` | 访问密钥(仅 type 为 `s3` 或 `minio` 时有效) |
|
||||
| storage[].endpoint | `string` | 服务端点地址(仅 type 为 `s3` 或 `minio` 时有效,可选) |
|
||||
|
||||
## 完整配置示例
|
||||
|
||||
```json
|
||||
{
|
||||
"app": {
|
||||
"id": "assistant-prod-001",
|
||||
"url": "https://app.example.com"
|
||||
},
|
||||
"token": "your-secure-token",
|
||||
"registry": "https://kevisual.cn",
|
||||
"proxy": [
|
||||
{
|
||||
"path": "/root/home",
|
||||
"target": "https://kevisual.cn",
|
||||
"pathname": "/root/home"
|
||||
}
|
||||
],
|
||||
"api": {
|
||||
"proxy": [
|
||||
{
|
||||
"path": "/api",
|
||||
"target": "https://api.example.com"
|
||||
}
|
||||
]
|
||||
},
|
||||
"router": {
|
||||
"proxy": [
|
||||
{
|
||||
"type": "router",
|
||||
"router": {
|
||||
"url": "https://kevisual.cn/api/router"
|
||||
}
|
||||
}
|
||||
],
|
||||
"base": true
|
||||
},
|
||||
"description": "生产环境助手应用",
|
||||
"server": {
|
||||
"path": "0.0.0.0",
|
||||
"port": 3000
|
||||
},
|
||||
"share": {
|
||||
"url": "https://kevisual.cn/ws/proxy",
|
||||
"enabled": true
|
||||
},
|
||||
"watch": {
|
||||
"enabled": true
|
||||
},
|
||||
"home": "/root/home",
|
||||
"ai": {
|
||||
"enabled": true,
|
||||
"provider": "DeepSeek",
|
||||
"apiKey": "sk-xxx",
|
||||
"model": "deepseek-chat"
|
||||
},
|
||||
"asr": {
|
||||
"enabled": true,
|
||||
"token": "your-asr-token"
|
||||
},
|
||||
"auth": {
|
||||
"share": "protected"
|
||||
},
|
||||
"storage": [
|
||||
{
|
||||
"id": "local-storage",
|
||||
"path": "./uploads",
|
||||
"type": "local"
|
||||
},
|
||||
{
|
||||
"id": "s3-storage",
|
||||
"bucket": "my-bucket",
|
||||
"region": "us-east-1",
|
||||
"accessKeyId": "AKIAXXXXXXXXXXXXXXXX",
|
||||
"secretAccessKey": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
|
||||
"endpoint": "https://s3.amazonaws.com",
|
||||
"type": "s3"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
## 配置文件位置
|
||||
|
||||
配置文件通常位于项目根目录,文件名为 `kevisual.json` 或其他约定名称。
|
||||
|
||||
## 最佳实践
|
||||
|
||||
1. **安全性**: 不要在配置文件中硬编码敏感信息(如 token、apiKey、secretAccessKey),建议使用环境变量
|
||||
2. **端口选择**: 确保选择的端口未被占用
|
||||
3. **代理配置**: 合理配置代理路径,避免路径冲突
|
||||
4. **权限控制**: 根据实际需求选择合适的 `auth.share` 模式
|
||||
5. **存储配置**: 根据应用规模选择合适的存储方式,本地存储适合开发和小型应用,S3/MinIO 适合生产环境
|
||||
Reference in New Issue
Block a user