Skip to content

Commit bca57a6

Browse files
dkijaniaclaude
andcommitted
Fix CLI reference generation script redirect bugs and add frontmatter
- Fix shell operator precedence in 3 places where `cmd 2>&1 || true >> file` was parsed as `(cmd) || (true >> file)`, causing empty code blocks - Add MDX frontmatter and intro text to match committed docs format - Add missing `daemon` group to GROUPS array Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 2c074cf commit bca57a6

1 file changed

Lines changed: 24 additions & 5 deletions

File tree

‎scripts/generate-cli-reference.sh‎

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,28 @@ append_help() {
4646
# Generate the top-level command reference
4747
TOP_LEVEL_FILE="$OUTPUT_DIR/mina-cli-reference.md"
4848
cat > "$TOP_LEVEL_FILE" <<'HEADER'
49+
---
50+
title: Mina CLI Reference
51+
hide_title: true
52+
description: Reference for the Mina CLI (command line interface) which is the primary way to interact with the Mina network.
53+
keywords:
54+
- Mina CLI
55+
- create account
56+
- send transaction
57+
- reference
58+
---
59+
4960
# Mina CLI Reference
5061
51-
This document provides a reference for all Mina CLI commands. It is
52-
auto-generated from the `mina` binary using `scripts/generate-cli-reference.sh`.
62+
The Mina CLI (Command Line Interface) is the primary way for users to interact with the Mina network. It provides standard client functionality to create accounts, send transactions, and participate in consensus. There are also advanced client and daemon commands for power users.
63+
64+
The Mina CLI is installed when you [install Mina](/node-operators/block-producer-node/getting-started#installation).
65+
66+
:::tip
67+
68+
Mina APIs are always improving. See `mina help` for the most up-to-date version.
69+
70+
:::
5371
5472
HEADER
5573

@@ -58,14 +76,15 @@ echo "Generating CLI reference documentation..."
5876
# Top-level help
5977
echo "## mina" >> "$TOP_LEVEL_FILE"
6078
echo '```' >> "$TOP_LEVEL_FILE"
61-
"$MINA_BIN" --help 2>&1 || true >> "$TOP_LEVEL_FILE"
79+
("$MINA_BIN" --help 2>&1 || true) >> "$TOP_LEVEL_FILE"
6280
echo '```' >> "$TOP_LEVEL_FILE"
6381
echo "" >> "$TOP_LEVEL_FILE"
6482

6583
# Define the main command groups to document
6684
declare -a GROUPS=(
6785
"accounts"
6886
"client"
87+
"daemon"
6988
"advanced"
7089
"ledger"
7190
"libp2p"
@@ -74,7 +93,7 @@ declare -a GROUPS=(
7493
for group in "${GROUPS[@]}"; do
7594
echo "## mina $group" >> "$TOP_LEVEL_FILE"
7695
echo '```' >> "$TOP_LEVEL_FILE"
77-
"$MINA_BIN" "$group" --help 2>&1 || true >> "$TOP_LEVEL_FILE"
96+
("$MINA_BIN" "$group" --help 2>&1 || true) >> "$TOP_LEVEL_FILE"
7897
echo '```' >> "$TOP_LEVEL_FILE"
7998
echo "" >> "$TOP_LEVEL_FILE"
8099

@@ -99,7 +118,7 @@ for group in "${GROUPS[@]}"; do
99118
if [[ -n "$subcmd" ]]; then
100119
echo "### mina $group $subcmd" >> "$TOP_LEVEL_FILE"
101120
echo '```' >> "$TOP_LEVEL_FILE"
102-
"$MINA_BIN" "$group" "$subcmd" --help 2>&1 || true >> "$TOP_LEVEL_FILE"
121+
("$MINA_BIN" "$group" "$subcmd" --help 2>&1 || true) >> "$TOP_LEVEL_FILE"
103122
echo '```' >> "$TOP_LEVEL_FILE"
104123
echo "" >> "$TOP_LEVEL_FILE"
105124
fi

0 commit comments

Comments
 (0)