mirror of
https://gitea.com/gitea/gitea-mcp.git
synced 2025-08-23 22:33:05 +00:00
- Add command to install `air` for hot reloading in `Makefile` - Add `dev` command to run the application with hot reload in `Makefile` - Add `vendor` command to tidy and verify module dependencies in `Makefile` - Update log synchronization method to use `log.Default().Sync()` in `cmd/cmd.go` - Change variadic parameter type from `interface{}` to `any` in logging functions - Remove `Sync` function from `pkg/log/log.go` ref: https://github.com/uber-go/zap/issues/880 Signed-off-by: appleboy <appleboy.tw@gmail.com>
63 lines
887 B
Go
63 lines
887 B
Go
package cmd
|
|
|
|
import (
|
|
"flag"
|
|
|
|
"gitea.com/gitea/gitea-mcp/operation"
|
|
flagPkg "gitea.com/gitea/gitea-mcp/pkg/flag"
|
|
"gitea.com/gitea/gitea-mcp/pkg/log"
|
|
)
|
|
|
|
var (
|
|
transport string
|
|
host string
|
|
token string
|
|
|
|
debug bool
|
|
)
|
|
|
|
func init() {
|
|
flag.StringVar(
|
|
&transport,
|
|
"t",
|
|
"stdio",
|
|
"Transport type (stdio or sse)",
|
|
)
|
|
flag.StringVar(
|
|
&transport,
|
|
"transport",
|
|
"stdio",
|
|
"Transport type (stdio or sse)",
|
|
)
|
|
flag.StringVar(
|
|
&host,
|
|
"host",
|
|
"https://gitea.com",
|
|
"Gitea host",
|
|
)
|
|
flag.StringVar(
|
|
&token,
|
|
"token",
|
|
"",
|
|
"Your personal access token",
|
|
)
|
|
flag.BoolVar(
|
|
&debug,
|
|
"debug",
|
|
false,
|
|
"debug mode",
|
|
)
|
|
|
|
flag.Parse()
|
|
|
|
flagPkg.Host = host
|
|
flagPkg.Token = token
|
|
}
|
|
|
|
func Execute(version string) {
|
|
defer log.Default().Sync()
|
|
if err := operation.Run(transport, version); err != nil {
|
|
log.Fatalf("Run Gitea MCP Server Error: %v", err)
|
|
}
|
|
}
|