oclif 2.0.0 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.oclif.manifest.json +1 -1
- package/CHANGELOG.md +100 -11
- package/README.md +228 -101
- package/bin/dev +19 -0
- package/bin/dev.cmd +3 -0
- package/bin/run +5 -2
- package/lib/aws.d.ts +5 -5
- package/lib/aws.js +7 -5
- package/lib/command-base.d.ts +2 -2
- package/lib/command-base.js +3 -3
- package/lib/commands/generate.d.ts +11 -0
- package/lib/commands/generate.js +19 -0
- package/lib/commands/manifest.d.ts +1 -2
- package/lib/commands/manifest.js +4 -7
- package/lib/commands/pack/deb.d.ts +3 -3
- package/lib/commands/pack/deb.js +11 -12
- package/lib/commands/pack/macos.d.ts +4 -3
- package/lib/commands/pack/macos.js +19 -13
- package/lib/commands/pack/tarballs.d.ts +6 -3
- package/lib/commands/pack/tarballs.js +9 -7
- package/lib/commands/pack/win.d.ts +4 -3
- package/lib/commands/pack/win.js +29 -16
- package/lib/commands/promote.d.ts +14 -3
- package/lib/commands/promote.js +27 -28
- package/lib/commands/readme.d.ts +13 -11
- package/lib/commands/readme.js +33 -34
- package/lib/commands/upload/deb.d.ts +2 -3
- package/lib/commands/upload/deb.js +8 -9
- package/lib/commands/upload/macos.d.ts +2 -3
- package/lib/commands/upload/macos.js +8 -9
- package/lib/commands/upload/tarballs.d.ts +7 -3
- package/lib/commands/upload/tarballs.js +23 -20
- package/lib/commands/upload/win.d.ts +2 -3
- package/lib/commands/upload/win.js +10 -11
- package/lib/generators/{app.d.ts → cli.d.ts} +2 -22
- package/lib/generators/cli.js +182 -0
- package/lib/help-compatibility.d.ts +4 -5
- package/lib/help-compatibility.js +1 -0
- package/lib/index.d.ts +1 -1
- package/lib/index.js +3 -2
- package/lib/log.js +3 -2
- package/lib/tarballs/bin.d.ts +2 -2
- package/lib/tarballs/bin.js +2 -1
- package/lib/tarballs/build.js +29 -28
- package/lib/tarballs/config.d.ts +6 -7
- package/lib/tarballs/config.js +24 -12
- package/lib/tarballs/index.js +4 -4
- package/lib/tarballs/node.d.ts +7 -4
- package/lib/tarballs/node.js +5 -5
- package/lib/upload-util.d.ts +3 -3
- package/lib/upload-util.js +5 -2
- package/lib/util.js +24 -20
- package/lib/version-indexes.d.ts +2 -4
- package/lib/version-indexes.js +3 -1
- package/package.json +27 -27
- package/lib/app-command.d.ts +0 -12
- package/lib/app-command.js +0 -26
- package/lib/commands/base.d.ts +0 -5
- package/lib/commands/base.js +0 -11
- package/lib/commands/command.d.ts +0 -17
- package/lib/commands/command.js +0 -23
- package/lib/commands/hook.d.ts +0 -18
- package/lib/commands/hook.js +0 -25
- package/lib/commands/multi.d.ts +0 -5
- package/lib/commands/multi.js +0 -11
- package/lib/commands/plugin.d.ts +0 -5
- package/lib/commands/plugin.js +0 -11
- package/lib/commands/single.d.ts +0 -5
- package/lib/commands/single.js +0 -11
- package/lib/generators/app.js +0 -459
- package/lib/generators/command.d.ts +0 -15
- package/lib/generators/command.js +0 -51
- package/lib/generators/hook.d.ts +0 -14
- package/lib/generators/hook.js +0 -51
- package/templates/LICENSE.mit +0 -21
- package/templates/README.md.ejs +0 -21
- package/templates/appveyor.yml.ejs +0 -33
- package/templates/base/src/index.js +0 -1
- package/templates/base/src/index.ts +0 -1
- package/templates/base/test/index.test.js +0 -8
- package/templates/base/test/index.test.ts +0 -9
- package/templates/bin/run +0 -5
- package/templates/bin/run.cmd +0 -3
- package/templates/circle.yml.ejs +0 -65
- package/templates/editorconfig +0 -11
- package/templates/eslintrc +0 -7
- package/templates/eslintrc.typescript +0 -10
- package/templates/multi/src/index.js +0 -1
- package/templates/multi/src/index.ts +0 -1
- package/templates/plugin/bin/run +0 -4
- package/templates/plugin/src/index.ts +0 -1
- package/templates/scripts/setup_git +0 -12
- package/templates/single/bin/run.js +0 -4
- package/templates/single/bin/run.ts +0 -13
- package/templates/src/command.js.ejs +0 -27
- package/templates/src/command.ts.ejs +0 -46
- package/templates/src/hook.js.ejs +0 -3
- package/templates/src/hook.ts.ejs +0 -7
- package/templates/test/command.test.js.ejs +0 -28
- package/templates/test/command.test.ts.ejs +0 -29
- package/templates/test/hook.test.js.ejs +0 -9
- package/templates/test/hook.test.ts.ejs +0 -9
- package/templates/test/mocha.opts +0 -4
- package/templates/test/tsconfig.json +0 -9
- package/templates/travis.yml.ejs +0 -14
- package/templates/tsconfig.json +0 -15
package/.oclif.manifest.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":"2.0.
|
|
1
|
+
{"version":"2.0.1","commands":{"generate":{"id":"generate","description":"generate a new CLI\nThis will clone the template repo 'oclif/hello-world' and update package properties","strict":true,"pluginName":"oclif","pluginAlias":"oclif","pluginType":"core","aliases":[],"flags":{},"args":[{"name":"name","description":"directory name of new project","required":true}]},"manifest":{"id":"manifest","description":"generates plugin manifest json","strict":true,"pluginName":"oclif","pluginAlias":"oclif","pluginType":"core","aliases":[],"flags":{},"args":[{"name":"path","description":"path to plugin","default":"."}]},"promote":{"id":"promote","description":"promote CLI builds to a S3 release channel","strict":true,"pluginName":"oclif","pluginAlias":"oclif","pluginType":"core","aliases":[],"flags":{"root":{"name":"root","type":"option","char":"r","description":"path to the oclif CLI project root","required":true,"multiple":false,"default":"."},"version":{"name":"version","type":"option","description":"semantic version of the CLI to promote","required":true,"multiple":false},"sha":{"name":"sha","type":"option","description":"7-digit short git commit SHA of the CLI to promote","required":true,"multiple":false},"channel":{"name":"channel","type":"option","description":"which channel to promote to","required":true,"multiple":false,"default":"stable"},"targets":{"name":"targets","type":"option","char":"t","description":"comma-separated targets to promote (e.g.: linux-arm,win32-x64)","multiple":false,"default":"linux-x64,linux-arm,win32-x64,win32-x86,darwin-x64,darwin-arm64"},"deb":{"name":"deb","type":"boolean","char":"d","description":"promote debian artifacts","allowNo":false},"macos":{"name":"macos","type":"boolean","char":"m","description":"promote macOS pkg","allowNo":false},"win":{"name":"win","type":"boolean","char":"w","description":"promote Windows exe","allowNo":false},"max-age":{"name":"max-age","type":"option","char":"a","description":"cache control max-age in seconds","multiple":false,"default":"86400"},"xz":{"name":"xz","type":"boolean","description":"also upload xz","allowNo":true},"indexes":{"name":"indexes","type":"boolean","description":"append the promoted urls into the index files","allowNo":false}},"args":[]},"readme":{"id":"readme","description":"adds commands to README.md in current directory\nThe readme must have any of the following tags inside of it for it to be replaced or else it will do nothing:\n# Usage\n<!-- usage -->\n# Commands\n<!-- commands -->\n\nCustomize the code URL prefix by setting oclif.repositoryPrefix in package.json.\n","strict":true,"pluginName":"oclif","pluginAlias":"oclif","pluginType":"core","aliases":[],"flags":{"dir":{"name":"dir","type":"option","description":"output directory for multi docs","required":true,"multiple":false,"default":"docs"},"multi":{"name":"multi","type":"boolean","description":"create a different markdown page for each topic","allowNo":false}},"args":[]},"pack:deb":{"id":"pack:deb","description":"pack CLI into debian package","strict":true,"pluginName":"oclif","pluginAlias":"oclif","pluginType":"core","aliases":[],"flags":{"root":{"name":"root","type":"option","char":"r","description":"path to oclif CLI root","required":true,"multiple":false,"default":"."}},"args":[]},"pack:macos":{"id":"pack:macos","description":"pack CLI into macOS .pkg","strict":true,"pluginName":"oclif","pluginAlias":"oclif","pluginType":"core","aliases":[],"flags":{"root":{"name":"root","type":"option","char":"r","description":"path to oclif CLI root","required":true,"multiple":false,"default":"."},"additional-cli":{"name":"additional-cli","type":"option","description":"an Oclif CLI other than the one listed in config.bin that should be made available to the user\nthe CLI should already exist in a directory named after the CLI that is the root of the tarball produced by \"oclif pack:tarballs\"","hidden":true,"multiple":false}},"args":[]},"pack:tarballs":{"id":"pack:tarballs","description":"packages oclif CLI into tarballs\n\nThis can be used to create oclif CLIs that use the system node or that come preloaded with a node binary.\n","strict":true,"pluginName":"oclif","pluginAlias":"oclif","pluginType":"core","aliases":[],"flags":{"root":{"name":"root","type":"option","char":"r","description":"path to oclif CLI root","required":true,"multiple":false,"default":"."},"targets":{"name":"targets","type":"option","char":"t","description":"comma-separated targets to pack (e.g.: linux-arm,win32-x64)","multiple":false,"default":"linux-x64,linux-arm,win32-x64,win32-x86,darwin-x64,darwin-arm64"},"xz":{"name":"xz","type":"boolean","description":"also build xz","allowNo":true}},"args":[]},"pack:win":{"id":"pack:win","description":"create windows installer from oclif CLI\n\n This command requires WINDOWS_SIGNING (prefixed with the name of your executable, e.g. OCLIF_WINDOWS_SIGNING_PASS) to be set in the environment","strict":true,"pluginName":"oclif","pluginAlias":"oclif","pluginType":"core","aliases":[],"flags":{"root":{"name":"root","type":"option","char":"r","description":"path to oclif CLI root","required":true,"multiple":false,"default":"."},"additional-cli":{"name":"additional-cli","type":"option","description":"an Oclif CLI other than the one listed in config.bin that should be made available to the user\nthe CLI should already exist in a directory named after the CLI that is the root of the tarball produced by \"oclif pack:tarballs\"","hidden":true,"multiple":false}},"args":[]},"upload:deb":{"id":"upload:deb","description":"upload deb package built with pack:deb","strict":true,"pluginName":"oclif","pluginAlias":"oclif","pluginType":"core","aliases":[],"flags":{"root":{"name":"root","type":"option","char":"r","description":"path to oclif CLI root","required":true,"multiple":false,"default":"."}},"args":[]},"upload:macos":{"id":"upload:macos","description":"upload macos installers built with pack:macos","strict":true,"pluginName":"oclif","pluginAlias":"oclif","pluginType":"core","aliases":[],"flags":{"root":{"name":"root","type":"option","char":"r","description":"path to oclif CLI root","required":true,"multiple":false,"default":"."}},"args":[]},"upload:tarballs":{"id":"upload:tarballs","description":"upload an oclif CLI to S3\n\n\"aws-sdk\" will need to be installed as a devDependency to upload.\n","strict":true,"pluginName":"oclif","pluginAlias":"oclif","pluginType":"core","aliases":[],"flags":{"root":{"name":"root","type":"option","char":"r","description":"path to oclif CLI root","required":true,"multiple":false,"default":"."},"targets":{"name":"targets","type":"option","char":"t","description":"comma-separated targets to upload (e.g.: linux-arm,win32-x64)","multiple":false,"default":"linux-x64,linux-arm,win32-x64,win32-x86,darwin-x64,darwin-arm64"},"xz":{"name":"xz","type":"boolean","description":"also upload xz","allowNo":true}},"args":[]},"upload:win":{"id":"upload:win","description":"upload windows installers built with pack:win","strict":true,"pluginName":"oclif","pluginAlias":"oclif","pluginType":"core","aliases":[],"flags":{"root":{"name":"root","type":"option","char":"r","description":"path to oclif CLI root","required":true,"multiple":false,"default":"."}},"args":[]}}}
|
package/CHANGELOG.md
CHANGED
|
@@ -2,37 +2,126 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
### [2.0.1](https://github.com/oclif/oclif/compare/v2.0.0-main.19...v2.0.1) (2021-12-08)
|
|
6
6
|
|
|
7
|
+
## [2.0.0-main.19](https://github.com/oclif/oclif/compare/v2.0.0-main.18...v2.0.0-main.19) (2021-12-08)
|
|
7
8
|
|
|
8
|
-
### ⚠ BREAKING CHANGES
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
### Bug Fixes
|
|
11
|
+
|
|
12
|
+
* bump deps ([#750](https://github.com/oclif/oclif/issues/750)) ([ffb9b99](https://github.com/oclif/oclif/commit/ffb9b99ba2f53a9049f04d0dfea1a4b4b427dfe0))
|
|
13
|
+
|
|
14
|
+
## [2.0.0-main.18](https://github.com/oclif/oclif/compare/v2.0.0-main.17...v2.0.0-main.18) (2021-12-08)
|
|
15
|
+
|
|
16
|
+
## [2.0.0-main.17](https://github.com/oclif/oclif/compare/v2.0.0-main.16...v2.0.0-main.17) (2021-12-08)
|
|
17
|
+
|
|
18
|
+
## [2.0.0-main.16](https://github.com/oclif/oclif/compare/v2.0.0-main.15...v2.0.0-main.16) (2021-12-08)
|
|
19
|
+
|
|
20
|
+
## [2.0.0-main.15](https://github.com/oclif/oclif/compare/v2.0.0-main.14...v2.0.0-main.15) (2021-12-08)
|
|
21
|
+
|
|
22
|
+
## [2.0.0-main.14](https://github.com/oclif/oclif/compare/v2.0.0-main.13...v2.0.0-main.14) (2021-12-07)
|
|
23
|
+
|
|
11
24
|
|
|
12
25
|
### Bug Fixes
|
|
13
26
|
|
|
14
|
-
* bump deps ([#
|
|
27
|
+
* bump deps ([#748](https://github.com/oclif/oclif/issues/748)) ([18a42ba](https://github.com/oclif/oclif/commit/18a42ba62dbd165d4ea10f04b755afcf23260b54))
|
|
15
28
|
|
|
29
|
+
## [2.0.0-main.13](https://github.com/oclif/oclif/compare/v2.0.0-main.12...v2.0.0-main.13) (2021-12-07)
|
|
16
30
|
|
|
17
|
-
### build
|
|
18
31
|
|
|
19
|
-
|
|
32
|
+
### Bug Fixes
|
|
20
33
|
|
|
21
|
-
|
|
34
|
+
* bump deps ([#747](https://github.com/oclif/oclif/issues/747)) ([6f61f96](https://github.com/oclif/oclif/commit/6f61f96f123159cb0a9023063c8a949b3fd85a7f))
|
|
22
35
|
|
|
36
|
+
## [2.0.0-main.12](https://github.com/oclif/oclif/compare/v2.0.0-main.11...v2.0.0-main.12) (2021-12-06)
|
|
23
37
|
|
|
24
|
-
### ⚠ BREAKING CHANGES
|
|
25
38
|
|
|
26
|
-
|
|
39
|
+
### Bug Fixes
|
|
40
|
+
|
|
41
|
+
* bump deps ([#735](https://github.com/oclif/oclif/issues/735)) ([e01c9a7](https://github.com/oclif/oclif/commit/e01c9a7ecf5635309eeca694532b9fa6c9b8bb0d))
|
|
42
|
+
|
|
43
|
+
## [2.0.0-main.11](https://github.com/oclif/oclif/compare/v2.0.0-main.10...v2.0.0-main.11) (2021-12-01)
|
|
44
|
+
|
|
27
45
|
|
|
28
46
|
### Bug Fixes
|
|
29
47
|
|
|
30
|
-
*
|
|
48
|
+
* force main build to fix v1 tag/version ([140b581](https://github.com/oclif/oclif/commit/140b5811f018f56e3e26037402887415801f682a))
|
|
49
|
+
|
|
50
|
+
## [2.0.0-main.10](https://github.com/oclif/oclif/compare/v2.0.0-main.9...v2.0.0-main.10) (2021-11-17)
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
### Features
|
|
54
|
+
|
|
55
|
+
* support darwin-arm tarballs ([#711](https://github.com/oclif/oclif/issues/711)) ([61cb766](https://github.com/oclif/oclif/commit/61cb7664ce38f1b7827ff652f063c3be7adeb1af))
|
|
56
|
+
|
|
57
|
+
## [2.0.0-main.9](https://github.com/oclif/oclif/compare/v2.0.0-main.8...v2.0.0-main.9) (2021-11-04)
|
|
58
|
+
|
|
59
|
+
## [2.0.0-main.8](https://github.com/oclif/oclif/compare/v2.0.0-main.7...v2.0.0-main.8) (2021-10-08)
|
|
60
|
+
|
|
61
|
+
## [2.0.0-main.7](https://github.com/oclif/oclif/compare/v2.0.0-main.6...v2.0.0-main.7) (2021-10-08)
|
|
62
|
+
|
|
63
|
+
## [2.0.0-main.6](https://github.com/oclif/oclif/compare/v2.0.0-main.5...v2.0.0-main.6) (2021-10-05)
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
### Features
|
|
67
|
+
|
|
68
|
+
* add generate cmd ([#665](https://github.com/oclif/oclif/issues/665)) ([731ed49](https://github.com/oclif/oclif/commit/731ed490bc3bc1857d414dfd56d0d8dfd7b6be2b))
|
|
69
|
+
* unhide releasing related cmds ([#670](https://github.com/oclif/oclif/issues/670)) ([25ace5f](https://github.com/oclif/oclif/commit/25ace5f0641cbda3bf8ee0c204be8e6a47f187c6))
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
### Bug Fixes
|
|
31
73
|
|
|
74
|
+
* bump oclif/core to 1.0.0 ([#687](https://github.com/oclif/oclif/issues/687)) [skip-validate-pr] ([430bb19](https://github.com/oclif/oclif/commit/430bb19068133f3622f660f614e3fa69009cb73c))
|
|
75
|
+
|
|
76
|
+
## [2.0.0-main.5](https://github.com/oclif/oclif/compare/v2.0.0-main.4...v2.0.0-main.5) (2021-09-20)
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
### ⚠ BREAKING CHANGES
|
|
80
|
+
|
|
81
|
+
* require node 12+ (#668)
|
|
32
82
|
|
|
33
83
|
### build
|
|
34
84
|
|
|
35
|
-
* require node 12+ ([#
|
|
85
|
+
* require node 12+ ([#668](https://github.com/oclif/oclif/issues/668)) ([99ceef1](https://github.com/oclif/oclif/commit/99ceef1e761a5f53f25435c8d733cb7a6fb01ba1))
|
|
86
|
+
|
|
87
|
+
## [2.0.0-main.4](https://github.com/oclif/oclif/compare/v2.0.0-main.3...v2.0.0-main.4) (2021-09-20)
|
|
88
|
+
|
|
89
|
+
## [2.0.0-main.3](https://github.com/oclif/oclif/compare/v2.0.0-main.2...v2.0.0-main.3) (2021-09-16)
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
### Bug Fixes
|
|
93
|
+
|
|
94
|
+
* use summary field if available ([#667](https://github.com/oclif/oclif/issues/667)) ([60db19f](https://github.com/oclif/oclif/commit/60db19f89b44d451cfd6579f982b6545dec49ee6))
|
|
95
|
+
|
|
96
|
+
## [2.0.0-main.2](https://github.com/oclif/oclif/compare/v2.0.0-main.1...v2.0.0-main.2) (2021-08-30)
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
### Bug Fixes
|
|
100
|
+
|
|
101
|
+
* force build to pickup latest oclif/core ([#648](https://github.com/oclif/oclif/issues/648)) ([4ed1e9a](https://github.com/oclif/oclif/commit/4ed1e9a568a88ef37b51b95f66419cf52e16a3b7))
|
|
102
|
+
* remove context var ([#652](https://github.com/oclif/oclif/issues/652)) ([d8f12fa](https://github.com/oclif/oclif/commit/d8f12faa82566b562cd2c658013a6722e38872fc))
|
|
103
|
+
|
|
104
|
+
## [2.0.0-main.1](https://github.com/oclif/oclif/compare/v2.0.0-main.0...v2.0.0-main.1) (2021-07-08)
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
### Bug Fixes
|
|
108
|
+
|
|
109
|
+
* throw error if WINDOWS_SIGNING_PASS is not set ([0dc68b0](https://github.com/oclif/oclif/commit/0dc68b09fd7f52719d45440e4faf85782ced9680))
|
|
110
|
+
|
|
111
|
+
## [2.0.0-main.0](https://github.com/oclif/oclif/compare/v2.0.0-v2.0...v2.0.0-main.0) (2021-07-08)
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
### Bug Fixes
|
|
115
|
+
|
|
116
|
+
* change npm tag ([9d07724](https://github.com/oclif/oclif/commit/9d07724cd8b4a200bb6212425311cca2029fa752))
|
|
117
|
+
* prerelease name ([084e890](https://github.com/oclif/oclif/commit/084e8909ea93300a86bf6ddf6319b87a0d3ee5b1))
|
|
118
|
+
|
|
119
|
+
## [2.0.0-v2.0](https://github.com/oclif/oclif/compare/v1.18.1...v2.0.0-v2.0) (2021-07-08)
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
### Bug Fixes
|
|
123
|
+
|
|
124
|
+
* use @oclif/core for readme/manifest ([#607](https://github.com/oclif/oclif/issues/607)) ([15ade45](https://github.com/oclif/oclif/commit/15ade4596e4888c2e343d81331132e4ded494338))
|
|
36
125
|
|
|
37
126
|
### [1.18.1](https://github.com/oclif/oclif/compare/v1.18.0...v1.18.1) (2021-07-01)
|
|
38
127
|
|
package/README.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
<img src="https://user-images.githubusercontent.com/449385/38243295-e0a47d58-372e-11e8-9bc0-8c02a6f4d2ac.png" width="260" height="73">
|
|
2
|
+
<img src="https://user-images.githubusercontent.com/449385/38243295-e0a47d58-372e-11e8-9bc0-8c02a6f4d2ac.png" width="260" height="73">
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
oclif: Node.JS Open CLI Framework
|
|
@@ -7,22 +7,21 @@ oclif: Node.JS Open CLI Framework
|
|
|
7
7
|
|
|
8
8
|
[](https://spectrum.chat/oclif)
|
|
9
9
|
[](https://npmjs.org/package/oclif)
|
|
10
|
-
[](https://npmjs.org/package/@oclif/
|
|
13
|
-
[](https://github.com/oclif/oclif/blob/
|
|
10
|
+
[](https://circleci.com/gh/oclif/oclif/tree/main)
|
|
11
|
+
[](https://ci.appveyor.com/project/heroku/oclif/branch/main)
|
|
12
|
+
[](https://npmjs.org/package/@oclif/core)
|
|
13
|
+
[](https://github.com/oclif/oclif/blob/main/package.json)
|
|
14
14
|
|
|
15
15
|
<!-- toc -->
|
|
16
16
|
* [🗒 Description](#-description)
|
|
17
17
|
* [🚀 Getting Started Tutorial](#-getting-started-tutorial)
|
|
18
18
|
* [✨ Features](#-features)
|
|
19
19
|
* [📌 Requirements](#-requirements)
|
|
20
|
-
* [🌈 CLI Types](#-cli-types)
|
|
21
20
|
* [🏗 Usage](#-usage)
|
|
22
21
|
* [📚 Examples](#-examples)
|
|
23
22
|
* [🔨 Commands](#-commands)
|
|
24
23
|
* [🏭 Related Repositories](#-related-repositories)
|
|
25
|
-
* [🦔 Learn More](
|
|
24
|
+
* [🦔 Learn More](#-learn-more)
|
|
26
25
|
* [📣 Feedback](#-feedback)
|
|
27
26
|
<!-- tocstop -->
|
|
28
27
|
|
|
@@ -59,40 +58,12 @@ $ heroku info --app=<tab><tab> # will complete with all the Heroku apps a user h
|
|
|
59
58
|
|
|
60
59
|
Currently, Node 8+ is supported. We support the [LTS versions](https://nodejs.org/en/about/releases) of Node. You can add the [node](https://www.npmjs.com/package/node) package to your CLI to ensure users are running a specific version of Node.
|
|
61
60
|
|
|
62
|
-
# 🌈 CLI Types
|
|
63
|
-
|
|
64
|
-
With oclif you can create 2 different CLI types, single and multi.
|
|
65
|
-
|
|
66
|
-
Single CLIs are like `ls` or `cat`. They can accept arguments and flags. Single CLIs can [optionally be a single file](https://github.com/oclif/command).
|
|
67
|
-
|
|
68
|
-
Multi CLIs are like `git` or `heroku`. They have subcommands that are themselves single CLIs. In the `package.json` there is a field `oclif.commands` that points to a directory. This directory contains all the subcommands for the CLI. For example, if you had a CLI called `mycli` with the commands `mycli create` and `mycli destroy`, you would have a project like the following:
|
|
69
|
-
|
|
70
|
-
```
|
|
71
|
-
package.json
|
|
72
|
-
src/
|
|
73
|
-
└── commands/
|
|
74
|
-
├── create.ts
|
|
75
|
-
└── destroy.ts
|
|
76
|
-
```
|
|
77
|
-
|
|
78
|
-
Multi-command CLIs may also include [plugins](https://oclif.io/docs/plugins).
|
|
79
|
-
|
|
80
61
|
# 🏗 Usage
|
|
81
62
|
|
|
82
|
-
Creating a
|
|
63
|
+
Creating a CLI:
|
|
83
64
|
|
|
84
65
|
```sh-session
|
|
85
|
-
$ npx oclif
|
|
86
|
-
? npm package name (mynewcli): mynewcli
|
|
87
|
-
$ cd mynewcli
|
|
88
|
-
$ ./bin/run
|
|
89
|
-
hello world from ./src/index.js!
|
|
90
|
-
```
|
|
91
|
-
|
|
92
|
-
Creating a multi-command CLI:
|
|
93
|
-
|
|
94
|
-
```sh-session
|
|
95
|
-
$ npx oclif multi mynewcli
|
|
66
|
+
$ npx oclif generate mynewcli
|
|
96
67
|
? npm package name (mynewcli): mynewcli
|
|
97
68
|
$ cd mynewcli
|
|
98
69
|
$ ./bin/run --version
|
|
@@ -115,131 +86,287 @@ hello world from ./src/hello.js!
|
|
|
115
86
|
* [Multi-command CLI](https://github.com/oclif/example-multi-ts)
|
|
116
87
|
* [Single-command CLI](https://github.com/oclif/example-single-ts)
|
|
117
88
|
* [Multi-command CLI Plugin](https://github.com/oclif/example-plugin-ts)
|
|
118
|
-
* JavaScript
|
|
119
|
-
* [Multi-command CLI](https://github.com/oclif/example-multi-js)
|
|
120
|
-
* [Single-command CLI](https://github.com/oclif/example-single-js)
|
|
121
|
-
* [Multi-command CLI Plugin](https://github.com/oclif/example-plugin-js)
|
|
122
89
|
|
|
123
90
|
# 🔨 Commands
|
|
124
91
|
|
|
125
92
|
<!-- commands -->
|
|
126
|
-
* [`oclif
|
|
93
|
+
* [`oclif generate NAME`](#oclif-generate-name)
|
|
127
94
|
* [`oclif help [COMMAND]`](#oclif-help-command)
|
|
128
|
-
* [`oclif
|
|
129
|
-
* [`oclif
|
|
130
|
-
* [`oclif
|
|
131
|
-
* [`oclif
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
95
|
+
* [`oclif manifest [PATH]`](#oclif-manifest-path)
|
|
96
|
+
* [`oclif pack:deb`](#oclif-packdeb)
|
|
97
|
+
* [`oclif pack:macos`](#oclif-packmacos)
|
|
98
|
+
* [`oclif pack:tarballs`](#oclif-packtarballs)
|
|
99
|
+
* [`oclif pack:win`](#oclif-packwin)
|
|
100
|
+
* [`oclif promote`](#oclif-promote)
|
|
101
|
+
* [`oclif readme`](#oclif-readme)
|
|
102
|
+
* [`oclif upload:deb`](#oclif-uploaddeb)
|
|
103
|
+
* [`oclif upload:macos`](#oclif-uploadmacos)
|
|
104
|
+
* [`oclif upload:tarballs`](#oclif-uploadtarballs)
|
|
105
|
+
* [`oclif upload:win`](#oclif-uploadwin)
|
|
106
|
+
|
|
107
|
+
## `oclif generate NAME`
|
|
108
|
+
|
|
109
|
+
generate a new CLI
|
|
136
110
|
|
|
137
111
|
```
|
|
138
112
|
USAGE
|
|
139
|
-
$ oclif
|
|
113
|
+
$ oclif generate [NAME]
|
|
140
114
|
|
|
141
115
|
ARGUMENTS
|
|
142
|
-
NAME name of
|
|
116
|
+
NAME directory name of new project
|
|
117
|
+
|
|
118
|
+
DESCRIPTION
|
|
119
|
+
generate a new CLI
|
|
143
120
|
|
|
144
|
-
|
|
145
|
-
--defaults use defaults for every setting
|
|
146
|
-
--force overwrite existing files
|
|
121
|
+
This will clone the template repo 'oclif/hello-world' and update package properties
|
|
147
122
|
```
|
|
148
123
|
|
|
149
|
-
_See code: [src/commands/
|
|
124
|
+
_See code: [src/commands/generate.ts](https://github.com/oclif/oclif/blob/v2.0.1/src/commands/generate.ts)_
|
|
150
125
|
|
|
151
126
|
## `oclif help [COMMAND]`
|
|
152
127
|
|
|
153
|
-
|
|
128
|
+
Display help for oclif.
|
|
154
129
|
|
|
155
130
|
```
|
|
156
131
|
USAGE
|
|
157
|
-
$ oclif help [COMMAND]
|
|
132
|
+
$ oclif help [COMMAND] [-n]
|
|
158
133
|
|
|
159
134
|
ARGUMENTS
|
|
160
|
-
COMMAND
|
|
135
|
+
COMMAND Command to show help for.
|
|
136
|
+
|
|
137
|
+
FLAGS
|
|
138
|
+
-n, --nested-commands Include all nested commands in the output.
|
|
161
139
|
|
|
162
|
-
|
|
163
|
-
|
|
140
|
+
DESCRIPTION
|
|
141
|
+
Display help for oclif.
|
|
164
142
|
```
|
|
165
143
|
|
|
166
|
-
_See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/
|
|
144
|
+
_See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v5.1.9/src/commands/help.ts)_
|
|
167
145
|
|
|
168
|
-
## `oclif
|
|
146
|
+
## `oclif manifest [PATH]`
|
|
169
147
|
|
|
170
|
-
|
|
148
|
+
generates plugin manifest json
|
|
171
149
|
|
|
172
150
|
```
|
|
173
151
|
USAGE
|
|
174
|
-
$ oclif
|
|
152
|
+
$ oclif manifest [PATH]
|
|
175
153
|
|
|
176
154
|
ARGUMENTS
|
|
177
|
-
|
|
155
|
+
PATH [default: .] path to plugin
|
|
178
156
|
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
--event=event [default: init] event to run hook on
|
|
182
|
-
--force overwrite existing files
|
|
157
|
+
DESCRIPTION
|
|
158
|
+
generates plugin manifest json
|
|
183
159
|
```
|
|
184
160
|
|
|
185
|
-
_See code: [src/commands/
|
|
161
|
+
_See code: [src/commands/manifest.ts](https://github.com/oclif/oclif/blob/v2.0.1/src/commands/manifest.ts)_
|
|
186
162
|
|
|
187
|
-
## `oclif
|
|
163
|
+
## `oclif pack:deb`
|
|
188
164
|
|
|
189
|
-
|
|
165
|
+
pack CLI into debian package
|
|
190
166
|
|
|
191
167
|
```
|
|
192
168
|
USAGE
|
|
193
|
-
$ oclif
|
|
169
|
+
$ oclif pack:deb -r <value>
|
|
194
170
|
|
|
195
|
-
|
|
196
|
-
|
|
171
|
+
FLAGS
|
|
172
|
+
-r, --root=<value> (required) [default: .] path to oclif CLI root
|
|
197
173
|
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
--force overwrite existing files
|
|
201
|
-
--options=options (yarn|typescript|eslint|mocha)
|
|
174
|
+
DESCRIPTION
|
|
175
|
+
pack CLI into debian package
|
|
202
176
|
```
|
|
203
177
|
|
|
204
|
-
_See code: [src/commands/
|
|
178
|
+
_See code: [src/commands/pack/deb.ts](https://github.com/oclif/oclif/blob/v2.0.1/src/commands/pack/deb.ts)_
|
|
205
179
|
|
|
206
|
-
## `oclif
|
|
180
|
+
## `oclif pack:macos`
|
|
207
181
|
|
|
208
|
-
|
|
182
|
+
pack CLI into macOS .pkg
|
|
209
183
|
|
|
210
184
|
```
|
|
211
185
|
USAGE
|
|
212
|
-
$ oclif
|
|
186
|
+
$ oclif pack:macos -r <value>
|
|
213
187
|
|
|
214
|
-
|
|
215
|
-
|
|
188
|
+
FLAGS
|
|
189
|
+
-r, --root=<value> (required) [default: .] path to oclif CLI root
|
|
216
190
|
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
--force overwrite existing files
|
|
220
|
-
--options=options (yarn|typescript|eslint|mocha)
|
|
191
|
+
DESCRIPTION
|
|
192
|
+
pack CLI into macOS .pkg
|
|
221
193
|
```
|
|
222
194
|
|
|
223
|
-
_See code: [src/commands/
|
|
195
|
+
_See code: [src/commands/pack/macos.ts](https://github.com/oclif/oclif/blob/v2.0.1/src/commands/pack/macos.ts)_
|
|
224
196
|
|
|
225
|
-
## `oclif
|
|
197
|
+
## `oclif pack:tarballs`
|
|
226
198
|
|
|
227
|
-
|
|
199
|
+
packages oclif CLI into tarballs
|
|
228
200
|
|
|
229
201
|
```
|
|
230
202
|
USAGE
|
|
231
|
-
$ oclif
|
|
203
|
+
$ oclif pack:tarballs -r <value> [-t <value>] [--xz]
|
|
232
204
|
|
|
233
|
-
|
|
234
|
-
|
|
205
|
+
FLAGS
|
|
206
|
+
-r, --root=<value> (required) [default: .] path to oclif CLI root
|
|
207
|
+
-t, --targets=<value> [default: linux-x64,linux-arm,win32-x64,win32-x86,darwin-x64,darwin-arm64] comma-separated
|
|
208
|
+
targets to pack (e.g.: linux-arm,win32-x64)
|
|
209
|
+
--[no-]xz also build xz
|
|
210
|
+
|
|
211
|
+
DESCRIPTION
|
|
212
|
+
packages oclif CLI into tarballs
|
|
213
|
+
|
|
214
|
+
This can be used to create oclif CLIs that use the system node or that come preloaded with a node binary.
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
_See code: [src/commands/pack/tarballs.ts](https://github.com/oclif/oclif/blob/v2.0.1/src/commands/pack/tarballs.ts)_
|
|
218
|
+
|
|
219
|
+
## `oclif pack:win`
|
|
220
|
+
|
|
221
|
+
create windows installer from oclif CLI
|
|
222
|
+
|
|
223
|
+
```
|
|
224
|
+
USAGE
|
|
225
|
+
$ oclif pack:win -r <value>
|
|
226
|
+
|
|
227
|
+
FLAGS
|
|
228
|
+
-r, --root=<value> (required) [default: .] path to oclif CLI root
|
|
229
|
+
|
|
230
|
+
DESCRIPTION
|
|
231
|
+
create windows installer from oclif CLI
|
|
232
|
+
|
|
233
|
+
This command requires WINDOWS_SIGNING (prefixed with the name of your executable, e.g. OCLIF_WINDOWS_SIGNING_PASS) to
|
|
234
|
+
be set in the environment
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
_See code: [src/commands/pack/win.ts](https://github.com/oclif/oclif/blob/v2.0.1/src/commands/pack/win.ts)_
|
|
238
|
+
|
|
239
|
+
## `oclif promote`
|
|
240
|
+
|
|
241
|
+
promote CLI builds to a S3 release channel
|
|
242
|
+
|
|
243
|
+
```
|
|
244
|
+
USAGE
|
|
245
|
+
$ oclif promote -r <value> --version <value> --sha <value> --channel <value> [-t <value>] [-d] [-m] [-w]
|
|
246
|
+
[-a <value>] [--xz] [--indexes]
|
|
247
|
+
|
|
248
|
+
FLAGS
|
|
249
|
+
-a, --max-age=<value> [default: 86400] cache control max-age in seconds
|
|
250
|
+
-d, --deb promote debian artifacts
|
|
251
|
+
-m, --macos promote macOS pkg
|
|
252
|
+
-r, --root=<value> (required) [default: .] path to the oclif CLI project root
|
|
253
|
+
-t, --targets=<value> [default: linux-x64,linux-arm,win32-x64,win32-x86,darwin-x64,darwin-arm64] comma-separated
|
|
254
|
+
targets to promote (e.g.: linux-arm,win32-x64)
|
|
255
|
+
-w, --win promote Windows exe
|
|
256
|
+
--channel=<value> (required) [default: stable] which channel to promote to
|
|
257
|
+
--indexes append the promoted urls into the index files
|
|
258
|
+
--sha=<value> (required) 7-digit short git commit SHA of the CLI to promote
|
|
259
|
+
--version=<value> (required) semantic version of the CLI to promote
|
|
260
|
+
--[no-]xz also upload xz
|
|
261
|
+
|
|
262
|
+
DESCRIPTION
|
|
263
|
+
promote CLI builds to a S3 release channel
|
|
264
|
+
```
|
|
265
|
+
|
|
266
|
+
_See code: [src/commands/promote.ts](https://github.com/oclif/oclif/blob/v2.0.1/src/commands/promote.ts)_
|
|
267
|
+
|
|
268
|
+
## `oclif readme`
|
|
269
|
+
|
|
270
|
+
adds commands to README.md in current directory
|
|
271
|
+
|
|
272
|
+
```
|
|
273
|
+
USAGE
|
|
274
|
+
$ oclif readme --dir <value> [--multi]
|
|
275
|
+
|
|
276
|
+
FLAGS
|
|
277
|
+
--dir=<value> (required) [default: docs] output directory for multi docs
|
|
278
|
+
--multi create a different markdown page for each topic
|
|
279
|
+
|
|
280
|
+
DESCRIPTION
|
|
281
|
+
adds commands to README.md in current directory
|
|
282
|
+
|
|
283
|
+
The readme must have any of the following tags inside of it for it to be replaced or else it will do nothing:
|
|
284
|
+
|
|
285
|
+
# Usage
|
|
286
|
+
|
|
287
|
+
<!-- usage -->
|
|
288
|
+
|
|
289
|
+
# Commands
|
|
290
|
+
|
|
291
|
+
<!-- commands -->
|
|
292
|
+
|
|
293
|
+
Customize the code URL prefix by setting oclif.repositoryPrefix in package.json.
|
|
294
|
+
```
|
|
295
|
+
|
|
296
|
+
_See code: [src/commands/readme.ts](https://github.com/oclif/oclif/blob/v2.0.1/src/commands/readme.ts)_
|
|
297
|
+
|
|
298
|
+
## `oclif upload:deb`
|
|
299
|
+
|
|
300
|
+
upload deb package built with pack:deb
|
|
301
|
+
|
|
302
|
+
```
|
|
303
|
+
USAGE
|
|
304
|
+
$ oclif upload:deb -r <value>
|
|
305
|
+
|
|
306
|
+
FLAGS
|
|
307
|
+
-r, --root=<value> (required) [default: .] path to oclif CLI root
|
|
308
|
+
|
|
309
|
+
DESCRIPTION
|
|
310
|
+
upload deb package built with pack:deb
|
|
311
|
+
```
|
|
312
|
+
|
|
313
|
+
_See code: [src/commands/upload/deb.ts](https://github.com/oclif/oclif/blob/v2.0.1/src/commands/upload/deb.ts)_
|
|
314
|
+
|
|
315
|
+
## `oclif upload:macos`
|
|
316
|
+
|
|
317
|
+
upload macos installers built with pack:macos
|
|
318
|
+
|
|
319
|
+
```
|
|
320
|
+
USAGE
|
|
321
|
+
$ oclif upload:macos -r <value>
|
|
322
|
+
|
|
323
|
+
FLAGS
|
|
324
|
+
-r, --root=<value> (required) [default: .] path to oclif CLI root
|
|
325
|
+
|
|
326
|
+
DESCRIPTION
|
|
327
|
+
upload macos installers built with pack:macos
|
|
328
|
+
```
|
|
329
|
+
|
|
330
|
+
_See code: [src/commands/upload/macos.ts](https://github.com/oclif/oclif/blob/v2.0.1/src/commands/upload/macos.ts)_
|
|
331
|
+
|
|
332
|
+
## `oclif upload:tarballs`
|
|
333
|
+
|
|
334
|
+
upload an oclif CLI to S3
|
|
335
|
+
|
|
336
|
+
```
|
|
337
|
+
USAGE
|
|
338
|
+
$ oclif upload:tarballs -r <value> [-t <value>] [--xz]
|
|
339
|
+
|
|
340
|
+
FLAGS
|
|
341
|
+
-r, --root=<value> (required) [default: .] path to oclif CLI root
|
|
342
|
+
-t, --targets=<value> [default: linux-x64,linux-arm,win32-x64,win32-x86,darwin-x64,darwin-arm64] comma-separated
|
|
343
|
+
targets to upload (e.g.: linux-arm,win32-x64)
|
|
344
|
+
--[no-]xz also upload xz
|
|
345
|
+
|
|
346
|
+
DESCRIPTION
|
|
347
|
+
upload an oclif CLI to S3
|
|
348
|
+
|
|
349
|
+
"aws-sdk" will need to be installed as a devDependency to upload.
|
|
350
|
+
```
|
|
351
|
+
|
|
352
|
+
_See code: [src/commands/upload/tarballs.ts](https://github.com/oclif/oclif/blob/v2.0.1/src/commands/upload/tarballs.ts)_
|
|
353
|
+
|
|
354
|
+
## `oclif upload:win`
|
|
355
|
+
|
|
356
|
+
upload windows installers built with pack:win
|
|
357
|
+
|
|
358
|
+
```
|
|
359
|
+
USAGE
|
|
360
|
+
$ oclif upload:win -r <value>
|
|
361
|
+
|
|
362
|
+
FLAGS
|
|
363
|
+
-r, --root=<value> (required) [default: .] path to oclif CLI root
|
|
235
364
|
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
--force overwrite existing files
|
|
239
|
-
--options=options (yarn|typescript|eslint|mocha)
|
|
365
|
+
DESCRIPTION
|
|
366
|
+
upload windows installers built with pack:win
|
|
240
367
|
```
|
|
241
368
|
|
|
242
|
-
_See code: [src/commands/
|
|
369
|
+
_See code: [src/commands/upload/win.ts](https://github.com/oclif/oclif/blob/v2.0.1/src/commands/upload/win.ts)_
|
|
243
370
|
<!-- commandsstop -->
|
|
244
371
|
|
|
245
372
|
# 🏭 Related Repositories
|
package/bin/dev
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const oclif = require('@oclif/core')
|
|
4
|
+
|
|
5
|
+
const path = require('path')
|
|
6
|
+
const project = path.join(__dirname, '..', 'tsconfig.json')
|
|
7
|
+
|
|
8
|
+
// In dev mode -> use ts-node and dev plugins
|
|
9
|
+
process.env.NODE_ENV = 'development'
|
|
10
|
+
|
|
11
|
+
require('ts-node').register({project})
|
|
12
|
+
|
|
13
|
+
// In dev mode, always show stack traces
|
|
14
|
+
// Waiting for https://github.com/oclif/core/pull/147
|
|
15
|
+
// oclif.settings.debug = true;
|
|
16
|
+
oclif.settings.disableJsonFlag = true
|
|
17
|
+
|
|
18
|
+
// Start the CLI
|
|
19
|
+
oclif.run().then(oclif.flush).catch(oclif.Errors.handle)
|
package/bin/dev.cmd
ADDED