oatbox
v0.1.1
Published
Install the Oatbox widget in your web app with one command.
Downloads
27
Maintainers
Readme
oatbox CLI
Install the Oatbox widget in your web app with one command.
Quick start
npx oatbox@latest init YOUR_AGENT_IDReplace YOUR_AGENT_ID with the agent ID shown in your Oatbox dashboard at /admin/install.
What it does
- Reads your
package.jsonto detect your framework automatically. - Locates the right file (
app/layout.tsx,index.html,nuxt.config.ts, etc.). - Inserts the Oatbox
<script>tag idempotently — running it twice won't duplicate the tag. - Prints a confirmation with the file path changed.
Supported frameworks
| Framework | Target file edited |
|------------|---------------------------|
| Next.js | app/layout.tsx |
| React | index.html / public/index.html |
| Vue | index.html |
| Nuxt | nuxt.config.ts |
| Angular | src/index.html |
| SvelteKit | src/app.html |
| Svelte | index.html |
| Plain HTML | index.html (auto-detected) |
Options
--origin=<url> Widget server origin
(default: https://app.oatbox.ai)
--dry-run Preview changes without writing files
--force Skip git-dirty check
--framework=<name> Override framework detectionExamples
# Auto-detect and install
npx oatbox@latest init cmnwd9d5w0000aw9kjolkro60
# Preview what would change
npx oatbox@latest init cmnwd9d5w0000aw9kjolkro60 --dry-run
# Override framework detection
npx oatbox@latest init cmnwd9d5w0000aw9kjolkro60 --framework=react
# Self-hosted Oatbox instance
npx oatbox@latest init cmnwd9d5w0000aw9kjolkro60 --origin=https://my.oatbox.instanceWhat this does NOT do
- Install or update npm dependencies
- Start your dev server
- Commit or push any changes to git
- Modify any file other than the single template/entry file listed above
Manual installation
If the CLI can't detect your setup, add this to your HTML <body> manually:
<script src="https://app.oatbox.ai/widget/YOUR_AGENT_ID" async></script>For Next.js, use the next/script component:
import Script from "next/script"
// Inside your layout <body>:
<Script src="https://app.oatbox.ai/widget/YOUR_AGENT_ID" strategy="afterInteractive" />More
Full installation docs: https://app.oatbox.ai/admin/install
Security
This CLI has zero install-time scripts and zero runtime dependencies. It only modifies one file per run (the one your framework's docs point to). Use --dry-run to preview before any change.
Report security issues privately to [email protected] — see the Security Policy.
Changelog
See CHANGELOG.md.
License
MIT
