help.go 3.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. /*
  2. * Copyright (c)2013-2020 ZeroTier, Inc.
  3. *
  4. * Use of this software is governed by the Business Source License included
  5. * in the LICENSE.TXT file in the project's root directory.
  6. *
  7. * Change Date: 2024-01-01
  8. *
  9. * On the date above, in accordance with the Business Source License, use
  10. * of this software will be governed by version 2.0 of the Apache License.
  11. */
  12. /****/
  13. package cli
  14. import (
  15. "fmt"
  16. "zerotier/pkg/zerotier"
  17. )
  18. var copyrightText = fmt.Sprintf(`ZeroTier Network Virtualization Service Version %d.%d.%d
  19. (c)2013-2020 ZeroTier, Inc.
  20. Licensed under the ZeroTier BSL (see LICENSE.txt)`, zerotier.CoreVersionMajor, zerotier.CoreVersionMinor, zerotier.CoreVersionRevision)
  21. // Help dumps help to stdout
  22. func Help() {
  23. fmt.Println(copyrightText)
  24. fmt.Println(`
  25. Usage: zerotier [-options] <command> [command args]
  26. Global Options:
  27. -j Output raw JSON where applicable
  28. -p <path> Use alternate base path
  29. -t <path> Use secret auth token from this file
  30. Commands:
  31. help Show this help
  32. version Print version
  33. selftest Run internal tests
  34. service Start as service
  35. status Show ZeroTier status and config
  36. peers Show VL1 peers and link information
  37. roots Show only root peers
  38. addroot <identity> [IP/port] Add root with optional bootstrap IP
  39. removeroot <address|identity> Remove root
  40. join <network ID> Join a virtual network
  41. leave <network ID> Leave a virtual network
  42. networks List joined VL2 virtual networks
  43. network <network ID> Show verbose network info
  44. set <network ID> [option] [value] Get or set a network config option
  45. manageips <boolean> Is IP management allowed?
  46. manageroutes <boolean> Is route management allowed?
  47. globalips <boolean> Allow assignment of global IPs?
  48. globalroutes <boolean> Can global IP space routes be set?
  49. defaultroute <boolean> Can default route be overridden?
  50. set [option] [value] Get or set a service config option
  51. phy <IP/bits> blacklist <boolean> Set or clear blacklist for CIDR
  52. phy <IP/bits> trust <path ID/0> Set or clear trusted path ID for CIDR
  53. port <port> Set primary port for P2P links
  54. secondaryport <port/0> Set secondary P2P port (0 disables)
  55. portsearch <boolean> Enable/disable port search on startup
  56. portmapping <boolean> Enable/disable use of uPnP/NAT-PMP
  57. identity <command> [args] Identity management commands
  58. new [c25519|p384] Create identity pair (default: c25519)
  59. getpublic <identity> Extract only public part of identity
  60. validate <identity> Locally validate an identity
  61. sign <identity> <file> Sign a file with an identity's key
  62. verify <identity> <file> <sig> Verify a signature
  63. The 'service' command does not exit until the service receives a signal.
  64. This is typically run from launchd (Mac), systemd or init (Linux), etc.
  65. If 'set' is followed by a 16-digit hex number it will get/set network config
  66. options. Otherwise it will get/set service options. Run with no arguments to
  67. see all options.
  68. An identity can be specified as a file or directly. This is auto-detected.
  69. Most commands require a secret token to permit control of a running
  70. service. The CLI will automatically try to read this token from the
  71. authtoken.secret file in the service's working directory and then from a
  72. file called .zerotierauth in the user's home directory. The -t option can
  73. be used to explicitly specify a location.`)
  74. fmt.Println()
  75. }