Files
sproutclaw-web/backend/internal/handlers/commands.go
2026-06-13 20:16:09 +08:00

19 lines
465 B
Go

package handlers
import (
"net/http"
"github.com/gin-gonic/gin"
"sproutclaw-web/internal/config"
"sproutclaw-web/internal/models"
"sproutclaw-web/internal/services"
)
// RegisterCommands registers the slash commands list route.
func RegisterCommands(r *gin.RouterGroup, cfg *config.Config) {
r.GET("/commands", func(c *gin.Context) {
cmds := services.ListSlashCommands(cfg.AgentDir)
c.JSON(http.StatusOK, models.CommandsResponse{Commands: cmds})
})
}