19 lines
465 B
Go
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})
|
|
})
|
|
}
|