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
16 changes: 10 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ without any MCP client setup. Same content, two surfaces: humans read
the MDX, agents query over MCP.

```bash
export AI_GATEWAY_API_KEY=... # free proxy; your provider key routes through it
npx helpbase login # magic-link, no card, free 500k tokens/day
npx helpbase context . # synthesize cited how-tos from your repo
npx helpbase context . --ask "how do I log in?" # answer in terminal, no MCP client required
```
Expand Down Expand Up @@ -113,20 +113,24 @@ teammates deploy to the same tenant. CI users can skip the prompt with

### Generate articles from your site with AI

Pass `--url` and helpbase scrapes the page, sends it through the Vercel AI
Gateway, and writes structured MDX articles to `content/`. Each article
Pass `--url` and helpbase scrapes the page, generates structured MDX through
the hosted helpbase proxy, and writes the articles to `content/`. Each article
comes back with a title, description, tags, and a full markdown body.

```bash
export AI_GATEWAY_API_KEY=your_key_here
npx helpbase login # once, free tier (500k tokens/day)
npx create-helpbase my-help-center --url https://yourproduct.com --test
```

Get your key at [vercel.com/ai-gateway](https://vercel.com/ai-gateway). The
`--test` flag uses Gemini 3.1 Flash Lite for cheap, fast generation. Pass
The `--test` flag uses Gemini 3.1 Flash Lite for cheap, fast generation. Pass
`--model anthropic/claude-sonnet-4.6` (or any Gateway-supported model) to
override.

**Power users + CI:** skip the helpbase proxy entirely with your own
[Vercel AI Gateway](https://vercel.com/ai-gateway) key — `export
AI_GATEWAY_API_KEY=...` before running. See
[helpbase.dev/docs/byok](https://helpbase.dev/docs/byok).

### Drop into an existing Next.js app

If you already have a Next.js + shadcn/ui project, add helpbase as a shadcn
Expand Down
84 changes: 84 additions & 0 deletions apps/web/app/(main)/errors/[code]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,90 @@ const ERRORS: Record<string, ErrorDoc> = {
"Run `npx create-helpbase my-help-center` to start a fresh one.",
],
},
"e-auth-required": {
code: "E_AUTH_REQUIRED",
title: "Not signed in to helpbase",
summary:
"A command that needs authentication (generate, sync, context) ran without a helpbase session and without a BYOK key.",
causes: [
"You haven't run `helpbase login` on this machine yet.",
"Your session expired and could not be refreshed.",
"In CI, `HELPBASE_TOKEN` is either not set or no longer valid.",
],
fixes: [
"Run `helpbase login` — free tier, no card, 500k tokens/day.",
"For CI: set `HELPBASE_TOKEN` to a valid session token.",
"Or bring your own key: `export AI_GATEWAY_API_KEY=…` (see /docs/byok).",
],
seeAlso: [{ label: "BYOK docs", href: "/docs/byok" }],
},
"e-quota-exceeded": {
code: "E_QUOTA_EXCEEDED",
title: "Daily free-tier quota reached",
summary:
"You've used today's free allocation of tokens across helpbase LLM calls. The limit resets at UTC midnight.",
causes: [
"You hit 500,000 tokens of generate / sync / context --ask calls today.",
"A single call would take you over the remaining budget.",
],
fixes: [
"Wait for the UTC-midnight reset.",
"Join the paid-tier waitlist: https://helpbase.dev/waitlist",
"Bring your own Vercel AI Gateway key: `export AI_GATEWAY_API_KEY=…` (unlimited, your own bill).",
],
seeAlso: [
{ label: "Waitlist", href: "/waitlist" },
{ label: "BYOK docs", href: "/docs/byok" },
],
},
"e-global-cap": {
code: "E_GLOBAL_CAP",
title: "helpbase is over its daily cap",
summary:
"helpbase enforces a global 10M-token-per-day circuit breaker to protect against runaway spend. That cap was hit.",
causes: [
"A load spike (genuine or otherwise) exhausted the global daily allocation.",
"Resets at UTC midnight like the per-user cap.",
],
fixes: [
"Wait for the UTC-midnight reset.",
"Bring your own Vercel AI Gateway key to bypass the hosted proxy entirely: `export AI_GATEWAY_API_KEY=…`",
],
seeAlso: [{ label: "BYOK docs", href: "/docs/byok" }],
},
"e-llm-network": {
code: "E_LLM_NETWORK",
title: "Couldn't reach helpbase.dev",
summary:
"The CLI tried to call the hosted LLM proxy but the request never landed — likely a network problem between you and helpbase.dev.",
causes: [
"Internet connection is down or flaky.",
"A corporate proxy or firewall is blocking helpbase.dev.",
"DNS resolution is failing.",
],
fixes: [
"Check your connection and retry — transient blips are common.",
"If you're behind a corporate proxy, verify helpbase.dev is reachable.",
"Fall back to BYOK so calls don't go through helpbase.dev: `export AI_GATEWAY_API_KEY=…`",
],
seeAlso: [{ label: "BYOK docs", href: "/docs/byok" }],
},
"e-llm-gateway": {
code: "E_LLM_GATEWAY",
title: "LLM provider returned an error",
summary:
"The underlying model provider (e.g. Anthropic, Google) returned a non-success response. No tokens were charged against your quota.",
causes: [
"The model ID is wrong or unsupported by Vercel AI Gateway.",
"Upstream provider is degraded.",
"The prompt triggered a provider-side safety filter.",
],
fixes: [
"Retry in a moment — transient upstream errors are common.",
"Try a different `--model` (e.g. `anthropic/claude-sonnet-4.6`).",
"Check status.anthropic.com / openai.com if the problem persists.",
],
},
}

export function generateStaticParams() {
Expand Down
83 changes: 83 additions & 0 deletions apps/web/app/(main)/waitlist/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
import type { Metadata } from "next"
import { joinWaitlist } from "@/lib/waitlist"

export const metadata: Metadata = {
title: "Join the paid-tier waitlist — helpbase",
description:
"helpbase is free to use (500k tokens/day). Paid tier with higher limits is coming. Drop your email to get notified when it ships.",
}

export default function WaitlistPage({
searchParams,
}: {
searchParams?: Promise<{ status?: string; from?: string }>
}) {
return <WaitlistContent searchParamsP={searchParams} />
}

/** Mirrors lib/waitlist.ts — same regex, same fallback. */
const SAFE_SOURCE_RE = /^[a-z0-9_-]{1,40}$/

async function WaitlistContent({
searchParamsP,
}: {
searchParamsP?: Promise<{ status?: string; from?: string }>
}) {
const sp = (await searchParamsP) ?? {}
const status = sp.status
const rawFrom = sp.from ?? "waitlist"
const from = SAFE_SOURCE_RE.test(rawFrom) ? rawFrom : "waitlist"

return (
<main className="mx-auto max-w-xl px-6 py-24">
<p className="font-mono text-xs uppercase tracking-widest text-muted-foreground">
paid tier (coming soon)
</p>
<h1 className="mt-3 text-4xl font-semibold tracking-tight">Join the waitlist</h1>
<p className="mt-4 text-muted-foreground">
helpbase is free to use — 500,000 tokens per day is enough for most teams. A paid tier
with higher limits, priority support, and team accounts is on the way. Drop your email
and we&rsquo;ll let you know when it ships.
</p>

<p className="mt-2 text-sm text-muted-foreground">
Need more tokens right now?{" "}
<a href="/docs/byok" className="underline hover:text-foreground">
Bring your own Vercel AI Gateway key
</a>{" "}
— unlimited, your own cost.
</p>
Comment on lines +44 to +49

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
fd -t f 'page.(tsx|mdx|md)' apps/web/app | rg -i 'byok'
fd -t d 'byok' apps/web
rg -n --type=tsx --type=ts -C2 "'/docs/byok'|\"/docs/byok\""

Repository: Codehagen/helpbase

Length of output: 89


🏁 Script executed:

#!/bin/bash
# Search for files containing 'byok' reference
rg -i 'byok' apps/web --type ts --type tsx

# Look for docs directory structure
find apps/web -type d -name 'docs' | head -20

# Search for any page files with 'byok' in path or content
find apps/web -type f \( -name '*.tsx' -o -name '*.mdx' -o -name '*.md' \) | xargs grep -l -i 'byok' 2>/dev/null | head -20

Repository: Codehagen/helpbase

Length of output: 266


🏁 Script executed:

#!/bin/bash
# Look for docs routing configuration
find apps/web/app -type d -name 'docs' -o -name '[...slug]' | head -20

# Search for app directory structure related to docs
ls -la apps/web/app/

# Check if there's a docs folder or similar
find apps/web/app -maxdepth 3 -type f -name 'page.*' | grep -i doc

# Look at content directory structure
ls -la apps/web/content/
</script>

Repository: Codehagen/helpbase

Length of output: 1004


🏁 Script executed:

#!/bin/bash
# Look for routes in (main) directory
find apps/web/app/\(main\) -type d | sort

# Check if there's a docs folder in (main)
ls -la apps/web/app/\(main\)/ 2>/dev/null

# Search for any dynamic route segments
find apps/web/app -type d -name '\[*' -o -name '\.\.\.*'

# Look for files that handle /docs routing
rg 'docs.*byok|/docs/' apps/web/app --type ts --type tsx -A 2

Repository: Codehagen/helpbase

Length of output: 919


🏁 Script executed:

#!/bin/bash
# Check the page.tsx that handles [category]/[slug]
cat -n apps/web/app/\(main\)/\(docs\)/\[category\]/\[slug\]/page.tsx

# Check if there's middleware or redirects
cat -n apps/web/app/middleware.ts 2>/dev/null || echo "No middleware.ts"

# Check the layout in (docs)
cat -n apps/web/app/\(main\)/\(docs\)/layout.tsx 2>/dev/null || echo "No layout found"

# Verify exact path to content files
ls -la apps/web/content/guides/ | grep byok

Repository: Codehagen/helpbase

Length of output: 9157


🏁 Script executed:

#!/bin/bash
# Confirm the article metadata
cat -n apps/web/content/guides/byok.mdx | head -20

Repository: Codehagen/helpbase

Length of output: 1016


Fix broken BYOK documentation link.

The link should be /guides/byok, not /docs/byok. The docs are organized under route groups, so /docs doesn't appear in the URL. The route is /guides/byok based on the article location at apps/web/content/guides/byok.mdx.

Update line 46:

- <a href="/docs/byok" className="underline hover:text-foreground">
+ <a href="/guides/byok" className="underline hover:text-foreground">
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
Need more tokens right now?{" "}
<a href="/docs/byok" className="underline hover:text-foreground">
Bring your own Vercel AI Gateway key
</a>{" "}
— unlimited, your own cost.
</p>
Need more tokens right now?{" "}
<a href="/guides/byok" className="underline hover:text-foreground">
Bring your own Vercel AI Gateway key
</a>{" "}
— unlimited, your own cost.
</p>
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@apps/web/app/`(main)/waitlist/page.tsx around lines 44 - 49, The anchor for
the BYOK docs currently points to "/docs/byok" but should point to
"/guides/byok"; update the href on the anchor element that renders the "Bring
your own Vercel AI Gateway key" link in page.tsx (the <a> element in the
waitlist page) to use "/guides/byok" so it matches the route group and the
article at apps/web/content/guides/byok.mdx.


{status === "ok" ? (
<div className="mt-8 rounded-md border border-green-500/40 bg-green-500/10 px-4 py-3 text-sm">
Thanks — you&rsquo;re on the list. We&rsquo;ll email you when the paid tier ships.
</div>
) : status === "error" ? (
<div className="mt-8 rounded-md border border-red-500/40 bg-red-500/10 px-4 py-3 text-sm">
Something went wrong. Try again, or email hi@helpbase.dev.
</div>
) : null}

<form action={joinWaitlist} className="mt-8 flex gap-3">
<input type="hidden" name="source" value={from} />
<input
type="email"
name="email"
required
placeholder="you@company.com"
className="flex-1 rounded-md border border-border bg-background px-4 py-2 text-sm outline-none focus:ring-2 focus:ring-ring"
/>
<button
type="submit"
className="rounded-md bg-foreground px-5 py-2 text-sm font-medium text-background hover:opacity-90"
>
Join
</button>
</form>

<p className="mt-6 text-xs text-muted-foreground">
No spam. We&rsquo;ll email once when the paid tier opens. Unsubscribe any time.
</p>
</main>
)
}
Loading
Loading