https://github.com/smashedr/vitepress-chat
VitePress AI Chat Plugin
https://github.com/smashedr/vitepress-chat
vitepress-plugin
Last synced: about 2 months ago
JSON representation
VitePress AI Chat Plugin
- Host: GitHub
- URL: https://github.com/smashedr/vitepress-chat
- Owner: smashedr
- License: mit
- Created: 2026-05-19T02:18:59.000Z (2 months ago)
- Default Branch: master
- Last Pushed: 2026-06-06T06:47:13.000Z (about 2 months ago)
- Last Synced: 2026-06-06T08:13:33.117Z (about 2 months ago)
- Topics: vitepress-plugin
- Language: Vue
- Homepage: https://smashedr.github.io/vitepress-chat/
- Size: 255 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Support: docs/support.md
- Agents: AGENTS.md
Awesome Lists containing this project
README
[](https://github.com/smashedr/vitepress-chat/releases/latest)
[](https://github.com/smashedr/vitepress-chat/deployments/docs)
[](https://github.com/smashedr/vitepress-chat/deployments/preview)
[](https://github.com/smashedr/vitepress-chat/actions/workflows/release.yaml)
[](https://github.com/smashedr/vitepress-chat/actions/workflows/lint.yaml)
[](https://github.com/smashedr/vitepress-chat/pulse)
[](https://github.com/smashedr/vitepress-chat?tab=readme-ov-file#readme)
[](https://github.com/smashedr/vitepress-chat?tab=readme-ov-file#readme)
[](https://github.com/smashedr/vitepress-chat/graphs/contributors)
[](https://github.com/smashedr/vitepress-chat/issues)
[](https://github.com/smashedr/vitepress-chat/discussions)
[](https://github.com/smashedr/vitepress-chat/forks)
[](https://github.com/smashedr/vitepress-chat/stargazers)
[](https://cssnr.github.io/)
[](https://discord.gg/wXy6m2X8wY)
[](https://ko-fi.com/cssnr)
# VitePress Chat
- [Install](#Install)
- [Setup](#Setup)
- [Server](#Server)
- [Development](#Development)
- [Support](#Support)
- [Contributing](#Contributing)
A VitePress Chat Plugin providing AI Chat support trained on your docs.
Includes instructions generator plugin, or works with your existing plugin.
Securely connect to any AI provider you choose via the [ai-chat-server](https://github.com/smashedr/ai-chat-server) proxy.
💯 100% Free to use with Zen OpenCode or Gemini Free Tier!
🔒 The [server](https://github.com/smashedr/ai-chat-server) features live-streaming results, input token caching, retry on failure and much more.
Works with Claude, Gemini, OpenAI, or any [OpenAI Compatible Provider](https://ai-sdk.dev/providers/openai-compatible-providers).
[](https://smashedr.github.io/vitepress-chat/)
- Client: https://github.com/smashedr/vitepress-chat
- Server: https://github.com/smashedr/ai-chat-server
### Features
- Set Custom Button And Header Text and Link
- Includes Instructions Generation Plugin
- Set Custom File Name and Exclude Globs
- Works with Existing LLM Generation Plugins
- Plus all the [Server Features](https://github.com/smashedr/ai-chat-server?tab=readme-ov-file#features)
Built with the [AI SDK](https://ai-sdk.dev/).
## Install
Using your favorite package manager...
```shell
npm install github:smashedr/vitepress-chat
```
Install a [tagged release](https://github.com/smashedr/vitepress-chat/releases) or hash.
```shell
npm install github:smashedr/vitepress-chat#0.1.2
```
Update after installing.
```shell
npm update @cssnr/vitepress-chat
```
[](https://smashedr.github.io/vitepress-chat/)
## Setup
There are two components, the [Chat Plugin](#chat-plugin) which adds the chat button and box.
Plus the [Instructions Generator](#instructions-generator) plugin which generates instructions.txt file.
This allows you to use this with other instructions generator plugins or existing `llms.txt` files.
### Chat Plugin
Add the plugin to your theme.
- `.vitepress/theme/index.[js,ts]`.
Using the default theme.
```typescript
import DefaultTheme from 'vitepress/theme'
import chat from '@cssnr/vitepress-chat'
import '@cssnr/vitepress-chat/style.css'
// https://vitepress.dev/guide/extending-default-theme
export default {
...DefaultTheme,
...chat(DefaultTheme, {
api: 'https://ai-chat-server.cssnr.com/',
headers: { Authorization: 'Basic Abc123=' },
}),
}
```
Using a [custom layout](https://vitepress.dev/guide/extending-default-theme#layout-slots).
```typescript
import DefaultTheme from 'vitepress/theme'
import MyLayout from './MyLayout.vue'
import chat from '@cssnr/vitepress-chat'
import '@cssnr/vitepress-chat/style.css'
export default {
...DefaultTheme,
...chat(MyLayout, {
api: 'https://ai-chat-server.cssnr.com/',
}),
}
```
With a custom file name to use with other generators like [vitepress-plugin-llms](https://github.com/okineadev/vitepress-plugin-llms).
```typescript
export default {
...chat(DefaultTheme, {
api: 'https://ai-chat-server.cssnr.com/',
filePath: 'llms-full.txt',
}),
}
```
With a remote URL path.
```typescript
export default {
...chat(DefaultTheme, {
api: 'https://ai-chat-server.cssnr.com/',
filePath: 'https://smashedr.github.io/vitepress-chat/llms.txt',
}),
}
```
See the [ChatOptions](https://github.com/smashedr/vitepress-chat/blob/master/src/index.ts#L6) for more details...
### Instructions Generator
Add the instruction generator plugin to your config.
- `.vitepress/config.[ts,mts]`
This generates the `instructiosn.txt` from your docs folder when you run dev or build.
```typescript
import { defineConfig } from 'vitepress'
import instructions from '@cssnr/vitepress-chat/instructions'
// https://vitepress.dev/reference/site-config
export default defineConfig({
vite: {
plugins: [instructions()],
},
})
```
To exclude files/folders from the instructions use the exclude globs.
```typescript
export default defineConfig({
vite: {
plugins: [instructions({ exclude: ['index.md', 'include/**/*'] })],
},
})
```
See the [InstructionsOptions](https://github.com/smashedr/vitepress-chat/blob/master/src/instructions.ts#L8) for more details...
## Server
For server set instructions see:
- Documentation:
- GitHub Repository:
[](https://render.com/deploy?repo=https://github.com/smashedr/ai-chat-server)
## Development
The docs run the plugin from source.
Create a `.env.development` file similar to this.
```text
VITE_AI_AUTH=Basic Abc123=
VITE_AI_API=http://localhost:3000/
VITE_AI_DEV_INSTRUCTIONS=You are a helpful assistant testing a chat box on a website and should respond with text/links in the requested length and formatting.
```
Note the `VITE_AI_DEV_INSTRUCTIONS` will replace the generated `instructions.txt` for development.
Then run the docs to test your changes.
```shell
npm i
npm run docs
```
## Support
If you run into any issues or need help getting started, please do one of the following:
- Report an Issue:
- Q&A Discussion:
- Request a Feature:
- Chat with us on Discord:
[](https://github.com/smashedr/ai-chat-server/issues/new?template=1-feature.yaml)
[](https://github.com/smashedr/ai-chat-server/issues)
[](https://github.com/smashedr/ai-chat-server/discussions)
[](https://discord.gg/wXy6m2X8wY)
## Contributing
Please consider making a donation to support the development of this project
and [additional](https://cssnr.com/) open source projects.
[](https://ko-fi.com/cssnr)
For a full list of current projects visit: [https://cssnr.github.io/](https://cssnr.github.io/)