Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit61b5868

Browse files
committed
made more user friendly
1 parent290de37 commit61b5868

File tree

1 file changed

+19
-25
lines changed

1 file changed

+19
-25
lines changed

‎cmd/github-mcp-server/configure.go‎

Lines changed: 19 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -68,38 +68,32 @@ var (
6868
dimStyle=lipgloss.NewStyle().
6969
Foreground(lipgloss.Color("#666666"))
7070

71+
toolsetBadgeStyle=lipgloss.NewStyle().
72+
Foreground(lipgloss.Color("#84a5ecff"))
73+
7174
successStyle=lipgloss.NewStyle().
7275
Foreground(lipgloss.Color("#00FF00")).
7376
Bold(true)
7477

75-
errorStyle=lipgloss.NewStyle().
76-
Foreground(lipgloss.Color("#FF0000")).
77-
Bold(true)
7878

7979
asciiArtStyle=lipgloss.NewStyle().
8080
Foreground(lipgloss.Color("#7D56F4")).
8181
Bold(true)
8282

83-
welcomeTextStyle=lipgloss.NewStyle().
84-
Foreground(lipgloss.Color("#FFFFFF")).
85-
MarginTop(1).
86-
MarginBottom(1)
8783

8884
accentStyle=lipgloss.NewStyle().
8985
Foreground(lipgloss.Color("#00D7FF")).
9086
Bold(true)
9187
)
9288

9389
constasciiArt=`
94-
_____ _ _ _ _ _ __ __ _____ _____
95-
/ ____(_) | | | | | | | | \/ |/ ____| __ \
96-
| | __ _| |_| |__| |_ _| |__ | \ / | | | |__) |
97-
| | |_ | | __| __ | | | | '_ \ | |\/| | | | ___/
98-
| |__| | | |_| | | | |_| | |_) | | | | | |____| |
99-
\_____|_|\__|_| |_|\__,_|_.__/ |_| |_|\_____|_|
100-
101-
🔧 Configuration Tool ⚙️
102-
`
90+
_____ _ _ _ _ _ __ __ _____ _____ _____
91+
/ ____(_) | | | | | | | | \/ |/ ____| __ \ / ____|
92+
| | __ _| |_| |__| |_ _| |__ | \ / | | | |__) || (___ ___ _ ____ _____ _ __
93+
| | |_ | | __| __ | | | | '_ \ | |\/| | | | ___/ \___ \ / _ \ '__\ \ / / _ \ '__|
94+
| |__| | | |_| | | | |_| | |_) | | | | |____| | ____) | __/ | \ V / __/ |
95+
\_____|_|\__|_| |_|\__,_|_.__/ |_| |_|\_____|_| |_____/ \___|_| \_/ \___|_|
96+
`
10397

10498
typetoolInfostruct {
10599
namestring
@@ -137,6 +131,11 @@ func initialConfigureModel(toolsets []toolsetInfo) configureModel {
137131
allTools=append(allTools,ts.tools...)
138132
}
139133

134+
// Sort all tools alphabetically by name
135+
sort.Slice(allTools,func(i,jint)bool {
136+
returnallTools[i].name<allTools[j].name
137+
})
138+
140139
returnconfigureModel{
141140
toolsets:toolsets,
142141
allTools:allTools,
@@ -390,7 +389,7 @@ func (m configureModel) View() string {
390389
)
391390

392391
// Add category badge
393-
category:=dimStyle.Render(fmt.Sprintf("[%s]",tool.toolsetName))
392+
category:=toolsetBadgeStyle.Render(fmt.Sprintf("[%s]",tool.toolsetName))
394393
line+=category
395394

396395
// Add description (truncated if needed)
@@ -584,22 +583,17 @@ func (m configureModel) renderConfirmation() string {
584583
s.WriteString("\n\n")
585584

586585
// Print JSON format
587-
s.WriteString(dimStyle.Render(`"args": [`))
586+
s.WriteString(itemStyle.Render(`"args": [`))
588587
s.WriteString("\n")
589588
fori,arg:=rangecmdArgs {
590589
comma:=","
591590
ifi==len(cmdArgs)-1 {
592591
comma=""
593592
}
594-
s.WriteString(dimStyle.Render(fmt.Sprintf(` "%s"%s`,arg,comma)))
593+
s.WriteString(itemStyle.Render(fmt.Sprintf(` "%s"%s`,arg,comma)))
595594
s.WriteString("\n")
596595
}
597-
s.WriteString(dimStyle.Render(`],`))
598-
s.WriteString("\n\n")
599-
600-
s.WriteString(titleStyle.Render("Or run directly with:"))
601-
s.WriteString("\n")
602-
s.WriteString(successStyle.Render(fmt.Sprintf("go %s",strings.Join(cmdArgs," "))))
596+
s.WriteString(itemStyle.Render(`],`))
603597
s.WriteString("\n\n")
604598

605599
returns.String()

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp