Render rich server command catalog#5
Conversation
개요PR은 서버 카탈로그에서 Commands 메타데이터를 파싱하고 렌더링하는 기능을 추가합니다. 헬프 출력과 변경 사항Commands 기반 서버 카탈로그 지원
관련 PR
🎯 3 (Moderate) | ⏱️ ~20 분 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning Review ran into problems🔥 ProblemsGit: Failed to clone repository. Please run the Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
internal/craken/command.go (1)
273-290: ⚡ Quick win명령 그룹/항목 정렬을 추가해 출력 순서를 안정화해 주세요.
현재는 서버가 준 순서를 그대로 사용해서 도움말 출력 순서가 비결정적일 수 있습니다. 그룹명/명령문 기준 정렬을 넣으면 사용자 경험과 테스트 안정성이 좋아집니다.
제안 패치
import ( "context" "fmt" "io" + "sort" "strings" ) @@ func groupedCommands(commands []cliCommand) []commandGroup { groups := []commandGroup{} indexes := map[string]int{} for _, command := range commands { @@ groups[index].Commands = append(groups[index].Commands, command) } + sort.Slice(groups, func(i, j int) bool { + return groups[i].Name < groups[j].Name + }) + for i := range groups { + sort.Slice(groups[i].Commands, func(a, b int) bool { + if groups[i].Commands[a].Command == groups[i].Commands[b].Command { + return groups[i].Commands[a].ID < groups[i].Commands[b].ID + } + return groups[i].Commands[a].Command < groups[i].Commands[b].Command + }) + } return groups }🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@internal/craken/command.go` around lines 273 - 290, The groupedCommands function currently preserves input order; make it deterministic by sorting the resulting groups by group Name and sorting each group's Commands slice by a stable command identifier (e.g. cliCommand.Name or whichever field represents the command label). After you build groups in groupedCommands, run a sort.Slice on groups comparing group.Name, and for each group run sort.Slice on group.Commands comparing command.Name (replace with the actual field if different), ensuring consistent output order for commandGroup and cliCommand.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@internal/craken/command.go`:
- Around line 273-290: The groupedCommands function currently preserves input
order; make it deterministic by sorting the resulting groups by group Name and
sorting each group's Commands slice by a stable command identifier (e.g.
cliCommand.Name or whichever field represents the command label). After you
build groups in groupedCommands, run a sort.Slice on groups comparing
group.Name, and for each group run sort.Slice on group.Commands comparing
command.Name (replace with the actual field if different), ensuring consistent
output order for commandGroup and cliCommand.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 8798fd7c-da46-4ab7-8889-d3f907590f7a
📒 Files selected for processing (6)
AGENTS.mdVERSIONdocs/architecture.mdinternal/craken/command.gointernal/craken/command_test.gointernal/craken/generic.go
📜 Review details
🧰 Additional context used
📓 Path-based instructions (1)
**/*.go
📄 CodeRabbit inference engine (AGENTS.md)
Store named bearer profiles in ${CRAKEN_CONFIG_DIR:-~/.config/craken}/config.json, matching the legacy Node CLI profile format
Browser login must use the /api/client/device-authorizations and /api/client/device-token device-code flow for authentication
Discover new server APIs and command help through the server-owned /api/client catalog using craken commands, craken do, craken get, craken post, and related generic commands
Files:
internal/craken/command.gointernal/craken/command_test.gointernal/craken/generic.go
🧠 Learnings (1)
📓 Common learnings
Learnt from: CR
Repo: corca-ai/craken-cli
Timestamp: 2026-05-20T10:30:18.371Z
Learning: Consult docs/build.md for build-related information and procedures
Learnt from: CR
Repo: corca-ai/craken-cli
Timestamp: 2026-05-20T10:30:18.371Z
Learning: Consult docs/testing.md for testing-related information and procedures
Learnt from: CR
Repo: corca-ai/craken-cli
Timestamp: 2026-05-20T10:30:18.371Z
Learning: Consult docs/architecture.md for architecture-related information and procedures
Learnt from: CR
Repo: corca-ai/craken-cli
Timestamp: 2026-05-20T10:30:18.371Z
Learning: craken is a Go CLI that interfaces with the Craken service at https://craken.borca.ai
Learnt from: CR
Repo: corca-ai/craken-cli
Timestamp: 2026-05-20T10:30:18.371Z
Learning: Product commands call the same HTTP and WebSocket APIs used by the browser
🔇 Additional comments (6)
VERSION (1)
1-1: LGTM!AGENTS.md (1)
14-14: LGTM!docs/architecture.md (1)
5-7: LGTM!internal/craken/generic.go (1)
31-45: LGTM!Also applies to: 59-79, 182-191
internal/craken/command.go (1)
211-252: LGTM!Also applies to: 268-271, 292-299
internal/craken/command_test.go (1)
52-59: LGTM!Also applies to: 88-92, 104-105, 115-149
Summary
Tests
Summary by CodeRabbit
릴리스 노트 v0.1.6
새로운 기능
문서