-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathmain.go
More file actions
35 lines (30 loc) · 1.05 KB
/
Copy pathmain.go
File metadata and controls
35 lines (30 loc) · 1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
// Package main provides the entry point for the MCPShell application.
//
// The application implements the Model Context Protocol (MCP) for executing
// command-line tools in a secure and configurable manner, allowing AI-powered
// applications to execute commands on behalf of users.
package main
import (
cmdroot "github.com/inercia/MCPShell/cmd"
"github.com/inercia/MCPShell/pkg/common"
)
// Build information. These variables are set via ldflags during build.
var (
version = "dev"
commit = "none"
date = "unknown"
)
// main is the entry point of the application. It sets up the panic recovery system
// at the top level and executes the root command, which will process CLI flags and
// execute the selected subcommand.
func main() {
// Setup global panic recovery that will catch any unhandled panics
// and prevent the application from crashing uncleanly
defer func() {
common.RecoverPanic()
}()
// Set version information from build-time variables
cmdroot.SetVersion(version, commit, date)
// Execute the root command
cmdroot.Execute()
}