cmd-list.js 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  1. // short names for common things
  2. const shorthands = {
  3. un: 'uninstall',
  4. rb: 'rebuild',
  5. list: 'ls',
  6. ln: 'link',
  7. create: 'init',
  8. i: 'install',
  9. it: 'install-test',
  10. cit: 'install-ci-test',
  11. up: 'update',
  12. c: 'config',
  13. s: 'search',
  14. se: 'search',
  15. tst: 'test',
  16. t: 'test',
  17. ddp: 'dedupe',
  18. v: 'view',
  19. run: 'run-script',
  20. 'clean-install': 'ci',
  21. 'clean-install-test': 'cit',
  22. x: 'exec',
  23. why: 'explain',
  24. }
  25. const affordances = {
  26. la: 'll',
  27. verison: 'version',
  28. ic: 'ci',
  29. innit: 'init',
  30. // manually abbrev so that install-test doesn't make insta stop working
  31. in: 'install',
  32. ins: 'install',
  33. inst: 'install',
  34. insta: 'install',
  35. instal: 'install',
  36. isnt: 'install',
  37. isnta: 'install',
  38. isntal: 'install',
  39. 'install-clean': 'ci',
  40. 'isntall-clean': 'ci',
  41. hlep: 'help',
  42. 'dist-tags': 'dist-tag',
  43. upgrade: 'update',
  44. udpate: 'update',
  45. login: 'adduser',
  46. 'add-user': 'adduser',
  47. author: 'owner',
  48. home: 'docs',
  49. issues: 'bugs',
  50. info: 'view',
  51. show: 'view',
  52. find: 'search',
  53. add: 'install',
  54. unlink: 'uninstall',
  55. remove: 'uninstall',
  56. rm: 'uninstall',
  57. r: 'uninstall',
  58. rum: 'run-script',
  59. sit: 'cit',
  60. urn: 'run-script',
  61. ogr: 'org',
  62. }
  63. // these are filenames in .
  64. const cmdList = [
  65. 'ci',
  66. 'install-ci-test',
  67. 'install',
  68. 'install-test',
  69. 'uninstall',
  70. 'cache',
  71. 'config',
  72. 'set',
  73. 'get',
  74. 'update',
  75. 'outdated',
  76. 'prune',
  77. 'pack',
  78. 'find-dupes',
  79. 'dedupe',
  80. 'hook',
  81. 'rebuild',
  82. 'link',
  83. 'publish',
  84. 'star',
  85. 'stars',
  86. 'unstar',
  87. 'adduser',
  88. 'login', // This is an alias for `adduser` but it can be confusing
  89. 'logout',
  90. 'unpublish',
  91. 'owner',
  92. 'access',
  93. 'team',
  94. 'deprecate',
  95. 'shrinkwrap',
  96. 'token',
  97. 'profile',
  98. 'audit',
  99. 'fund',
  100. 'org',
  101. 'help',
  102. 'ls',
  103. 'll',
  104. 'search',
  105. 'view',
  106. 'init',
  107. 'version',
  108. 'edit',
  109. 'explore',
  110. 'docs',
  111. 'repo',
  112. 'bugs',
  113. 'root',
  114. 'prefix',
  115. 'bin',
  116. 'whoami',
  117. 'diff',
  118. 'dist-tag',
  119. 'ping',
  120. 'pkg',
  121. 'test',
  122. 'stop',
  123. 'start',
  124. 'restart',
  125. 'run-script',
  126. 'set-script',
  127. 'completion',
  128. 'doctor',
  129. 'exec',
  130. 'explain',
  131. ]
  132. const plumbing = ['birthday', 'help-search']
  133. // these commands just shell out to something else or handle the
  134. // error themselves, so it's confusing and weird to write out
  135. // our full error log banner when they exit non-zero
  136. const shellouts = [
  137. 'exec',
  138. 'run-script',
  139. 'test',
  140. 'start',
  141. 'stop',
  142. 'restart',
  143. 'birthday',
  144. ]
  145. module.exports = {
  146. aliases: Object.assign({}, shorthands, affordances),
  147. shorthands,
  148. affordances,
  149. cmdList,
  150. plumbing,
  151. shellouts,
  152. }