Skip to content

Commit a47870f

Browse files
committed
feat: update CLI reference styles and improve command discovery handling
1 parent d4f5a4e commit a47870f

File tree

4 files changed

+47
-47
lines changed

4 files changed

+47
-47
lines changed

web/scripts/generate-cli-reference.ts

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -133,14 +133,8 @@ function discoverCommands(): CommandInfo[] {
133133
}
134134
}
135135
} catch (err) {
136-
console.warn('⚠️ Could not run CLI to discover commands. Using fallback.');
137-
// Fallback: just add version command
138-
commands.push({
139-
name: 'version',
140-
description: 'Show version information',
141-
usage: 'azd copilot version',
142-
flags: []
143-
});
136+
console.warn('⚠️ Could not run CLI to discover commands. Skipping generation to preserve existing pages.');
137+
return commands;
144138
}
145139

146140
return commands;
@@ -150,7 +144,7 @@ function generateFlagsTable(command: CommandInfo): string {
150144
if (command.flags.length === 0) return '';
151145

152146
const rows = command.flags.map(f =>
153-
`<tr class="border-t border-[var(--color-border-default)]">
147+
`<tr class="border-t border-[var(--color-border)]">
154148
<td class="py-3 px-4"><code>${f.flag}</code></td>
155149
<td class="py-3 px-4">${f.short ? `<code>${f.short}</code>` : '-'}</td>
156150
<td class="py-3 px-4">${f.description}</td>
@@ -162,7 +156,7 @@ function generateFlagsTable(command: CommandInfo): string {
162156
<div class="overflow-x-auto my-4">
163157
<table class="min-w-full text-sm">
164158
<thead>
165-
<tr class="bg-[var(--color-bg-tertiary)]">
159+
<tr class="bg-[var(--color-muted)]">
166160
<th class="text-left py-3 px-4 font-semibold">Flag</th>
167161
<th class="text-left py-3 px-4 font-semibold">Short</th>
168162
<th class="text-left py-3 px-4 font-semibold">Description</th>
@@ -211,16 +205,16 @@ import Layout from '../../../components/Layout.astro';
211205
212206
.breadcrumb {
213207
font-size: 0.875rem;
214-
color: var(--color-text-tertiary);
208+
color: var(--color-muted-foreground);
215209
margin-bottom: 2rem;
216210
}
217211
218212
.breadcrumb a {
219-
color: var(--color-text-tertiary);
213+
color: var(--color-muted-foreground);
220214
}
221215
222216
.breadcrumb a:hover {
223-
color: var(--color-interactive-default);
217+
color: var(--color-primary);
224218
}
225219
226220
h1 {
@@ -229,7 +223,7 @@ import Layout from '../../../components/Layout.astro';
229223
230224
.description {
231225
font-size: 1.125rem;
232-
color: var(--color-text-secondary);
226+
color: var(--color-muted-foreground);
233227
margin-bottom: 2rem;
234228
}
235229
@@ -242,7 +236,7 @@ import Layout from '../../../components/Layout.astro';
242236
.back-link {
243237
margin-top: 3rem;
244238
padding-top: 2rem;
245-
border-top: 1px solid var(--color-border-default);
239+
border-top: 1px solid var(--color-border);
246240
}
247241
</style>
248242
`;
@@ -312,7 +306,7 @@ import Layout from '../../../components/Layout.astro';
312306
313307
.intro {
314308
font-size: 1.25rem;
315-
color: var(--color-text-secondary);
309+
color: var(--color-muted-foreground);
316310
margin-bottom: 3rem;
317311
}
318312
@@ -328,21 +322,21 @@ import Layout from '../../../components/Layout.astro';
328322
.flags-table {
329323
width: 100%;
330324
font-size: 0.875rem;
331-
border: 1px solid var(--color-border-default);
325+
border: 1px solid var(--color-border);
332326
border-radius: 0.5rem;
333327
overflow: hidden;
334328
}
335329
336330
.flags-table th {
337331
text-align: left;
338332
padding: 0.75rem 1rem;
339-
background: var(--color-bg-tertiary);
333+
background: var(--color-muted);
340334
font-weight: 600;
341335
}
342336
343337
.flags-table td {
344338
padding: 0.75rem 1rem;
345-
border-top: 1px solid var(--color-border-default);
339+
border-top: 1px solid var(--color-border);
346340
}
347341
348342
.commands-grid {
@@ -354,35 +348,35 @@ import Layout from '../../../components/Layout.astro';
354348
.command-card {
355349
display: block;
356350
padding: 1.5rem;
357-
background: var(--color-bg-secondary);
358-
border: 1px solid var(--color-border-default);
351+
background: var(--color-secondary);
352+
border: 1px solid var(--color-border);
359353
border-radius: 0.5rem;
360354
text-decoration: none;
361355
transition: border-color 0.15s ease;
362356
}
363357
364358
.command-card:hover {
365-
border-color: var(--color-interactive-default);
359+
border-color: var(--color-primary);
366360
text-decoration: none;
367361
}
368362
369363
.command-name {
370364
display: block;
371365
font-size: 1rem;
372366
font-weight: 600;
373-
color: var(--color-interactive-default);
367+
color: var(--color-primary);
374368
margin-bottom: 0.5rem;
375369
}
376370
377371
.command-desc {
378-
color: var(--color-text-secondary);
372+
color: var(--color-muted-foreground);
379373
margin: 0 0 0.75rem 0;
380374
font-size: 0.875rem;
381375
}
382376
383377
.command-meta {
384378
font-size: 0.75rem;
385-
color: var(--color-text-tertiary);
379+
color: var(--color-muted-foreground);
386380
}
387381
</style>
388382
`;
@@ -393,6 +387,12 @@ async function main() {
393387

394388
// Discover commands
395389
const commands = discoverCommands();
390+
391+
if (commands.length === 0) {
392+
console.log(' ⏭️ No commands discovered. Preserving existing pages.\n');
393+
return;
394+
}
395+
396396
console.log(` 📋 Discovered ${commands.length} commands: ${commands.map(c => c.name).join(', ')}\n`);
397397

398398
// Ensure output directory exists

web/src/pages/index.astro

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,28 +16,28 @@ const features = [
1616
icon: "",
1717
title: "28 Azure Skills",
1818
description: "Task-specific expertise from deployment patterns to cost estimation to security hardening.",
19-
href: "/azd-copilot/reference/skills/",
19+
href: "/azd-copilot/reference/cli/skills/",
2020
glowColor: "violet" as const,
2121
},
2222
{
2323
icon: "💾",
2424
title: "Checkpoint System",
2525
description: "Save and restore build state at any point. Never lose progress during development.",
26-
href: "/azd-copilot/concepts/checkpoints/",
26+
href: "/azd-copilot/reference/cli/checkpoints/",
2727
glowColor: "emerald" as const,
2828
},
2929
{
3030
icon: "🔌",
3131
title: "MCP Integration",
3232
description: "Connect to Azure, azd, Microsoft Learn, and Context7 MCP servers for extended capabilities.",
33-
href: "/azd-copilot/mcp/",
33+
href: "/azd-copilot/reference/cli/mcp/",
3434
glowColor: "cyan" as const,
3535
},
3636
{
3737
icon: "🏗️",
3838
title: "Build Workflow",
3939
description: "Structured spec-driven development from requirements to deployed application.",
40-
href: "/azd-copilot/concepts/spec-driven/",
40+
href: "/azd-copilot/reference/cli/build/",
4141
glowColor: "violet" as const,
4242
},
4343
{

web/src/pages/reference/cli/index.astro

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ import Layout from '../../../components/Layout.astro';
150150

151151
.intro {
152152
font-size: 1.25rem;
153-
color: var(--color-text-secondary);
153+
color: var(--color-muted-foreground);
154154
margin-bottom: 3rem;
155155
}
156156

@@ -166,21 +166,21 @@ import Layout from '../../../components/Layout.astro';
166166
.flags-table {
167167
width: 100%;
168168
font-size: 0.875rem;
169-
border: 1px solid var(--color-border-default);
169+
border: 1px solid var(--color-border);
170170
border-radius: 0.5rem;
171171
overflow: hidden;
172172
}
173173

174174
.flags-table th {
175175
text-align: left;
176176
padding: 0.75rem 1rem;
177-
background: var(--color-bg-tertiary);
177+
background: var(--color-muted);
178178
font-weight: 600;
179179
}
180180

181181
.flags-table td {
182182
padding: 0.75rem 1rem;
183-
border-top: 1px solid var(--color-border-default);
183+
border-top: 1px solid var(--color-border);
184184
}
185185

186186
.commands-grid {
@@ -192,34 +192,34 @@ import Layout from '../../../components/Layout.astro';
192192
.command-card {
193193
display: block;
194194
padding: 1.5rem;
195-
background: var(--color-bg-secondary);
196-
border: 1px solid var(--color-border-default);
195+
background: var(--color-secondary);
196+
border: 1px solid var(--color-border);
197197
border-radius: 0.5rem;
198198
text-decoration: none;
199199
transition: border-color 0.15s ease;
200200
}
201201

202202
.command-card:hover {
203-
border-color: var(--color-interactive-default);
203+
border-color: var(--color-primary);
204204
text-decoration: none;
205205
}
206206

207207
.command-name {
208208
display: block;
209209
font-size: 1rem;
210210
font-weight: 600;
211-
color: var(--color-interactive-default);
211+
color: var(--color-primary);
212212
margin-bottom: 0.5rem;
213213
}
214214

215215
.command-desc {
216-
color: var(--color-text-secondary);
216+
color: var(--color-muted-foreground);
217217
margin: 0 0 0.75rem 0;
218218
font-size: 0.875rem;
219219
}
220220

221221
.command-meta {
222222
font-size: 0.75rem;
223-
color: var(--color-text-tertiary);
223+
color: var(--color-muted-foreground);
224224
}
225225
</style>

web/src/pages/reference/cli/version.astro

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,19 +21,19 @@ import Layout from '../../../components/Layout.astro';
2121
<div class="overflow-x-auto my-4">
2222
<table class="min-w-full text-sm">
2323
<thead>
24-
<tr class="bg-[var(--color-bg-tertiary)]">
24+
<tr class="bg-[var(--color-muted)]">
2525
<th class="text-left py-3 px-4 font-semibold">Flag</th>
2626
<th class="text-left py-3 px-4 font-semibold">Short</th>
2727
<th class="text-left py-3 px-4 font-semibold">Description</th>
2828
</tr>
2929
</thead>
3030
<tbody>
31-
<tr class="border-t border-[var(--color-border-default)]">
31+
<tr class="border-t border-[var(--color-border)]">
3232
<td class="py-3 px-4"><code>--help</code></td>
3333
<td class="py-3 px-4"><code>-h</code></td>
3434
<td class="py-3 px-4">help for version</td>
3535
</tr>
36-
<tr class="border-t border-[var(--color-border-default)]">
36+
<tr class="border-t border-[var(--color-border)]">
3737
<td class="py-3 px-4"><code>--json</code></td>
3838
<td class="py-3 px-4">-</td>
3939
<td class="py-3 px-4">Output version as JSON</td>
@@ -57,16 +57,16 @@ import Layout from '../../../components/Layout.astro';
5757

5858
.breadcrumb {
5959
font-size: 0.875rem;
60-
color: var(--color-text-tertiary);
60+
color: var(--color-muted-foreground);
6161
margin-bottom: 2rem;
6262
}
6363

6464
.breadcrumb a {
65-
color: var(--color-text-tertiary);
65+
color: var(--color-muted-foreground);
6666
}
6767

6868
.breadcrumb a:hover {
69-
color: var(--color-interactive-default);
69+
color: var(--color-primary);
7070
}
7171

7272
h1 {
@@ -75,7 +75,7 @@ import Layout from '../../../components/Layout.astro';
7575

7676
.description {
7777
font-size: 1.125rem;
78-
color: var(--color-text-secondary);
78+
color: var(--color-muted-foreground);
7979
margin-bottom: 2rem;
8080
}
8181

@@ -88,6 +88,6 @@ import Layout from '../../../components/Layout.astro';
8888
.back-link {
8989
margin-top: 3rem;
9090
padding-top: 2rem;
91-
border-top: 1px solid var(--color-border-default);
91+
border-top: 1px solid var(--color-border);
9292
}
9393
</style>

0 commit comments

Comments
 (0)