better-cmdk 0.0.12 → 0.0.16
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/dist/nextjs/AGENTS.md +51 -28
- package/dist/remix/AGENTS.md +25 -2
- package/dist/tanstack-start/AGENTS.md +23 -1
- package/dist/vite/AGENTS.md +23 -1
- package/package.json +13 -4
package/dist/nextjs/AGENTS.md
CHANGED
|
@@ -7,7 +7,7 @@ better-cmdk is a command palette with AI chat for React. Your task is to install
|
|
|
7
7
|
Before making changes, detect:
|
|
8
8
|
- Tailwind version: v4 (`@import "tailwindcss"` in CSS) vs v3 (`tailwind.config.js/ts`)
|
|
9
9
|
- Existing shadcn/ui: check for `@/components/ui/command` or similar shadcn command components
|
|
10
|
-
- Package manager: `bun.lockb` → bun, `pnpm-lock.yaml` → pnpm, `yarn.lock` → yarn, `package-lock.json` → npm
|
|
10
|
+
- Package manager: `bun.lock` or `bun.lockb` → bun, `pnpm-lock.yaml` → pnpm, `yarn.lock` → yarn, `package-lock.json` → npm
|
|
11
11
|
|
|
12
12
|
Also ask me:
|
|
13
13
|
|
|
@@ -29,22 +29,44 @@ Docs: https://github.com/ModifyWithAI/better-cmdk/blob/main/INTEGRATION.md
|
|
|
29
29
|
## Step 2: Install
|
|
30
30
|
|
|
31
31
|
**Use the package manager already installed** — check for lockfiles.
|
|
32
|
+
Do not switch package managers.
|
|
32
33
|
|
|
33
34
|
### No AI:
|
|
34
35
|
```bash
|
|
36
|
+
# bun
|
|
35
37
|
bun add better-cmdk
|
|
38
|
+
# pnpm
|
|
39
|
+
pnpm add better-cmdk
|
|
40
|
+
# npm
|
|
41
|
+
npm install better-cmdk
|
|
42
|
+
# yarn
|
|
43
|
+
yarn add better-cmdk
|
|
36
44
|
```
|
|
37
45
|
|
|
38
46
|
### Built-in chat:
|
|
39
47
|
```bash
|
|
48
|
+
# bun
|
|
40
49
|
bun add better-cmdk ai @ai-sdk/react @ai-sdk/openai
|
|
50
|
+
# pnpm
|
|
51
|
+
pnpm add better-cmdk ai @ai-sdk/react @ai-sdk/openai
|
|
52
|
+
# npm
|
|
53
|
+
npm install better-cmdk ai @ai-sdk/react @ai-sdk/openai
|
|
54
|
+
# yarn
|
|
55
|
+
yarn add better-cmdk ai @ai-sdk/react @ai-sdk/openai
|
|
41
56
|
```
|
|
42
57
|
|
|
43
58
|
Substitute `@ai-sdk/anthropic`, `@ai-sdk/google`, etc. based on my preferred AI provider.
|
|
44
59
|
|
|
45
60
|
### ModifyWithAI:
|
|
46
61
|
```bash
|
|
62
|
+
# bun
|
|
47
63
|
bun add better-cmdk modifywithai @ai-sdk/react ai
|
|
64
|
+
# pnpm
|
|
65
|
+
pnpm add better-cmdk modifywithai @ai-sdk/react ai
|
|
66
|
+
# npm
|
|
67
|
+
npm install better-cmdk modifywithai @ai-sdk/react ai
|
|
68
|
+
# yarn
|
|
69
|
+
yarn add better-cmdk modifywithai @ai-sdk/react ai
|
|
48
70
|
```
|
|
49
71
|
|
|
50
72
|
---
|
|
@@ -140,35 +162,36 @@ import { useRouter } from "next/navigation"
|
|
|
140
162
|
import { CommandMenu, type CommandDefinition } from "better-cmdk"
|
|
141
163
|
import { LayoutDashboardIcon, SettingsIcon, SunMoonIcon } from "lucide-react"
|
|
142
164
|
|
|
143
|
-
// REPLACE with discovered commands from my codebase
|
|
144
|
-
const commands: CommandDefinition[] = [
|
|
145
|
-
{
|
|
146
|
-
name: "dashboard",
|
|
147
|
-
label: "Go to Dashboard",
|
|
148
|
-
group: "Navigation",
|
|
149
|
-
icon: <LayoutDashboardIcon className="size-4" />,
|
|
150
|
-
shortcut: "⌘D",
|
|
151
|
-
onSelect: () => router.push("/dashboard"),
|
|
152
|
-
},
|
|
153
|
-
{
|
|
154
|
-
name: "settings",
|
|
155
|
-
label: "Settings",
|
|
156
|
-
group: "Navigation",
|
|
157
|
-
icon: <SettingsIcon className="size-4" />,
|
|
158
|
-
shortcut: "⌘,",
|
|
159
|
-
onSelect: () => router.push("/settings"),
|
|
160
|
-
},
|
|
161
|
-
{
|
|
162
|
-
name: "dark-mode",
|
|
163
|
-
label: "Toggle dark mode",
|
|
164
|
-
group: "Appearance",
|
|
165
|
-
icon: <SunMoonIcon className="size-4" />,
|
|
166
|
-
onSelect: () => document.documentElement.classList.toggle("dark"),
|
|
167
|
-
},
|
|
168
|
-
]
|
|
169
|
-
|
|
170
165
|
export function CommandPalette() {
|
|
171
166
|
const [open, setOpen] = useState(false)
|
|
167
|
+
const router = useRouter()
|
|
168
|
+
|
|
169
|
+
// REPLACE with discovered commands from my codebase
|
|
170
|
+
const commands: CommandDefinition[] = [
|
|
171
|
+
{
|
|
172
|
+
name: "dashboard",
|
|
173
|
+
label: "Go to Dashboard",
|
|
174
|
+
group: "Navigation",
|
|
175
|
+
icon: <LayoutDashboardIcon className="size-4" />,
|
|
176
|
+
shortcut: "⌘D",
|
|
177
|
+
onSelect: () => router.push("/dashboard"),
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
name: "settings",
|
|
181
|
+
label: "Settings",
|
|
182
|
+
group: "Navigation",
|
|
183
|
+
icon: <SettingsIcon className="size-4" />,
|
|
184
|
+
shortcut: "⌘,",
|
|
185
|
+
onSelect: () => router.push("/settings"),
|
|
186
|
+
},
|
|
187
|
+
{
|
|
188
|
+
name: "dark-mode",
|
|
189
|
+
label: "Toggle dark mode",
|
|
190
|
+
group: "Appearance",
|
|
191
|
+
icon: <SunMoonIcon className="size-4" />,
|
|
192
|
+
onSelect: () => document.documentElement.classList.toggle("dark"),
|
|
193
|
+
},
|
|
194
|
+
]
|
|
172
195
|
|
|
173
196
|
useEffect(() => {
|
|
174
197
|
const down = (e: KeyboardEvent) => {
|
package/dist/remix/AGENTS.md
CHANGED
|
@@ -7,7 +7,7 @@ better-cmdk is a command palette with AI chat for React. Your task is to install
|
|
|
7
7
|
Before making changes, detect:
|
|
8
8
|
- Tailwind version: v4 (`@import "tailwindcss"` in CSS) vs v3 (`tailwind.config.js/ts`)
|
|
9
9
|
- Existing shadcn/ui: check for `@/components/ui/command` or similar shadcn command components
|
|
10
|
-
- Package manager: `bun.lockb` → bun, `pnpm-lock.yaml` → pnpm, `yarn.lock` → yarn, `package-lock.json` → npm
|
|
10
|
+
- Package manager: `bun.lock` or `bun.lockb` → bun, `pnpm-lock.yaml` → pnpm, `yarn.lock` → yarn, `package-lock.json` → npm
|
|
11
11
|
|
|
12
12
|
Also ask me:
|
|
13
13
|
|
|
@@ -29,22 +29,44 @@ Docs: https://github.com/ModifyWithAI/better-cmdk/blob/main/INTEGRATION.md
|
|
|
29
29
|
## Step 2: Install
|
|
30
30
|
|
|
31
31
|
**Use the package manager already installed** — check for lockfiles.
|
|
32
|
+
Do not switch package managers.
|
|
32
33
|
|
|
33
34
|
### No AI:
|
|
34
35
|
```bash
|
|
36
|
+
# bun
|
|
35
37
|
bun add better-cmdk
|
|
38
|
+
# pnpm
|
|
39
|
+
pnpm add better-cmdk
|
|
40
|
+
# npm
|
|
41
|
+
npm install better-cmdk
|
|
42
|
+
# yarn
|
|
43
|
+
yarn add better-cmdk
|
|
36
44
|
```
|
|
37
45
|
|
|
38
46
|
### Built-in chat:
|
|
39
47
|
```bash
|
|
48
|
+
# bun
|
|
40
49
|
bun add better-cmdk ai @ai-sdk/react @ai-sdk/openai
|
|
50
|
+
# pnpm
|
|
51
|
+
pnpm add better-cmdk ai @ai-sdk/react @ai-sdk/openai
|
|
52
|
+
# npm
|
|
53
|
+
npm install better-cmdk ai @ai-sdk/react @ai-sdk/openai
|
|
54
|
+
# yarn
|
|
55
|
+
yarn add better-cmdk ai @ai-sdk/react @ai-sdk/openai
|
|
41
56
|
```
|
|
42
57
|
|
|
43
58
|
Substitute `@ai-sdk/anthropic`, `@ai-sdk/google`, etc. based on my preferred AI provider.
|
|
44
59
|
|
|
45
60
|
### ModifyWithAI:
|
|
46
61
|
```bash
|
|
62
|
+
# bun
|
|
47
63
|
bun add better-cmdk modifywithai @ai-sdk/react ai
|
|
64
|
+
# pnpm
|
|
65
|
+
pnpm add better-cmdk modifywithai @ai-sdk/react ai
|
|
66
|
+
# npm
|
|
67
|
+
npm install better-cmdk modifywithai @ai-sdk/react ai
|
|
68
|
+
# yarn
|
|
69
|
+
yarn add better-cmdk modifywithai @ai-sdk/react ai
|
|
48
70
|
```
|
|
49
71
|
|
|
50
72
|
---
|
|
@@ -201,7 +223,8 @@ Create a streaming chat API route, then add `chatEndpoint` to CommandMenu.
|
|
|
201
223
|
// app/routes/api.chat.ts
|
|
202
224
|
import { openai } from "@ai-sdk/openai"
|
|
203
225
|
import { streamText, convertToModelMessages } from "ai"
|
|
204
|
-
import type { UIMessage
|
|
226
|
+
import type { UIMessage } from "ai"
|
|
227
|
+
import type { ActionFunctionArgs } from "react-router"
|
|
205
228
|
|
|
206
229
|
export async function action({ request }: ActionFunctionArgs) {
|
|
207
230
|
const { messages }: { messages: UIMessage[] } = await request.json()
|
|
@@ -7,7 +7,7 @@ better-cmdk is a command palette with AI chat for React. Your task is to install
|
|
|
7
7
|
Before making changes, detect:
|
|
8
8
|
- Tailwind version: v4 (`@import "tailwindcss"` in CSS) vs v3 (`tailwind.config.js/ts`)
|
|
9
9
|
- Existing shadcn/ui: check for `@/components/ui/command` or similar shadcn command components
|
|
10
|
-
- Package manager: `bun.lockb` → bun, `pnpm-lock.yaml` → pnpm, `yarn.lock` → yarn, `package-lock.json` → npm
|
|
10
|
+
- Package manager: `bun.lock` or `bun.lockb` → bun, `pnpm-lock.yaml` → pnpm, `yarn.lock` → yarn, `package-lock.json` → npm
|
|
11
11
|
|
|
12
12
|
Also ask me:
|
|
13
13
|
|
|
@@ -29,22 +29,44 @@ Docs: https://github.com/ModifyWithAI/better-cmdk/blob/main/INTEGRATION.md
|
|
|
29
29
|
## Step 2: Install
|
|
30
30
|
|
|
31
31
|
**Use the package manager already installed** — check for lockfiles.
|
|
32
|
+
Do not switch package managers.
|
|
32
33
|
|
|
33
34
|
### No AI:
|
|
34
35
|
```bash
|
|
36
|
+
# bun
|
|
35
37
|
bun add better-cmdk
|
|
38
|
+
# pnpm
|
|
39
|
+
pnpm add better-cmdk
|
|
40
|
+
# npm
|
|
41
|
+
npm install better-cmdk
|
|
42
|
+
# yarn
|
|
43
|
+
yarn add better-cmdk
|
|
36
44
|
```
|
|
37
45
|
|
|
38
46
|
### Built-in chat:
|
|
39
47
|
```bash
|
|
48
|
+
# bun
|
|
40
49
|
bun add better-cmdk ai @ai-sdk/react @ai-sdk/openai
|
|
50
|
+
# pnpm
|
|
51
|
+
pnpm add better-cmdk ai @ai-sdk/react @ai-sdk/openai
|
|
52
|
+
# npm
|
|
53
|
+
npm install better-cmdk ai @ai-sdk/react @ai-sdk/openai
|
|
54
|
+
# yarn
|
|
55
|
+
yarn add better-cmdk ai @ai-sdk/react @ai-sdk/openai
|
|
41
56
|
```
|
|
42
57
|
|
|
43
58
|
Substitute `@ai-sdk/anthropic`, `@ai-sdk/google`, etc. based on my preferred AI provider.
|
|
44
59
|
|
|
45
60
|
### ModifyWithAI:
|
|
46
61
|
```bash
|
|
62
|
+
# bun
|
|
47
63
|
bun add better-cmdk modifywithai @ai-sdk/react ai
|
|
64
|
+
# pnpm
|
|
65
|
+
pnpm add better-cmdk modifywithai @ai-sdk/react ai
|
|
66
|
+
# npm
|
|
67
|
+
npm install better-cmdk modifywithai @ai-sdk/react ai
|
|
68
|
+
# yarn
|
|
69
|
+
yarn add better-cmdk modifywithai @ai-sdk/react ai
|
|
48
70
|
```
|
|
49
71
|
|
|
50
72
|
---
|
package/dist/vite/AGENTS.md
CHANGED
|
@@ -7,7 +7,7 @@ better-cmdk is a command palette with AI chat for React. Your task is to install
|
|
|
7
7
|
Before making changes, detect:
|
|
8
8
|
- Tailwind version: v4 (`@import "tailwindcss"` in CSS) vs v3 (`tailwind.config.js/ts`)
|
|
9
9
|
- Existing shadcn/ui: check for `@/components/ui/command` or similar shadcn command components
|
|
10
|
-
- Package manager: `bun.lockb` → bun, `pnpm-lock.yaml` → pnpm, `yarn.lock` → yarn, `package-lock.json` → npm
|
|
10
|
+
- Package manager: `bun.lock` or `bun.lockb` → bun, `pnpm-lock.yaml` → pnpm, `yarn.lock` → yarn, `package-lock.json` → npm
|
|
11
11
|
|
|
12
12
|
Also ask me:
|
|
13
13
|
|
|
@@ -29,22 +29,44 @@ Docs: https://github.com/ModifyWithAI/better-cmdk/blob/main/INTEGRATION.md
|
|
|
29
29
|
## Step 2: Install
|
|
30
30
|
|
|
31
31
|
**Use the package manager already installed** — check for lockfiles.
|
|
32
|
+
Do not switch package managers.
|
|
32
33
|
|
|
33
34
|
### No AI:
|
|
34
35
|
```bash
|
|
36
|
+
# bun
|
|
35
37
|
bun add better-cmdk
|
|
38
|
+
# pnpm
|
|
39
|
+
pnpm add better-cmdk
|
|
40
|
+
# npm
|
|
41
|
+
npm install better-cmdk
|
|
42
|
+
# yarn
|
|
43
|
+
yarn add better-cmdk
|
|
36
44
|
```
|
|
37
45
|
|
|
38
46
|
### Built-in chat:
|
|
39
47
|
```bash
|
|
48
|
+
# bun
|
|
40
49
|
bun add better-cmdk ai @ai-sdk/react @ai-sdk/openai
|
|
50
|
+
# pnpm
|
|
51
|
+
pnpm add better-cmdk ai @ai-sdk/react @ai-sdk/openai
|
|
52
|
+
# npm
|
|
53
|
+
npm install better-cmdk ai @ai-sdk/react @ai-sdk/openai
|
|
54
|
+
# yarn
|
|
55
|
+
yarn add better-cmdk ai @ai-sdk/react @ai-sdk/openai
|
|
41
56
|
```
|
|
42
57
|
|
|
43
58
|
Substitute `@ai-sdk/anthropic`, `@ai-sdk/google`, etc. based on my preferred AI provider.
|
|
44
59
|
|
|
45
60
|
### ModifyWithAI:
|
|
46
61
|
```bash
|
|
62
|
+
# bun
|
|
47
63
|
bun add better-cmdk modifywithai @ai-sdk/react ai
|
|
64
|
+
# pnpm
|
|
65
|
+
pnpm add better-cmdk modifywithai @ai-sdk/react ai
|
|
66
|
+
# npm
|
|
67
|
+
npm install better-cmdk modifywithai @ai-sdk/react ai
|
|
68
|
+
# yarn
|
|
69
|
+
yarn add better-cmdk modifywithai @ai-sdk/react ai
|
|
48
70
|
```
|
|
49
71
|
|
|
50
72
|
---
|
package/package.json
CHANGED
|
@@ -1,12 +1,21 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "better-cmdk",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.16",
|
|
4
4
|
"type": "module",
|
|
5
|
-
"
|
|
5
|
+
"main": "./dist/index.js",
|
|
6
|
+
"module": "./dist/index.js",
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
6
8
|
"exports": {
|
|
7
|
-
".":
|
|
9
|
+
".": {
|
|
10
|
+
"import": "./dist/index.js",
|
|
11
|
+
"default": "./dist/index.js",
|
|
12
|
+
"style": "./index.css",
|
|
13
|
+
"types": "./dist/index.d.ts"
|
|
14
|
+
},
|
|
8
15
|
"./lib/utils": "./dist/lib/utils.js",
|
|
9
|
-
"./package.json": "./package.json"
|
|
16
|
+
"./package.json": "./package.json",
|
|
17
|
+
"./index.css": "./index.css",
|
|
18
|
+
"./styles.css": "./dist/styles.css"
|
|
10
19
|
},
|
|
11
20
|
"style": "./index.css",
|
|
12
21
|
"sideEffects": [
|