@opentiny/tiny-robot-cli 0.5.2-alpha.13 → 0.5.2-alpha.14
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 +32 -5
- package/bin/commands/add.js +589 -198
- package/bin/utils.js +139 -47
- package/package.json +4 -3
- package/templates/basic/.env.example +8 -0
- package/templates/basic/README.md +53 -22
- package/templates/basic/index.html +2 -2
- package/templates/basic/package.json +12 -16
- package/templates/basic/public/favicon.svg +1 -0
- package/templates/basic/public/icons.svg +24 -0
- package/templates/basic/src/App.vue +112 -119
- package/templates/basic/src/main.ts +2 -2
- package/templates/basic/tsconfig.app.json +2 -5
- package/templates/basic/tsconfig.node.json +3 -6
- package/templates/basic/vite.config.ts +6 -1
- package/templates/chat/.env.example +8 -0
- package/templates/chat/README.md +21 -13
- package/templates/chat/package.json +5 -5
- package/templates/chat/src/TinyRobotChat.vue +52 -132
- package/templates/chat/src/components/ComposerTools.vue +99 -0
- package/templates/chat/src/{tiny-robot-chat/components → components}/WindowHeader.vue +1 -1
- package/templates/chat/src/{tiny-robot-chat/composables → composables}/useWindow.ts +8 -18
- package/templates/chat/src/config/chat-runtime.ts +82 -0
- package/templates/chat/src/{tiny-robot-chat/config → config}/chat-ui.ts +22 -4
- package/templates/chat/src/index.css +116 -0
- package/templates/chat/src/main.ts +3 -0
- package/templates/basic/public/modelcontextprotocol.png +0 -0
- package/templates/basic/src/components/ChatList.vue +0 -82
- package/templates/basic/src/components/ChatSender.vue +0 -125
- package/templates/basic/src/components/ConversationHistory.vue +0 -136
- package/templates/basic/src/components/HistoryDrawerButton.vue +0 -43
- package/templates/basic/src/components/McpServerPickerButton.vue +0 -278
- package/templates/basic/src/components/ThemeToggleButton.vue +0 -44
- package/templates/basic/src/components/icons/IconDeepThink.vue +0 -29
- package/templates/basic/src/components/icons/IconModelAliyunBailian.vue +0 -51
- package/templates/basic/src/components/icons/IconModelDeepseek.vue +0 -29
- package/templates/basic/src/components/icons/IconMoon.vue +0 -29
- package/templates/basic/src/components/icons/IconPlugin.vue +0 -29
- package/templates/basic/src/components/icons/IconSun.vue +0 -35
- package/templates/basic/src/components/icons/IconWebSearch.vue +0 -36
- package/templates/basic/src/components/icons/index.ts +0 -7
- package/templates/basic/src/composables/useChat.ts +0 -129
- package/templates/basic/src/composables/useMcp.ts +0 -170
- package/templates/basic/src/composables/useModel.ts +0 -82
- package/templates/basic/src/mcpServers.ts +0 -40
- package/templates/basic/src/models.ts +0 -81
- package/templates/chat/src/tiny-robot-chat/components/ComposerTools.vue +0 -72
- package/templates/chat/src/tiny-robot-chat/config/chat-runtime.ts +0 -26
package/README.md
CHANGED
|
@@ -7,22 +7,49 @@ A lightweight CLI for scaffolding TinyRobot-based product projects.
|
|
|
7
7
|
```bash
|
|
8
8
|
npx @opentiny/tiny-robot-cli create my-app
|
|
9
9
|
pnpm dlx @opentiny/tiny-robot-cli create my-app
|
|
10
|
-
npx @opentiny/tiny-robot-cli add chat
|
|
10
|
+
npx @opentiny/tiny-robot-cli add chat --yes
|
|
11
11
|
```
|
|
12
12
|
|
|
13
13
|
## Options
|
|
14
14
|
|
|
15
|
-
- `-t, --template <name>`: template name
|
|
15
|
+
- `-t, --template <name>`: template name; `basic` generates the Chat Basic project
|
|
16
16
|
- `-h, --help`: show help
|
|
17
17
|
|
|
18
|
-
`
|
|
18
|
+
`create` is an overall project scaffold. The `basic` template is aligned with `packages/chat-basic` and is copied into a new project.
|
|
19
|
+
|
|
20
|
+
`add chat` is a local feature injection for an existing Vue project. It creates the isolated `src/tiny-robot-chat/` feature from `packages/cli/templates/chat`, adds the runtime dependencies (including `@vueuse/core`), and imports the feature CSS. It does not modify the host project's Vite configuration. Existing files with different contents are reported as conflicts and are never silently overwritten.
|
|
21
|
+
|
|
22
|
+
By default, `add chat` mounts `TinyRobotChat` into a standard `src/App.vue` when a safe template and script setup block are available, so the generated project includes the floating AI trigger. Use `--no-mount` to keep `App.vue` unchanged and print the mount snippet. Use `--dry-run` to inspect the plan without changing files and `--yes` to skip prompts:
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
npx @opentiny/tiny-robot-cli add chat --dry-run
|
|
26
|
+
npx @opentiny/tiny-robot-cli add chat --yes
|
|
27
|
+
npx @opentiny/tiny-robot-cli add chat --yes --no-mount
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
The feature adds or preserves these dependencies. Compatible versions are kept, and higher versions are not downgraded:
|
|
19
31
|
|
|
20
32
|
- `@opentiny/tiny-robot`
|
|
21
33
|
- `@opentiny/tiny-robot-chat`
|
|
22
34
|
- `@opentiny/tiny-robot-kit`
|
|
23
35
|
- `@opentiny/tiny-robot-svgs`
|
|
24
|
-
|
|
25
|
-
|
|
36
|
+
- `@vueuse/core`
|
|
37
|
+
|
|
38
|
+
Copy the generated `.env.example` to `.env.local`, then configure the provider API URL and API key before starting the project. `add chat` does not create or modify `.env`.
|
|
39
|
+
|
|
40
|
+
The Model Context MCP example uses `/modelcontextprotocol-mcp`. Add this proxy manually to the existing `vite.config.*` file under `server.proxy`, then restart Vite:
|
|
41
|
+
|
|
42
|
+
```ts
|
|
43
|
+
server: {
|
|
44
|
+
proxy: {
|
|
45
|
+
'/modelcontextprotocol-mcp': {
|
|
46
|
+
target: 'https://modelcontextprotocol.io/mcp',
|
|
47
|
+
changeOrigin: true,
|
|
48
|
+
rewrite: (path) => path.replace(/^\/modelcontextprotocol-mcp/, ''),
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
```
|
|
26
53
|
|
|
27
54
|
## Template Documentation
|
|
28
55
|
|