Skip to content

Commit e49554d

Browse files
authored
port docs site from mintlify to fumadocs (#175)
* docs: address review findings on auth examples and docs app - replace credential-in-argument examples in auth-matrix with the interactive wizard flow (shell history and process list exposure) - warn about flag-based credential entry in the authentication guide - document credential-specific validation endpoints for auth check - distinguish session-only filters from V1-compatible filters - fix KAGI_SESSION_TOKEN examples that pointed at a file path instead of a token value; correct the subshell inheritance example - gate the lens workflow on KAGI_SESSION_TOKEN, not just auth check - stop recommending committing config.toml with credentials - fix mermaid diagram edges (KAGI_API_KEY for search/extract) and the config lookup order in the precedence example - render mermaid blocks via @theguild/remark-mermaid - fix literal *kagi* markers inside code spans, align Alpine Linux entry with published assets, point regenerated demo gifs at public/images - add completion to commands nav, toon format note in assistant page, drop leftover probe.ts * docs: apply second-round review nits - lens workflow guard also confirms the selected credential is a session token via auth status output, matching real CLI output format - index page: clarify that the redacted template is what gets committed while kagi auth writes credentials to ~/.config/kagi-cli/config.toml, add extract to the public-API mermaid diagram (KAGI_API_KEY) - demos: mkdir the docs/public/images/demos output dir actually used by the agg commands - auth-matrix: drop contradictory region classification (V1-compatible only), rename the legacy-token migration heading
1 parent 3425671 commit e49554d

81 files changed

Lines changed: 5136 additions & 288 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.coderabbit.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ knowledge_base:
55
filePatterns:
66
- files: "CONTRIBUTING.md"
77
applyTo: "**/*"
8-
- files: ".facts,docs/reference/output-contract.mdx"
8+
- files: ".facts,docs/content/docs/reference/output-contract.mdx"
99
applyTo: "src/**/*.rs,tests/**/*.rs"
10-
- files: "docs/reference/auth-matrix.mdx"
10+
- files: "docs/content/docs/reference/auth-matrix.mdx"
1111
applyTo: "src/auth*.rs,src/api.rs,src/http.rs,src/main.rs"
12-
- files: "docs/commands/mcp.mdx"
12+
- files: "docs/content/docs/commands/mcp.mdx"
1313
applyTo: "src/main.rs,src/cli.rs,src/mcp_install.rs,tests/**/*.rs"
1414
- files: "docs/release-runbook.md"
1515
applyTo: "Cargo.toml,Cargo.lock,npm/**/*.cjs,npm/package.json,CHANGELOG.md,.github/workflows/release.yml,.github/workflows/npm-publish.yml"

.github/workflows/release.yml

Lines changed: 10 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -207,28 +207,14 @@ jobs:
207207
gh release create "$RELEASE_TAG" dist/* --notes-file dist/release-notes.md --title "$RELEASE_TAG" --verify-tag
208208
fi
209209
210-
- name: Trigger Mintlify docs deployment
211-
id: trigger_mintlify_docs
210+
- name: Build Fumadocs docs site
211+
id: build_docs_site
212212
continue-on-error: true
213-
env:
214-
MINTLIFY_DEPLOY_COOKIE: ${{ secrets.MINTLIFY_DEPLOY_COOKIE }}
215213
run: |
216214
set -euo pipefail
217-
218-
if [ -z "${MINTLIFY_DEPLOY_COOKIE:-}" ]; then
219-
echo "MINTLIFY_DEPLOY_COOKIE is not configured; skipping Mintlify deployment trigger."
220-
echo "status=skipped" >> "$GITHUB_OUTPUT"
221-
exit 0
222-
fi
223-
224-
curl -fsS -X POST \
225-
-H "accept: */*" \
226-
-H "content-type: application/json" \
227-
-H "origin: https://app.mintlify.com" \
228-
-H "referer: https://app.mintlify.com/kagi-cli/kagi-cli" \
229-
-H "cookie: ${MINTLIFY_DEPLOY_COOKIE}" \
230-
https://app.mintlify.com/api/deployment/update/kagi-cli
231-
echo "status=triggered" >> "$GITHUB_OUTPUT"
215+
corepack enable
216+
pnpm --dir docs install --frozen-lockfile
217+
pnpm --dir docs build
232218
233219
- name: Sync Homebrew tap and Scoop bucket
234220
id: sync_package_indexes
@@ -512,6 +498,11 @@ jobs:
512498
fi
513499
echo "status=synced" >> "$GITHUB_OUTPUT"
514500
501+
- name: Report docs build warning
502+
if: steps.build_docs_site.outcome == 'failure'
503+
run: |
504+
echo "::warning title=Docs build failed::GitHub release assets were published, but the Fumadocs docs app under docs/ did not build. Fix the build failure so docs changes can ship."
505+
515506
- name: Report package index sync warning
516507
if: steps.sync_package_indexes.outcome == 'failure' || steps.sync_package_indexes.outputs.status == 'skipped'
517508
run: |
@@ -522,7 +513,3 @@ jobs:
522513
run: |
523514
echo "::warning title=AUR package sync incomplete::GitHub release assets were published, but the AUR package was not updated. Configure AUR_SSH_PRIVATE_KEY or update the AUR package manually."
524515
525-
- name: Report Mintlify deployment warning
526-
if: steps.trigger_mintlify_docs.outcome == 'failure' || steps.trigger_mintlify_docs.outputs.status == 'skipped'
527-
run: |
528-
echo "::warning title=Mintlify deployment incomplete::GitHub release assets were published, but docs deployment was not confirmed. Configure or rotate MINTLIFY_DEPLOY_COOKIE, or trigger the deployment from the Mintlify dashboard."

docs/.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
node_modules/
2+
.next/
3+
.source/
4+
next-env.d.ts
5+
*.tsbuildinfo

docs/.mintignore

Lines changed: 0 additions & 21 deletions
This file was deleted.

docs/app/[[...slug]]/page.tsx

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
import { source } from '@/lib/source';
2+
import { DocsLayout } from 'fumadocs-ui/layouts/docs';
3+
import { DocsBody, DocsPage } from 'fumadocs-ui/page';
4+
import { getMDXComponents } from '@/mdx-components';
5+
import { notFound } from 'next/navigation';
6+
import type { Metadata } from 'next';
7+
import { Logo } from '@/components/logo';
8+
9+
export default async function Page(props: {
10+
params: Promise<{ slug?: string[] }>;
11+
}) {
12+
const params = await props.params;
13+
const page = source.getPage(params.slug);
14+
if (!page) notFound();
15+
16+
const MDX = page.data.body;
17+
18+
return (
19+
<DocsLayout
20+
tree={source.pageTree}
21+
nav={{ title: <Logo /> }}
22+
links={[
23+
{ text: 'GitHub', url: 'https://github.com/Microck/kagi-cli' },
24+
{ text: 'npm', url: 'https://www.npmjs.com/package/kagi-cli' },
25+
{ text: 'Kagi', url: 'https://kagi.com' },
26+
]}
27+
>
28+
<DocsPage toc={page.data.toc}>
29+
<DocsBody>
30+
<MDX />
31+
</DocsBody>
32+
</DocsPage>
33+
</DocsLayout>
34+
);
35+
}
36+
37+
export function generateStaticParams() {
38+
return source.generateParams();
39+
}
40+
41+
export async function generateMetadata(props: {
42+
params: Promise<{ slug?: string[] }>;
43+
}) {
44+
const params = await props.params;
45+
const page = source.getPage(params.slug);
46+
if (!page) notFound();
47+
48+
return {
49+
title: page.data.title,
50+
description: page.data.description,
51+
};
52+
}

docs/app/api/search/route.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import { createFromSource } from 'fumadocs-core/search/server';
2+
import { source } from '@/lib/source';
3+
4+
export const { GET } = createFromSource(source);

docs/app/global.css

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
@import 'tailwindcss';
2+
@import 'fumadocs-ui/css/neutral.css';
3+
@import 'fumadocs-ui/css/preset.css';
4+
@import 'remark-github-blockquote-alert/alert.css';
5+
6+
/*
7+
* Kagi brand theme (ported from Mintlify docs.json "maple" theme):
8+
* primary #ffb319, light #ffc85a, dark #18181a
9+
*/
10+
:root {
11+
--color-fd-primary: #ffb319;
12+
}
13+
14+
.dark {
15+
--color-fd-primary: #ffc85a;
16+
--color-fd-background: #18181a;
17+
}

docs/app/layout.tsx

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import './global.css';
2+
import { RootProvider } from 'fumadocs-ui/provider';
3+
import type { Metadata } from 'next';
4+
import type { ReactNode } from 'react';
5+
6+
export const metadata: Metadata = {
7+
title: {
8+
template: '%s | kagi CLI',
9+
default: 'kagi CLI documentation',
10+
},
11+
description:
12+
'Documentation for the kagi CLI, a command-line interface and MCP server for Kagi search, summarization, extraction, and automation.',
13+
metadataBase: new URL('https://kagi.micr.dev'),
14+
icons: '/images/favicon.png',
15+
};
16+
17+
export default function RootLayout({ children }: { children: ReactNode }) {
18+
return (
19+
<html lang="en" className="flex h-full flex-col antialiased" suppressHydrationWarning>
20+
<body className="flex min-h-full flex-col">
21+
<RootProvider>{children}</RootProvider>
22+
</body>
23+
</html>
24+
);
25+
}

docs/components/logo.tsx

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import Link from 'next/link';
2+
3+
// Brand logos from the Mintlify config: light variant for light mode,
4+
// dark variant for dark mode.
5+
export function Logo() {
6+
return (
7+
<Link href="/" className="inline-flex items-center gap-2 font-semibold">
8+
<img
9+
src="/images/kagi-cli-logo-light.svg"
10+
alt="kagi CLI"
11+
className="h-7 w-auto max-w-[180px] object-contain object-left dark:hidden"
12+
/>
13+
<img
14+
src="/images/kagi-cli-logo-dark.svg"
15+
alt="kagi CLI"
16+
className="hidden h-7 w-auto max-w-[180px] object-contain object-left dark:block"
17+
/>
18+
</Link>
19+
);
20+
}
File renamed without changes.

0 commit comments

Comments
 (0)