Skip to content

Commit 91bf1bc

Browse files
authored
Merge pull request #200 from synapseq-foundation/docs/ai-help-layout
docs: organize AI help section
2 parents 53836dd + 8a32d37 commit 91bf1bc

1 file changed

Lines changed: 41 additions & 14 deletions

File tree

internal/cli/help.go

Lines changed: 41 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,7 @@ func Help() {
3434
writeInputSection(writer)
3535
writeOutputSection(writer)
3636
writeOptionsSection(writer, "Most common options:", commonHelpOptions())
37-
writeMutedLeadSection(writer, "AI:", "Requires SYNAPSEQ_AI_API_KEY. Model and API host can also be configured with environment variables.")
38-
writeOptionsList(writer, aiHelpOptions())
39-
fmt.Fprintln(writer)
37+
writeAISection(writer)
4038
writeMutedLeadSection(writer, "Remote:", "Run -sync first to initialize the local Remote index.")
4139
writeOptionsList(writer, remoteHelpOptions())
4240
fmt.Fprintln(writer)
@@ -115,11 +113,30 @@ func writeMutedLeadSection(writer io.Writer, title, lead string) {
115113
}
116114

117115
func writeOptionsList(writer io.Writer, options []helpOption) {
116+
writeIndentedOptionsList(writer, " ", options)
117+
}
118+
119+
func writeIndentedOptionsList(writer io.Writer, indent string, options []helpOption) {
118120
for _, option := range options {
119-
fmt.Fprintf(writer, " %s%s\n", FlagColumn(option.FlagText, option.ColumnWidth), option.Description)
121+
fmt.Fprintf(writer, "%s%s%s\n", indent, FlagColumn(option.FlagText, option.ColumnWidth), option.Description)
120122
}
121123
}
122124

125+
func writeAISection(writer io.Writer) {
126+
fmt.Fprintf(writer, "%s\n", Section("AI:"))
127+
fmt.Fprintf(writer, " %s\n\n", Muted("Requires SYNAPSEQ_AI_API_KEY."))
128+
writeAISubsection(writer, "Command:", aiCommandHelpOptions())
129+
writeAISubsection(writer, "Options:", aiConfigurationHelpOptions())
130+
writeAISubsection(writer, "Environment:", aiEnvironmentHelpOptions())
131+
fmt.Fprintf(writer, " %s %s\n\n", Label("Priority:"), Muted("-ai-* option > SYNAPSEQ_AI_* environment variable > CLI default"))
132+
}
133+
134+
func writeAISubsection(writer io.Writer, label string, options []helpOption) {
135+
fmt.Fprintf(writer, " %s\n", Label(label))
136+
writeIndentedOptionsList(writer, " ", options)
137+
fmt.Fprintln(writer)
138+
}
139+
123140
func quickStartExamples() []helpExample {
124141
return []helpExample{
125142
{Label: "1. Render audio", CommandText: "synapseq session.spsq", Description: "Generate session.wav in the current folder"},
@@ -147,18 +164,28 @@ func commonHelpOptions() []helpOption {
147164
}
148165
}
149166

150-
func aiHelpOptions() []helpOption {
167+
func aiCommandHelpOptions() []helpOption {
151168
return []helpOption{
152169
{FlagText: "-ai PROMPT [OUTPUT]", ColumnWidth: 28, Description: "Generate an SPSQ sequence; use - for standard output"},
153-
{FlagText: "-ai-model MODEL", ColumnWidth: 28, Description: "Overrides SYNAPSEQ_AI_MODEL"},
154-
{FlagText: "-ai-base-url URL", ColumnWidth: 28, Description: "Overrides SYNAPSEQ_AI_BASE_URL"},
155-
{FlagText: "-ai-temperature VALUE", ColumnWidth: 28, Description: "Overrides SYNAPSEQ_AI_TEMPERATURE"},
156-
{FlagText: "-ai-timeout DURATION", ColumnWidth: 28, Description: "Overrides SYNAPSEQ_AI_TIMEOUT"},
157-
{FlagText: "SYNAPSEQ_AI_API_KEY", ColumnWidth: 28, Description: "Required API key"},
158-
{FlagText: "SYNAPSEQ_AI_MODEL", ColumnWidth: 28, Description: "Model name; defaults to gpt-4.1-mini"},
159-
{FlagText: "SYNAPSEQ_AI_BASE_URL", ColumnWidth: 28, Description: "OpenAI-compatible API host"},
160-
{FlagText: "SYNAPSEQ_AI_TEMPERATURE", ColumnWidth: 28, Description: "Optional sampling temperature from 0 to 2"},
161-
{FlagText: "SYNAPSEQ_AI_TIMEOUT", ColumnWidth: 28, Description: "Request timeout; defaults to 5m"},
170+
}
171+
}
172+
173+
func aiConfigurationHelpOptions() []helpOption {
174+
return []helpOption{
175+
{FlagText: "-ai-model MODEL", ColumnWidth: 28, Description: "Model name"},
176+
{FlagText: "-ai-base-url URL", ColumnWidth: 28, Description: "OpenAI-compatible API host"},
177+
{FlagText: "-ai-temperature VALUE", ColumnWidth: 28, Description: "Sampling temperature from 0 to 2"},
178+
{FlagText: "-ai-timeout DURATION", ColumnWidth: 28, Description: "Request timeout"},
179+
}
180+
}
181+
182+
func aiEnvironmentHelpOptions() []helpOption {
183+
return []helpOption{
184+
{FlagText: "SYNAPSEQ_AI_API_KEY", ColumnWidth: 30, Description: "Required API key"},
185+
{FlagText: "SYNAPSEQ_AI_MODEL", ColumnWidth: 30, Description: "Model name; default gpt-4.1-mini"},
186+
{FlagText: "SYNAPSEQ_AI_BASE_URL", ColumnWidth: 30, Description: "OpenAI-compatible API host"},
187+
{FlagText: "SYNAPSEQ_AI_TEMPERATURE", ColumnWidth: 30, Description: "Sampling temperature; default 1"},
188+
{FlagText: "SYNAPSEQ_AI_TIMEOUT", ColumnWidth: 30, Description: "Request timeout; default 5m"},
162189
}
163190
}
164191

0 commit comments

Comments
 (0)