1// Package main is the entry point for the Crush CLI.
2//
3// @title Crush API
4// @version 1.0
5// @description Crush is a terminal-based AI coding assistant. This API is served over a Unix socket (or Windows named pipe) and provides programmatic access to workspaces, sessions, agents, LSP, MCP, and more.
6// @contact.name Charm
7// @contact.url https://charm.sh
8// @license.name MIT
9// @license.url https://git.secluded.site/crush/blob/main/LICENSE
10// @BasePath /v1
11package main
12
13import (
14 "log/slog"
15 "net/http"
16 _ "net/http/pprof"
17 "os"
18
19 "git.secluded.site/crush/internal/cmd"
20 _ "git.secluded.site/crush/internal/dns"
21 _ "github.com/joho/godotenv/autoload"
22)
23
24func main() {
25 if os.Getenv("CRUSH_PROFILE") != "" {
26 go func() {
27 slog.Info("Serving pprof at localhost:6060")
28 if httpErr := http.ListenAndServe("localhost:6060", nil); httpErr != nil {
29 slog.Error("Failed to pprof listen", "error", httpErr)
30 }
31 }()
32 }
33
34 cmd.Execute()
35}