@@ -5,87 +5,101 @@ const props = defineProps<{
55 locale? : ' zh' | ' en'
66}>()
77
8- const isEnglish = computed (() => props .locale === ' en' )
9-
108const installUnix = ' curl -fsSL https://raw.githubusercontent.com/1024XEngineer/neo-code/main/scripts/install.sh | bash'
119const installWindows = ' irm https://raw.githubusercontent.com/1024XEngineer/neo-code/main/scripts/install.ps1 | iex'
1210const fromSource = ` git clone https://github.com/1024XEngineer/neo-code.git
1311cd neo-code
1412go run ./cmd/neocode `
15- const envUnix = ` export OPENAI_API_KEY="your_key_here"
16- export GEMINI_API_KEY="your_key_here"
17- export AI_API_KEY="your_key_here"
18- export QINIU_API_KEY="your_key_here" `
19- const envWindows = ` $env:OPENAI_API_KEY = "your_key_here"
20- $env:GEMINI_API_KEY = "your_key_here"
21- $env:AI_API_KEY = "your_key_here"
22- $env:QINIU_API_KEY = "your_key_here" `
23- </script >
24-
25- <template >
26- <div class =" quickstart-grid" v-if =" isEnglish" >
27- <article class =" quickstart-card" >
28- <p class =" quickstart-kicker" >Try Now</p >
29- <h3 >Install with one command</h3 >
30- <p >Use the same install scripts maintained in the repository README.</p >
31- <CodePanel language="bash" label="macOS / Linux" :code =" installUnix " />
32- <CodePanel language="powershell" label="Windows PowerShell" :code =" installWindows " />
33- </article >
3413
35- <article class =" quickstart-card" >
36- <p class =" quickstart-kicker" >From Source</p >
37- <h3 >Run the current codebase</h3 >
38- <p >Best when you want to inspect behavior, debug issues, or contribute changes.</p >
39- <CodePanel language="bash" label="Clone and run" :code =" fromSource " />
40- </article >
14+ type QuickStartCard = {
15+ key: string
16+ kicker: string
17+ title: string
18+ description: string
19+ panels: Array <{
20+ language: ' bash' | ' powershell'
21+ label: string
22+ code: string
23+ }>
24+ links: Array <{
25+ text: string
26+ code: string
27+ }>
28+ }
4129
42- <article class =" quickstart-card" >
43- <p class =" quickstart-kicker" >First Run</p >
44- <h3 >Set provider credentials</h3 >
45- <p >NeoCode reads API keys from environment variables instead of storing them in config files.</p >
46- <CodePanel language="bash" label="Shell" :code =" envUnix " />
47- <CodePanel language="powershell" label="PowerShell" :code =" envWindows " />
48- <div class =" quickstart-links" >
49- <p >Workspace isolation: <code >--workdir</code ></p >
50- <p >Gateway command: <code >neocode gateway</code ></p >
51- <p ><a href =" /neo-code/guide/quick-start" >Chinese quick start</a ></p >
52- <p ><a href =" /neo-code/en/docs/" >English docs index</a ></p >
53- </div >
54- </article >
55- </div >
30+ const quickStartCards: Record <' zh' | ' en' , QuickStartCard []> = {
31+ zh: [
32+ {
33+ key: ' install' ,
34+ kicker: ' 安装脚本' ,
35+ title: ' 安装 NeoCode' ,
36+ description: ' 直接使用仓库里维护的安装脚本,适合先把本地环境跑起来。' ,
37+ panels: [
38+ { language: ' bash' , label: ' macOS / Linux' , code: installUnix },
39+ { language: ' powershell' , label: ' Windows PowerShell' , code: installWindows },
40+ ],
41+ links: [{ text: ' 安装完成后运行:' , code: ' neocode' }],
42+ },
43+ {
44+ key: ' source' ,
45+ kicker: ' 源码运行' ,
46+ title: ' 从源码运行' ,
47+ description: ' 准备调试、看源码或参与开发时,直接运行当前仓库即可。' ,
48+ panels: [{ language: ' bash' , label: ' Clone and run' , code: fromSource }],
49+ links: [
50+ { text: ' 网关进程:' , code: ' go run ./cmd/neocode gateway' },
51+ { text: ' 会话工作区:' , code: ' --workdir /path/to/workspace' },
52+ ],
53+ },
54+ ],
55+ en: [
56+ {
57+ key: ' install' ,
58+ kicker: ' Install' ,
59+ title: ' Install with one command' ,
60+ description: ' Use the same install scripts maintained in the repository README.' ,
61+ panels: [
62+ { language: ' bash' , label: ' macOS / Linux' , code: installUnix },
63+ { language: ' powershell' , label: ' Windows PowerShell' , code: installWindows },
64+ ],
65+ links: [{ text: ' Then run: ' , code: ' neocode' }],
66+ },
67+ {
68+ key: ' source' ,
69+ kicker: ' Source' ,
70+ title: ' Run the current codebase' ,
71+ description: ' Best when you want to inspect behavior, debug issues, or contribute changes.' ,
72+ panels: [{ language: ' bash' , label: ' Clone and run' , code: fromSource }],
73+ links: [
74+ { text: ' Gateway command: ' , code: ' go run ./cmd/neocode gateway' },
75+ { text: ' Workspace isolation: ' , code: ' --workdir /path/to/workspace' },
76+ ],
77+ },
78+ ],
79+ }
5680
57- <div class =" quickstart-grid" v-else >
58- <article class =" quickstart-card" >
59- <p class =" quickstart-kicker" >Step 1</p >
60- <h3 >安装 NeoCode</h3 >
61- <p >直接使用仓库里维护的安装脚本,适合先把本地环境跑起来。</p >
62- <CodePanel language="bash" label="macOS / Linux" :code =" installUnix " />
63- <CodePanel language="powershell" label="Windows PowerShell" :code =" installWindows " />
64- </article >
65-
66- <article class =" quickstart-card" >
67- <p class =" quickstart-kicker" >Step 2</p >
68- <h3 >从源码运行</h3 >
69- <p >准备调试、看源码或参与开发时,直接运行当前仓库即可。</p >
70- <CodePanel language="bash" label="Clone and run" :code =" fromSource " />
71- <div class =" quickstart-links" >
72- <p >会话工作区:<code >--workdir /path/to/workspace</code ></p >
73- <p >网关进程:<code >go run ./cmd/neocode gateway</code ></p >
74- </div >
75- </article >
81+ const currentLocale = computed <' zh' | ' en' >(() => (props .locale === ' en' ? ' en' : ' zh' ))
82+ const currentCards = computed (() => quickStartCards [currentLocale .value ])
83+ </script >
7684
77- <article class =" quickstart-card" >
78- <p class =" quickstart-kicker" >Step 3</p >
79- <h3 >配置 API Key</h3 >
80- <p >当前内置 provider 包括 <code >openai</code >、<code >gemini</code >、<code >openll</code > 和 <code >qiniu</code >。</p >
81- <CodePanel language="bash" label="Shell" :code =" envUnix " />
82- <CodePanel language="powershell" label="PowerShell" :code =" envWindows " />
83- <div class =" quickstart-links" >
84- <p >工作区隔离:<code >--workdir</code ></p >
85- <p >网关命令:<code >neocode gateway</code ></p >
86- <p ><a href =" /neo-code/guide/quick-start" >继续看首次上手</a ></p >
87- <p ><a href =" /neo-code/guide/gateway" >查看 Gateway 用法</a ></p >
88- </div >
89- </article >
90- </div >
85+ <template >
86+ <div class =" quickstart-grid" >
87+ <article v-for =" card in currentCards" :key =" card.key" class =" quickstart-card" >
88+ <p class =" quickstart-kicker" >{{ card.kicker }}</p >
89+ <h3 >{{ card.title }}</h3 >
90+ <p >{{ card.description }}</p >
91+ <CodePanel
92+ v-for =" panel in card .panels "
93+ :key =" ` ${card .key }-${panel .label } ` "
94+ :language =" panel .language "
95+ :label =" panel .label "
96+ :code =" panel .code "
97+ />
98+ <div class =" quickstart-links" >
99+ <p v-for =" link in card.links" :key =" `${card.key}-${link.code}`" >
100+ {{ link.text }}<code >{{ link.code }}</code >
101+ </p >
102+ </div >
103+ </article >
104+ </div >
91105</template >
0 commit comments