返回 CodeWhale
getting-started.ts
根目录 / web / lib / content / getting-started.ts
1 /**
2 * getting-started.ts — the canonical new-user path for codewhale.net.
3 *
4 * Four steps, in order: install → provider connection → first task
5 * → optional fleet setup. Both the homepage band and the /docs/guide page
6 * render from this module, so the path reads identically everywhere.
7 *
8 * TRUTH CONTRACT:
9 * - Step copy must match documented behavior in docs/GUIDE.md, docs/MODES.md,
10 * docs/PROVIDERS.md, and docs/FLEET.md. The runtime launches without any
11 * API key (recommended working-agreement setup); model replies require a provider —
12 * hosted key or a keyless loopback route. Do not imply otherwise.
13 * - `href` values are locale-relative (no locale prefix); consumers render
14 * `/${locale}${href}` and the tests assert every target route exists.
15 *
16 * EXTENSION PATH FOR NEW LOCALES: add the locale key to each `{ en, zh }`
17 * pair; commands stay locale-agnostic shell.
18 */
19
20 import type { LocalizedText } from "./vocabulary";
21
22 export interface GuideStep {
23 id: "install" | "first-session" | "connect-provider" | "fleet-workflow";
24 title: LocalizedText;
25 body: LocalizedText;
26 /** Locale-agnostic shell commands shown for the step (may be empty). */
27 commands: string[];
28 /** Deeper-reading link; href is locale-relative. */
29 link: { href: string; label: LocalizedText };
30 }
31
32 export const GETTING_STARTED_STEPS: GuideStep[] = [
33 {
34 id: "install",
35 title: { en: "Install Codewhale", zh: "安装 Codewhale" },
36 body: {
37 en: "The command below installs the latest published release on macOS or Linux. Use the install guide for Windows, package managers, or building the unreleased source candidate.",
38 zh: "下方命令会在 macOS 或 Linux 上安装最新发布版本。Windows、包管理器以及未发布候选版的源码构建方式,请参阅安装指南。",
39 },
40 commands: ["curl -fsSL https://codewhale.net/install.sh | sh"],
41 link: {
42 href: "/install",
43 label: { en: "Full install guide", zh: "完整安装指南" },
44 },
45 },
46 {
47 id: "connect-provider",
48 title: { en: "Connect your model", zh: "连接你的模型" },
49 body: {
50 en: "Model replies need a connection to a hosted or local model. Use your own provider key, as in the DeepSeek example below, or follow the provider guide for other services and local models. Offline setup does not require a key.",
51 zh: "模型回复需要连接云端或本地模型。你可以使用自己的提供商密钥(下方以 DeepSeek 为例),或按提供商指南连接其他服务和本地模型。离线配置不需要密钥。",
52 },
53 commands: ["codewhale auth set --provider deepseek"],
54 link: {
55 href: "/models",
56 label: { en: "Choose a provider", zh: "选择提供商" },
57 },
58 },
59 {
60 id: "first-session",
61 title: { en: "Give it a task", zh: "交给它一项任务" },
62 body: {
63 en: "Open Codewhale in your project folder. Try /mode plan and ask it to explain the project, then use /mode work when you want edits and commands. Shift+Tab changes the approval setting; /provider and /model change the model connection.",
64 zh: "在项目文件夹中打开 Codewhale。先用 /mode plan 让它解释项目;需要修改文件或运行命令时,再切换到 /mode work。Shift+Tab 切换审批设置,/provider 和 /model 用于更改模型连接。",
65 },
66 commands: ["codewhale"],
67 link: {
68 href: "/docs/modes",
69 label: { en: "Modes and permissions", zh: "模式与权限" },
70 },
71 },
72 {
73 id: "fleet-workflow",
74 title: { en: "Add a Fleet when you need one", zh: "需要时配置 Fleet" },
75 body: {
76 en: "When a task would benefit from several models and roles, run /fleet setup inside Codewhale to put a team together. You can see the saved Fleet from your shell with codewhale fleet status.",
77 zh: "当任务需要多个模型和角色配合时,可以在 Codewhale 中运行 /fleet setup 来配置团队,然后在 shell 中用 codewhale fleet status 查看已保存的 Fleet。",
78 },
79 commands: ["/fleet setup", "codewhale fleet status"],
80 link: {
81 href: "/docs/fleet",
82 label: { en: "Fleet and Workflow docs", zh: "Fleet 与 Workflow 文档" },
83 },
84 },
85 ];
86
87 /**
88 * Where to go after the path — discovery links rendered at the end of the
89 * /docs/guide page. Hooks are first-class here on purpose: they are the
90 * supported extension point a new user should find without digging.
91 */
92 export const GUIDE_NEXT_LINKS: { href: string; label: LocalizedText; note: LocalizedText }[] = [
93 {
94 href: "/docs/hooks",
95 label: { en: "Hooks", zh: "钩子" },
96 note: {
97 en: "Run your own commands before and after tool calls, at turn end, and on session events, with per-project trust rules.",
98 zh: "借助项目级信任规则,响应生命周期事件——工具调用前后、回合结束、会话事件。",
99 },
100 },
101 {
102 href: "/docs/modes",
103 label: { en: "Modes and permissions", zh: "模式与权限" },
104 note: {
105 en: "Plan / Work / Operate and Ask / Auto-Review / Full Access: what each one allows.",
106 zh: "Plan / Work / Operate 与 Ask / Auto-Review / Full Access:各自允许做什么。",
107 },
108 },
109 {
110 href: "/docs",
111 label: { en: "Documentation hub", zh: "文档中心" },
112 note: {
113 en: "Browse and search the documentation for help on a specific topic, with a link from each page to its source in the repository.",
114 zh: "你可以浏览或搜索文档来查找需要的帮助,并通过每页的链接查看仓库中的源文档。",
115 },
116 },
117 ];
118
118 lines TYPESCRIPT