Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Artifacts from running/testing templates locally — never commit these.
node_modules/
.next/
.turbo/
dist/
build/

# Scaffold/runtime files
.env
.env.local

# OS/editor noise
.DS_Store
.idea/
.vscode/

next-env.d.ts
*.tsbuildinfo
*/**/pnpm-lock.yaml
11 changes: 9 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,9 @@
# openui-templates
OpenUI CLI Templates
# OpenUI Templates

Scaffold templates for [`@openuidev/cli create`](https://github.com/thesysdev/openui). The CLI fetches a template from this repo's `main` branch at scaffold time, so changes here go live for new scaffolds as soon as they merge with no CLI release needed.

## Layout

- Each top-level folder is one template (`openui-cloud/`, `openui-self-hosted/`).
- `index.json` lists every template with its picker description; the CLI reads it to build the interactive template list. Add new templates there.
- `@openuidev/*` versions are kept in sync automatically: after a package publish in the openui repo, its Update CLI Template Versions workflow opens a bump PR here.
12 changes: 12 additions & 0 deletions index.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"templates": [
{
"name": "openui-cloud",
"description": "OpenUI Cloud — free hosted models, managed history, tools & artifacts; fastest setup (recommended)"
},
{
"name": "openui-self-hosted",
"description": "Self-hosted — bring your own provider and self-manage the entire backend"
}
]
}
50 changes: 50 additions & 0 deletions openui-cloud/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
This is an [OpenUI](https://openui.com) Cloud project bootstrapped with [`openui-cli`](https://openui.com/docs/chat/quick-start).

## Setup

```bash
cp .env.example .env.local # fill THESYS_API_KEY and point the base URLs at your API
```

Required env: `THESYS_API_KEY`, `DEMO_USER_ID`.

## Getting Started

First, run the development server:

```bash
pnpm dev
```

Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.

You can start editing the page by modifying `src/app/api/chat/route.ts` and improving your agent
by adding system prompts or tools.

## Switching Models

Use the model switcher in the chat header to choose a model for new messages. The starter keeps a
small curated model list in `src/lib/models.tsx` and sends the selected `provider/model` id to
`/api/chat`, which validates it against the same list. The built-in list includes Gemini, GPT,
Claude Sonnet, and Claude Opus options; free Gemini variants are marked with a `Free` badge.

The built-in model ids are available on [models.dev's OpenRouter provider
list](https://models.dev/providers/openrouter/).

## SDK packages

- `@openuidev/thesys-server` — the server SDK (`artifactTool`,
`generateSystemPrompt`) used by the `/api/chat` route.
- `@openuidev/thesys` — the React component library (`chatLibrary`, `Presentation`,
`Report`) used by the client page and artifact renderers.
- `@openuidev/react-ui` — the chat UI runtime (`AgentInterface`, `fetchLLM`,
`ModelSwitcher`, storage/stream contracts).
- `@openuidev/devtools` — dev-only widget surfacing errors and the credits notice
(rendered only in development).

## Learn More

To learn more about OpenUI, take a look at the following resources:

- [OpenUI Documentation](https://openui.com/docs) - learn about OpenUI features and API.
- [OpenUI GitHub repository](https://github.com/thesysdev/openui) - your feedback and contributions are welcome!
18 changes: 18 additions & 0 deletions openui-cloud/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { defineConfig, globalIgnores } from "eslint/config";
import nextVitals from "eslint-config-next/core-web-vitals";
import nextTs from "eslint-config-next/typescript";

const eslintConfig = defineConfig([
...nextVitals,
...nextTs,
// Override default ignores of eslint-config-next.
globalIgnores([
// Default ignores of eslint-config-next:
".next/**",
"out/**",
"build/**",
"next-env.d.ts",
]),
]);

export default eslintConfig;
48 changes: 48 additions & 0 deletions openui-cloud/gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.*
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/versions

# testing
/coverage

# next.js
/.next/
/out/

# production
/build

# misc
.DS_Store
*.pem

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*
.pnpm-debug.log*

# env files (can opt-in for committing if needed)
.env*

# vercel
.vercel

# local thread index (created at runtime)
/.data/

# typescript
*.tsbuildinfo
next-env.d.ts

# vendored @openuidev/thesys tarball — obtain separately; never commit (the
# package is distributed via the registry, not this repo).
/vendor/
11 changes: 11 additions & 0 deletions openui-cloud/next.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import type { NextConfig } from "next";

const nextConfig: NextConfig = {
allowedDevOrigins: ["127.0.0.1"],
output: "standalone",
turbopack: {
root: process.cwd(),
},
};

export default nextConfig;
Loading