npm-access.1 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. .TH "NPM\-ACCESS" "1" "October 2021" "" ""
  2. .SH "NAME"
  3. \fBnpm-access\fR \- Set access level on published packages
  4. .SS Synopsis
  5. .P
  6. .RS 2
  7. .nf
  8. npm access public [<package>]
  9. npm access restricted [<package>]
  10. npm access grant <read\-only|read\-write> <scope:team> [<package>]
  11. npm access revoke <scope:team> [<package>]
  12. npm access 2fa\-required [<package>]
  13. npm access 2fa\-not\-required [<package>]
  14. npm access ls\-packages [<user>|<scope>|<scope:team>]
  15. npm access ls\-collaborators [<package> [<user>]]
  16. npm access edit [<package>]
  17. .fi
  18. .RE
  19. .SS Description
  20. .P
  21. Used to set access controls on private packages\.
  22. .P
  23. For all of the subcommands, \fBnpm access\fP will perform actions on the packages
  24. in the current working directory if no package name is passed to the
  25. subcommand\.
  26. .RS 0
  27. .IP \(bu 2
  28. public / restricted:
  29. Set a package to be either publicly accessible or restricted\.
  30. .IP \(bu 2
  31. grant / revoke:
  32. Add or remove the ability of users and teams to have read\-only or read\-write
  33. access to a package\.
  34. .IP \(bu 2
  35. 2fa\-required / 2fa\-not\-required:
  36. Configure whether a package requires that anyone publishing it have two\-factor
  37. authentication enabled on their account\.
  38. .IP \(bu 2
  39. ls\-packages:
  40. Show all of the packages a user or a team is able to access, along with the
  41. access level, except for read\-only public packages (it won't print the whole
  42. registry listing)
  43. .IP \(bu 2
  44. ls\-collaborators:
  45. Show all of the access privileges for a package\. Will only show permissions
  46. for packages to which you have at least read access\. If \fB<user>\fP is passed in,
  47. the list is filtered only to teams \fIthat\fR user happens to belong to\.
  48. .IP \(bu 2
  49. edit:
  50. Set the access privileges for a package at once using \fB$EDITOR\fP\|\.
  51. .RE
  52. .SS Details
  53. .P
  54. \fBnpm access\fP always operates directly on the current registry, configurable
  55. from the command line using \fB\-\-registry=<registry url>\fP\|\.
  56. .P
  57. Unscoped packages are \fIalways public\fR\|\.
  58. .P
  59. Scoped packages \fIdefault to restricted\fR, but you can either publish them as
  60. public using \fBnpm publish \-\-access=public\fP, or set their access as public using
  61. \fBnpm access public\fP after the initial publish\.
  62. .P
  63. You must have privileges to set the access of a package:
  64. .RS 0
  65. .IP \(bu 2
  66. You are an owner of an unscoped or scoped package\.
  67. .IP \(bu 2
  68. You are a member of the team that owns a scope\.
  69. .IP \(bu 2
  70. You have been given read\-write privileges for a package, either as a member
  71. of a team or directly as an owner\.
  72. .RE
  73. .P
  74. If you have two\-factor authentication enabled then you'll be prompted to
  75. provide an otp token, or may use the \fB\-\-otp=\.\.\.\fP option to specify it on
  76. the command line\.
  77. .P
  78. If your account is not paid, then attempts to publish scoped packages will
  79. fail with an HTTP 402 status code (logically enough), unless you use
  80. \fB\-\-access=public\fP\|\.
  81. .P
  82. Management of teams and team memberships is done with the \fBnpm team\fP command\.
  83. .SS Configuration
  84. <!\-\- AUTOGENERATED CONFIG DESCRIPTIONS START \-\->
  85. <!\-\- automatically generated, do not edit manually \-\->
  86. <!\-\- see lib/utils/config/definitions\.js \-\->
  87. .SS \fBregistry\fP
  88. .RS 0
  89. .IP \(bu 2
  90. Default: "https://registry\.npmjs\.org/"
  91. .IP \(bu 2
  92. Type: URL
  93. .RE
  94. .P
  95. The base URL of the npm registry\.
  96. <!\-\- automatically generated, do not edit manually \-\->
  97. <!\-\- see lib/utils/config/definitions\.js \-\->
  98. .SS \fBotp\fP
  99. .RS 0
  100. .IP \(bu 2
  101. Default: null
  102. .IP \(bu 2
  103. Type: null or String
  104. .RE
  105. .P
  106. This is a one\-time password from a two\-factor authenticator\. It's needed
  107. when publishing or changing package permissions with \fBnpm access\fP\|\.
  108. .P
  109. If not set, and a registry response fails with a challenge for a one\-time
  110. password, npm will prompt on the command line for one\.
  111. <!\-\- automatically generated, do not edit manually \-\->
  112. <!\-\- see lib/utils/config/definitions\.js \-\->
  113. <!\-\- AUTOGENERATED CONFIG DESCRIPTIONS END \-\->
  114. .SS See Also
  115. .RS 0
  116. .IP \(bu 2
  117. \fBlibnpmaccess\fP \fIhttps://npm\.im/libnpmaccess\fR
  118. .IP \(bu 2
  119. npm help team
  120. .IP \(bu 2
  121. npm help publish
  122. .IP \(bu 2
  123. npm help config
  124. .IP \(bu 2
  125. npm help registry
  126. .RE