Skip to content

The Open Standard for Generative UI

Add @latest to all npx @openuidev/cli commands (#373)

Zahle Khan29a6e6e7e6cc
diff --git a/docs/content/docs/api-reference/react-ui.mdx b/docs/content/docs/api-reference/react-ui.mdx
index 4c6f7063b..b6cdf360d 100644
--- a/docs/content/docs/api-reference/react-ui.mdx
+++ b/docs/content/docs/api-reference/react-ui.mdx
@@ -124,7 +124,7 @@ import {
Generate the system prompt at build time with the CLI:
```bash
-npx @openuidev/cli generate ./src/library.ts --out src/generated/system-prompt.txt
+npx @openuidev/cli@latest generate ./src/library.ts --out src/generated/system-prompt.txt
```
```tsx
diff --git a/docs/content/docs/chat/from-scratch.mdx b/docs/content/docs/chat/from-scratch.mdx
index dfb520fde..a26e15f1d 100644
--- a/docs/content/docs/chat/from-scratch.mdx
+++ b/docs/content/docs/chat/from-scratch.mdx
@@ -27,7 +27,7 @@ If you want Generative UI, generate a system prompt from the component library.
If you only want plain text chat, you can skip this step and omit `componentLibrary` in the next examples.
```bash
-npx @openuidev/cli generate ./src/library.ts --out src/generated/system-prompt.txt
+npx @openuidev/cli@latest generate ./src/library.ts --out src/generated/system-prompt.txt
```
Where `src/library.ts` exports your library:
diff --git a/docs/content/docs/chat/genui.mdx b/docs/content/docs/chat/genui.mdx
index e4e173efc..861590cca 100644
--- a/docs/content/docs/chat/genui.mdx
+++ b/docs/content/docs/chat/genui.mdx
@@ -20,7 +20,7 @@ If either side is missing, the model falls back to plain text or emits component
Generate the system prompt with the CLI:
```bash
-npx @openuidev/cli generate ./src/library.ts --out src/generated/system-prompt.txt
+npx @openuidev/cli@latest generate ./src/library.ts --out src/generated/system-prompt.txt
```
The CLI auto-detects exported `PromptOptions` alongside your library, so examples and rules are included automatically. See [System Prompts](/docs/openui-lang/system-prompts) for details.
@@ -82,7 +82,7 @@ If you need domain-specific components, keep the same request flow and swap in y
First, generate the system prompt from your custom library:
```bash
-npx @openuidev/cli generate ./src/lib/my-library.ts --out src/generated/system-prompt.txt
+npx @openuidev/cli@latest generate ./src/lib/my-library.ts --out src/generated/system-prompt.txt
```
Then wire up the frontend — it only needs the component library for rendering:
diff --git a/docs/content/docs/chat/nextjs.mdx b/docs/content/docs/chat/nextjs.mdx
index 75384eee2..9912a52a7 100644
--- a/docs/content/docs/chat/nextjs.mdx
+++ b/docs/content/docs/chat/nextjs.mdx
@@ -19,7 +19,7 @@ This page focuses on one specific backend pattern:
Generate the system prompt at build time:
```bash
-npx @openuidev/cli generate ./src/library.ts --out src/generated/system-prompt.txt
+npx @openuidev/cli@latest generate ./src/library.ts --out src/generated/system-prompt.txt
```
Create `app/api/chat/route.ts`:
diff --git a/docs/content/docs/openui-lang/standard-library.mdx b/docs/content/docs/openui-lang/standard-library.mdx
index dd754fa5d..f8eeeaeef 100644
--- a/docs/content/docs/openui-lang/standard-library.mdx
+++ b/docs/content/docs/openui-lang/standard-library.mdx
@@ -26,7 +26,7 @@ import { openuiLibrary } from "@openuidev/react-ui";
Use the CLI to generate the system prompt at build time:
```bash
-npx @openuidev/cli generate ./src/library.ts --out src/generated/system-prompt.txt
+npx @openuidev/cli@latest generate ./src/library.ts --out src/generated/system-prompt.txt
```
Or generate programmatically:
diff --git a/docs/content/docs/openui-lang/system-prompts.mdx b/docs/content/docs/openui-lang/system-prompts.mdx
index fc522a348..ecc0b365b 100644
--- a/docs/content/docs/openui-lang/system-prompts.mdx
+++ b/docs/content/docs/openui-lang/system-prompts.mdx
@@ -10,19 +10,19 @@ description: Generate and customize prompt instructions from your OpenUI library
The fastest way to generate a system prompt — works with any backend language:
```bash
-npx @openuidev/cli generate ./src/library.ts
+npx @openuidev/cli@latest generate ./src/library.ts
```
Write to a file:
```bash
-npx @openuidev/cli generate ./src/library.ts --out system-prompt.txt
+npx @openuidev/cli@latest generate ./src/library.ts --out system-prompt.txt
```
Generate JSON Schema instead:
```bash
-npx @openuidev/cli generate ./src/library.ts --json-schema
+npx @openuidev/cli@latest generate ./src/library.ts --json-schema
```
The CLI auto-detects exported `PromptOptions` (examples, rules) alongside your library. Use `--prompt-options <name>` to pick a specific export.
diff --git a/docs/imports/OpenUiGeneratesSchema.tsx b/docs/imports/OpenUiGeneratesSchema.tsx
index ab23e8742..b361ce8be 100644
--- a/docs/imports/OpenUiGeneratesSchema.tsx
+++ b/docs/imports/OpenUiGeneratesSchema.tsx
@@ -14,7 +14,7 @@ function Group() {
</svg>
</div>
<p className="absolute font-['Andale_Mono:Regular',sans-serif] h-[262px] leading-none left-[73px] not-italic text-[10px] text-white top-[71px] w-[254px] whitespace-pre-wrap">{`# generate system prompt from library
-npx @openuidev/cli generate ./src/library.ts
+npx @openuidev/cli@latest generate ./src/library.ts
# use in your backend
const completion = await client.chat.completions.create({
diff --git a/examples/openui-react-native/backend/package.json b/examples/openui-react-native/backend/package.json
index 01e54201c..87a533aef 100644
--- a/examples/openui-react-native/backend/package.json
+++ b/examples/openui-react-native/backend/package.json
@@ -6,7 +6,7 @@
"dev": "next dev",
"build": "next build",
"start": "next start",
- "generate:prompt": "npx @openuidev/cli generate ./src/library.ts --out ./src/system-prompt.txt"
+ "generate:prompt": "npx @openuidev/cli@latest generate ./src/library.ts --out ./src/system-prompt.txt"
},
"dependencies": {
"next": "^15.2.3",
diff --git a/packages/openui-cli/README.md b/packages/openui-cli/README.md
index 64af1cfd4..8bfeea375 100644
--- a/packages/openui-cli/README.md
+++ b/packages/openui-cli/README.md
@@ -15,9 +15,9 @@ It currently supports two workflows:
Run the CLI with your package manager of choice:
```bash
-npx @openuidev/cli --help
-pnpm dlx @openuidev/cli --help
-bunx @openuidev/cli --help
+npx @openuidev/cli@latest --help
+pnpm dlx @openuidev/cli@latest --help
+bunx @openuidev/cli@latest --help
```
## Quick Start
@@ -31,13 +31,13 @@ npx @openuidev/cli@latest create
Generate a prompt from a library file:
```bash
-npx @openuidev/cli generate ./src/library.ts
+npx @openuidev/cli@latest generate ./src/library.ts
```
Generate JSON Schema instead:
```bash
-npx @openuidev/cli generate ./src/library.ts --json-schema
+npx @openuidev/cli@latest generate ./src/library.ts --json-schema
```
## Commands