help.go 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  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: 2025-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. func Help() {
  19. fmt.Printf(`ZeroTier Network Hypervisor Service Version %d.%d.%d
  20. (c)2013-2020 ZeroTier, Inc.
  21. Licensed under the ZeroTier BSL (see LICENSE.txt)
  22. Usage: zerotier [-global options] <command> [command args]
  23. Global Options:
  24. -j Output raw JSON where applicable
  25. -p <path> Use alternate base path
  26. -t <path> Load secret auth token from a file
  27. -T <token> Set secret auth token on command line
  28. Common Operations:
  29. help Show this help
  30. version Print version
  31. now [duration] Print current time [-]#[ms|s|m|h]
  32. · status Show node status and configuration
  33. · set [option] [value] - Get or set node configuration
  34. port <port> Primary P2P port
  35. secondaryport <port/0> Secondary P2P port (0 to disable)
  36. blacklist cidr <IP/bits> <boolean> Toggle physical path blacklisting
  37. blacklist if <prefix> <boolean> Toggle interface prefix blacklisting
  38. portmap <boolean> Toggle use of uPnP or NAT-PMP
  39. · peer [address] [command] [option] - Peer management commands
  40. list List peers
  41. listroots List root peers
  42. show Show peer details
  43. try <endpoint> [...] Try peer at explicit endpoint
  44. · network list List VL2 networks
  45. · network <network> [command] [option] - Network management commands
  46. show Show network details (default)
  47. set [option] [value] - Get or set network options
  48. manageips <boolean> Is IP management allowed?
  49. manageroutes <boolean> Is route management allowed?
  50. globalips <boolean> Allow assignment of global IPs?
  51. globalroutes <boolean> Can global IP space routes be set?
  52. defaultroute <boolean> Can default route be overridden?
  53. · join [-options] <network> Join a virtual network
  54. -a <token> Token to submit to controller
  55. -c <identity | fingerprint> Controller identity or fingerprint
  56. · leave <network> Leave a virtual network
  57. Advanced Operations:
  58. service Start node (seldom used from CLI)
  59. · controller <command> [option] - Local controller management commands
  60. · list List networks run by local controller
  61. · new Create a new network
  62. · set <network> [setting] [value] Show or modify network settings
  63. · members <network> List members of a network
  64. · member <network> [setting] [value] Show or modify member level settings
  65. · auth <address> Authorize a peer
  66. · deauth <address> Deauthorize a peer
  67. identity <command> [args] - Identity management
  68. new [c25519 | p384] Create identity (default: c25519)
  69. getpublic <identity> Extract only public part of identity
  70. fingerprint <identity> Get an identity's fingerprint
  71. validate <identity> Locally validate an identity
  72. sign <identity> <file> Sign a file with an identity's key
  73. verify <identity> <file> <sig> Verify a signature
  74. locator <command> [args] - Locator management
  75. new <identity> <endpoint> [...] Create new signed locator
  76. verify <identity> <locator> Verify locator signature
  77. show <locator> Show contents of a locator
  78. cert <command> [args] - Certificate management
  79. · list List certificates in local node store
  80. · show <serial> List or show details of a certificate
  81. newsid <secret out> Create a new subject unique ID
  82. newcsr <subject> <secret> <csr out> Create a subject CSR
  83. sign <csr> <identity> <cert out> Sign a CSR to create a certificate
  84. verify <cert> Verify certificate (not entire chain)
  85. dump <cert> Verify and print certificate
  86. · import <cert> [trust,[trust]] Import certificate into this node
  87. trust flag: rootca Certificate is a root CA
  88. trust flag: ztrootset ZeroTier root node set
  89. · restore Re-import default certificates
  90. · export <serial> [path] Export a certificate from this node
  91. · delete <serial|ALL> Delete certificate from this node
  92. · Command requires a running node and access to a local API token.
  93. An <address> may be specified as a 10-digit short ZeroTier address, a
  94. fingerprint containing both an address and a SHA384 hash, or an identity.
  95. The latter two options are equivalent in terms of specificity and may be
  96. used if stronger security guarantees are desired than those provided by
  97. the basic ZeroTier addressing system. Fields of type <identity> must be
  98. full identities and may be specified either verbatim or as a path to a file.
  99. An <endpoint> is a place where a peer may be reached. Currently these are
  100. just 'IP/port' format addresses but other types may be added in the future.
  101. The 'service' command starts a node. It will run until the node receives
  102. an exit signal and is normally not used directly.
  103. `,zerotier.CoreVersionMajor, zerotier.CoreVersionMinor, zerotier.CoreVersionRevision)
  104. }