MCPcopy Create free account
hub / github.com/SamNet-dev/snix / newRootCmd

Function newRootCmd

cmd/snix/root.go:18–42  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

16}
17
18func newRootCmd() *cobra.Command {
19 g := &globalFlags{}
20
21 root := &cobra.Command{
22 Use: "snix",
23 Short: "Cross-platform SNI-spoofing DPI-bypass proxy",
24 Long: "snix spoofs the TLS ClientHello SNI during the TCP handshake to bypass DPI-based censorship.\nIt is a Go rewrite of patterniha/SNI-Spoofing with multi-profile, TUI, and cross-platform support.",
25 Version: version,
26 SilenceUsage: true,
27 SilenceErrors: true,
28 }
29 root.PersistentFlags().StringVarP(&g.configPath, "config", "c", defaultConfigPath(), "config file path")
30 root.PersistentFlags().BoolVarP(&g.verbose, "verbose", "v", false, "verbose logging")
31
32 root.AddCommand(
33 newStartCmd(g),
34 newStatusCmd(g),
35 newProfileCmd(g),
36 newScanRootCmd(g),
37 newInitCmd(g),
38 newTUICmd(g),
39 newUpdateCmd(g),
40 )
41 return root
42}
43
44func defaultConfigPath() string {
45 // Follows XDG on Linux/macOS, %APPDATA% on Windows.

Callers 1

mainFunction · 0.85

Calls 8

defaultConfigPathFunction · 0.85
newStartCmdFunction · 0.85
newStatusCmdFunction · 0.85
newProfileCmdFunction · 0.85
newScanRootCmdFunction · 0.85
newInitCmdFunction · 0.85
newTUICmdFunction · 0.85
newUpdateCmdFunction · 0.85

Tested by

no test coverage detected