oclif 2.0.0-main.9 → 2.0.0-master.0
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 +5 -58
- package/README.md +97 -224
- package/bin/run +2 -5
- package/lib/app-command.d.ts +12 -0
- package/lib/app-command.js +26 -0
- package/lib/aws.d.ts +5 -5
- package/lib/aws.js +5 -5
- package/lib/command-base.d.ts +2 -2
- package/lib/command-base.js +3 -3
- package/lib/commands/base.d.ts +5 -0
- package/lib/commands/base.js +11 -0
- package/lib/commands/command.d.ts +17 -0
- package/lib/commands/command.js +23 -0
- package/lib/commands/hook.d.ts +18 -0
- package/lib/commands/hook.js +25 -0
- package/lib/commands/manifest.d.ts +2 -1
- package/lib/commands/manifest.js +7 -4
- package/lib/commands/multi.d.ts +5 -0
- package/lib/commands/multi.js +11 -0
- package/lib/commands/pack/deb.d.ts +3 -3
- package/lib/commands/pack/deb.js +12 -11
- package/lib/commands/pack/macos.d.ts +3 -4
- package/lib/commands/pack/macos.js +13 -19
- package/lib/commands/pack/tarballs.d.ts +3 -6
- package/lib/commands/pack/tarballs.js +7 -6
- package/lib/commands/pack/win.d.ts +3 -4
- package/lib/commands/pack/win.js +16 -28
- package/lib/commands/plugin.d.ts +5 -0
- package/lib/commands/plugin.js +11 -0
- package/lib/commands/promote.d.ts +3 -14
- package/lib/commands/promote.js +28 -27
- package/lib/commands/readme.d.ts +11 -13
- package/lib/commands/readme.js +36 -35
- package/lib/commands/single.d.ts +5 -0
- package/lib/commands/single.js +11 -0
- package/lib/commands/upload/deb.d.ts +3 -2
- package/lib/commands/upload/deb.js +9 -8
- package/lib/commands/upload/macos.d.ts +3 -2
- package/lib/commands/upload/macos.js +9 -8
- package/lib/commands/upload/tarballs.d.ts +3 -7
- package/lib/commands/upload/tarballs.js +20 -19
- package/lib/commands/upload/win.d.ts +3 -2
- package/lib/commands/upload/win.js +11 -10
- package/lib/generators/{cli.d.ts → app.d.ts} +21 -1
- package/lib/generators/app.js +459 -0
- package/lib/generators/command.d.ts +15 -0
- package/lib/generators/command.js +51 -0
- package/lib/generators/hook.d.ts +14 -0
- package/lib/generators/hook.js +51 -0
- package/lib/help-compatibility.d.ts +5 -4
- package/lib/help-compatibility.js +0 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.js +2 -3
- package/lib/log.js +2 -3
- package/lib/tarballs/bin.d.ts +2 -2
- package/lib/tarballs/bin.js +1 -2
- package/lib/tarballs/build.js +28 -29
- package/lib/tarballs/config.d.ts +7 -6
- package/lib/tarballs/config.js +7 -6
- package/lib/tarballs/index.js +4 -4
- package/lib/tarballs/node.js +4 -5
- package/lib/upload-util.d.ts +3 -3
- package/lib/upload-util.js +1 -2
- package/lib/util.js +24 -27
- package/lib/version-indexes.d.ts +4 -2
- package/lib/version-indexes.js +5 -7
- package/package.json +24 -23
- package/templates/LICENSE.mit +21 -0
- package/templates/README.md.ejs +21 -0
- package/templates/appveyor.yml.ejs +33 -0
- package/templates/base/src/index.js +1 -0
- package/templates/base/src/index.ts +1 -0
- package/templates/base/test/index.test.js +8 -0
- package/templates/base/test/index.test.ts +9 -0
- package/templates/bin/run +5 -0
- package/templates/bin/run.cmd +3 -0
- package/templates/circle.yml.ejs +65 -0
- package/templates/editorconfig +11 -0
- package/templates/eslintrc +7 -0
- package/templates/eslintrc.typescript +10 -0
- package/templates/multi/src/index.js +1 -0
- package/templates/multi/src/index.ts +1 -0
- package/templates/plugin/bin/run +4 -0
- package/templates/plugin/src/index.ts +1 -0
- package/templates/scripts/setup_git +12 -0
- package/templates/single/bin/run.js +4 -0
- package/templates/single/bin/run.ts +13 -0
- package/templates/src/command.js.ejs +27 -0
- package/templates/src/command.ts.ejs +46 -0
- package/templates/src/hook.js.ejs +3 -0
- package/templates/src/hook.ts.ejs +7 -0
- package/templates/test/command.test.js.ejs +28 -0
- package/templates/test/command.test.ts.ejs +29 -0
- package/templates/test/hook.test.js.ejs +9 -0
- package/templates/test/hook.test.ts.ejs +9 -0
- package/templates/test/mocha.opts +4 -0
- package/templates/test/tsconfig.json +9 -0
- package/templates/travis.yml.ejs +14 -0
- package/templates/tsconfig.json +15 -0
- package/bin/dev +0 -19
- package/bin/dev.cmd +0 -3
- package/lib/commands/generate.d.ts +0 -11
- package/lib/commands/generate.js +0 -19
- package/lib/generators/cli.js +0 -183
package/.oclif.manifest.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":"2.0.0-
|
|
1
|
+
{"version":"2.0.0-master.0","commands":{"base":{"id":"base","pluginName":"oclif","pluginType":"core","hidden":true,"aliases":[],"flags":{"defaults":{"name":"defaults","type":"boolean","description":"use defaults for every setting","allowNo":false},"options":{"name":"options","type":"option","description":"(yarn|typescript|eslint|mocha)"},"force":{"name":"force","type":"boolean","description":"overwrite existing files","allowNo":false}},"args":[{"name":"path","description":"path to project, defaults to current directory","required":false}]},"command":{"id":"command","description":"add a command to an existing CLI or plugin","pluginName":"oclif","pluginType":"core","aliases":[],"flags":{"defaults":{"name":"defaults","type":"boolean","description":"use defaults for every setting","allowNo":false},"force":{"name":"force","type":"boolean","description":"overwrite existing files","allowNo":false}},"args":[{"name":"name","description":"name of command","required":true}]},"hook":{"id":"hook","description":"add a hook to an existing CLI or plugin","pluginName":"oclif","pluginType":"core","aliases":[],"flags":{"defaults":{"name":"defaults","type":"boolean","description":"use defaults for every setting","allowNo":false},"force":{"name":"force","type":"boolean","description":"overwrite existing files","allowNo":false},"event":{"name":"event","type":"option","description":"event to run hook on","default":"init"}},"args":[{"name":"name","description":"name of hook (snake_case)","required":true}]},"manifest":{"id":"manifest","description":"generates plugin manifest json","pluginName":"oclif","pluginType":"core","hidden":true,"aliases":[],"flags":{},"args":[{"name":"path","description":"path to plugin","default":"."}]},"multi":{"id":"multi","description":"generate a new multi-command CLI","pluginName":"oclif","pluginType":"core","aliases":[],"flags":{"defaults":{"name":"defaults","type":"boolean","description":"use defaults for every setting","allowNo":false},"options":{"name":"options","type":"option","description":"(yarn|typescript|eslint|mocha)"},"force":{"name":"force","type":"boolean","description":"overwrite existing files","allowNo":false}},"args":[{"name":"path","description":"path to project, defaults to current directory","required":false}]},"plugin":{"id":"plugin","description":"create a new CLI plugin","pluginName":"oclif","pluginType":"core","aliases":[],"flags":{"defaults":{"name":"defaults","type":"boolean","description":"use defaults for every setting","allowNo":false},"options":{"name":"options","type":"option","description":"(yarn|typescript|eslint|mocha)"},"force":{"name":"force","type":"boolean","description":"overwrite existing files","allowNo":false}},"args":[{"name":"path","description":"path to project, defaults to current directory","required":false}]},"promote":{"id":"promote","description":"promote CLI builds to a S3 release channel","pluginName":"oclif","pluginType":"core","hidden":true,"aliases":[],"flags":{"root":{"name":"root","type":"option","char":"r","description":"path to the oclif CLI project root","required":true,"default":"."},"version":{"name":"version","type":"option","description":"semantic version of the CLI to promote","required":true},"sha":{"name":"sha","type":"option","description":"7-digit short git commit SHA of the CLI to promote","required":true},"channel":{"name":"channel","type":"option","description":"which channel to promote to","required":true,"default":"stable"},"targets":{"name":"targets","type":"option","char":"t","description":"comma-separated targets to promote (e.g.: linux-arm,win32-x64)","default":"linux-x64,linux-arm,win32-x64,win32-x86,darwin-x64"},"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","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","pluginName":"oclif","pluginType":"core","hidden":true,"aliases":[],"flags":{"dir":{"name":"dir","type":"option","description":"output directory for multi docs","required":true,"default":"docs"},"multi":{"name":"multi","type":"boolean","description":"create a different markdown page for each topic","allowNo":false}},"args":[]},"single":{"id":"single","description":"generate a new single-command CLI","pluginName":"oclif","pluginType":"core","aliases":[],"flags":{"defaults":{"name":"defaults","type":"boolean","description":"use defaults for every setting","allowNo":false},"options":{"name":"options","type":"option","description":"(yarn|typescript|eslint|mocha)"},"force":{"name":"force","type":"boolean","description":"overwrite existing files","allowNo":false}},"args":[{"name":"path","description":"path to project, defaults to current directory","required":false}]},"pack:deb":{"id":"pack:deb","description":"pack CLI into debian package","pluginName":"oclif","pluginType":"core","hidden":true,"aliases":[],"flags":{"root":{"name":"root","type":"option","char":"r","description":"path to oclif CLI root","required":true,"default":"."}},"args":[]},"pack:macos":{"id":"pack:macos","description":"pack CLI into macOS .pkg","pluginName":"oclif","pluginType":"core","hidden":true,"aliases":[],"flags":{"root":{"name":"root","type":"option","char":"r","description":"path to oclif CLI root","required":true,"default":"."}},"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","pluginName":"oclif","pluginType":"core","hidden":true,"aliases":[],"flags":{"root":{"name":"root","type":"option","char":"r","description":"path to oclif CLI root","required":true,"default":"."},"targets":{"name":"targets","type":"option","char":"t","description":"comma-separated targets to pack (e.g.: linux-arm,win32-x64)","default":"linux-x64,linux-arm,win32-x64,win32-x86,darwin-x64"},"xz":{"name":"xz","type":"boolean","description":"also build xz","allowNo":true}},"args":[]},"pack:win":{"id":"pack:win","description":"create windows installer from oclif CLI","pluginName":"oclif","pluginType":"core","hidden":true,"aliases":[],"flags":{"root":{"name":"root","type":"option","char":"r","description":"path to oclif CLI root","required":true,"default":"."}},"args":[]},"upload:deb":{"id":"upload:deb","description":"upload deb package built with pack:deb","pluginName":"oclif","pluginType":"core","hidden":true,"aliases":[],"flags":{"root":{"name":"root","type":"option","char":"r","description":"path to oclif CLI root","required":true,"default":"."}},"args":[]},"upload:macos":{"id":"upload:macos","description":"upload macos installers built with pack:macos","pluginName":"oclif","pluginType":"core","hidden":true,"aliases":[],"flags":{"root":{"name":"root","type":"option","char":"r","description":"path to oclif CLI root","required":true,"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","pluginName":"oclif","pluginType":"core","hidden":true,"aliases":[],"flags":{"root":{"name":"root","type":"option","char":"r","description":"path to oclif CLI root","required":true,"default":"."},"targets":{"name":"targets","type":"option","char":"t","description":"comma-separated targets to upload (e.g.: linux-arm,win32-x64)","default":"linux-x64,linux-arm,win32-x64,win32-x86,darwin-x64"},"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","pluginName":"oclif","pluginType":"core","hidden":true,"aliases":[],"flags":{"root":{"name":"root","type":"option","char":"r","description":"path to oclif CLI root","required":true,"default":"."}},"args":[]}}}
|
package/CHANGELOG.md
CHANGED
|
@@ -2,74 +2,21 @@
|
|
|
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
|
-
## [2.0.0-
|
|
6
|
-
|
|
7
|
-
## [2.0.0-main.8](https://github.com/oclif/oclif/compare/v2.0.0-main.7...v2.0.0-main.8) (2021-10-08)
|
|
8
|
-
|
|
9
|
-
## [2.0.0-main.7](https://github.com/oclif/oclif/compare/v2.0.0-main.6...v2.0.0-main.7) (2021-10-08)
|
|
10
|
-
|
|
11
|
-
## [2.0.0-main.6](https://github.com/oclif/oclif/compare/v2.0.0-main.5...v2.0.0-main.6) (2021-10-05)
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
### Features
|
|
15
|
-
|
|
16
|
-
* add generate cmd ([#665](https://github.com/oclif/oclif/issues/665)) ([731ed49](https://github.com/oclif/oclif/commit/731ed490bc3bc1857d414dfd56d0d8dfd7b6be2b))
|
|
17
|
-
* unhide releasing related cmds ([#670](https://github.com/oclif/oclif/issues/670)) ([25ace5f](https://github.com/oclif/oclif/commit/25ace5f0641cbda3bf8ee0c204be8e6a47f187c6))
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
### Bug Fixes
|
|
21
|
-
|
|
22
|
-
* 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))
|
|
23
|
-
|
|
24
|
-
## [2.0.0-main.5](https://github.com/oclif/oclif/compare/v2.0.0-main.4...v2.0.0-main.5) (2021-09-20)
|
|
5
|
+
## [2.0.0-master.0](https://github.com/oclif/oclif/compare/v1.18.1...v2.0.0-master.0) (2021-12-01)
|
|
25
6
|
|
|
26
7
|
|
|
27
8
|
### ⚠ BREAKING CHANGES
|
|
28
9
|
|
|
29
|
-
* require node 12+ (#
|
|
30
|
-
|
|
31
|
-
### build
|
|
32
|
-
|
|
33
|
-
* require node 12+ ([#668](https://github.com/oclif/oclif/issues/668)) ([99ceef1](https://github.com/oclif/oclif/commit/99ceef1e761a5f53f25435c8d733cb7a6fb01ba1))
|
|
34
|
-
|
|
35
|
-
## [2.0.0-main.4](https://github.com/oclif/oclif/compare/v2.0.0-main.3...v2.0.0-main.4) (2021-09-20)
|
|
36
|
-
|
|
37
|
-
## [2.0.0-main.3](https://github.com/oclif/oclif/compare/v2.0.0-main.2...v2.0.0-main.3) (2021-09-16)
|
|
38
|
-
|
|
10
|
+
* require node 12+ (#676)
|
|
39
11
|
|
|
40
12
|
### Bug Fixes
|
|
41
13
|
|
|
42
|
-
*
|
|
14
|
+
* bump deps ([#723](https://github.com/oclif/oclif/issues/723)) ([78640ad](https://github.com/oclif/oclif/commit/78640adb106350e1abe747559dc0ae65c853d7c8))
|
|
43
15
|
|
|
44
|
-
## [2.0.0-main.2](https://github.com/oclif/oclif/compare/v2.0.0-main.1...v2.0.0-main.2) (2021-08-30)
|
|
45
16
|
|
|
17
|
+
### build
|
|
46
18
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
* force build to pickup latest oclif/core ([#648](https://github.com/oclif/oclif/issues/648)) ([4ed1e9a](https://github.com/oclif/oclif/commit/4ed1e9a568a88ef37b51b95f66419cf52e16a3b7))
|
|
50
|
-
* remove context var ([#652](https://github.com/oclif/oclif/issues/652)) ([d8f12fa](https://github.com/oclif/oclif/commit/d8f12faa82566b562cd2c658013a6722e38872fc))
|
|
51
|
-
|
|
52
|
-
## [2.0.0-main.1](https://github.com/oclif/oclif/compare/v2.0.0-main.0...v2.0.0-main.1) (2021-07-08)
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
### Bug Fixes
|
|
56
|
-
|
|
57
|
-
* throw error if WINDOWS_SIGNING_PASS is not set ([0dc68b0](https://github.com/oclif/oclif/commit/0dc68b09fd7f52719d45440e4faf85782ced9680))
|
|
58
|
-
|
|
59
|
-
## [2.0.0-main.0](https://github.com/oclif/oclif/compare/v2.0.0-v2.0...v2.0.0-main.0) (2021-07-08)
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
### Bug Fixes
|
|
63
|
-
|
|
64
|
-
* change npm tag ([9d07724](https://github.com/oclif/oclif/commit/9d07724cd8b4a200bb6212425311cca2029fa752))
|
|
65
|
-
* prerelease name ([084e890](https://github.com/oclif/oclif/commit/084e8909ea93300a86bf6ddf6319b87a0d3ee5b1))
|
|
66
|
-
|
|
67
|
-
## [2.0.0-v2.0](https://github.com/oclif/oclif/compare/v1.18.1...v2.0.0-v2.0) (2021-07-08)
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
### Bug Fixes
|
|
71
|
-
|
|
72
|
-
* use @oclif/core for readme/manifest ([#607](https://github.com/oclif/oclif/issues/607)) ([15ade45](https://github.com/oclif/oclif/commit/15ade4596e4888c2e343d81331132e4ded494338))
|
|
19
|
+
* require node 12+ ([#676](https://github.com/oclif/oclif/issues/676)) ([f4b648c](https://github.com/oclif/oclif/commit/f4b648c244c8806c999ad2e636c446414b14c5a5))
|
|
73
20
|
|
|
74
21
|
### [1.18.1](https://github.com/oclif/oclif/compare/v1.18.0...v1.18.1) (2021-07-01)
|
|
75
22
|
|
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,16 +7,17 @@ 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/master)
|
|
11
|
+
[](https://ci.appveyor.com/project/heroku/oclif/branch/master)
|
|
12
|
+
[](https://npmjs.org/package/@oclif/command)
|
|
13
|
+
[](https://github.com/oclif/oclif/blob/master/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)
|
|
20
21
|
* [🏗 Usage](#-usage)
|
|
21
22
|
* [📚 Examples](#-examples)
|
|
22
23
|
* [🔨 Commands](#-commands)
|
|
@@ -58,12 +59,40 @@ $ heroku info --app=<tab><tab> # will complete with all the Heroku apps a user h
|
|
|
58
59
|
|
|
59
60
|
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.
|
|
60
61
|
|
|
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
|
+
|
|
61
80
|
# 🏗 Usage
|
|
62
81
|
|
|
63
|
-
Creating a CLI:
|
|
82
|
+
Creating a single-command CLI:
|
|
64
83
|
|
|
65
84
|
```sh-session
|
|
66
|
-
$ npx oclif
|
|
85
|
+
$ npx oclif single mynewcli
|
|
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
|
|
67
96
|
? npm package name (mynewcli): mynewcli
|
|
68
97
|
$ cd mynewcli
|
|
69
98
|
$ ./bin/run --version
|
|
@@ -86,42 +115,38 @@ hello world from ./src/hello.js!
|
|
|
86
115
|
* [Multi-command CLI](https://github.com/oclif/example-multi-ts)
|
|
87
116
|
* [Single-command CLI](https://github.com/oclif/example-single-ts)
|
|
88
117
|
* [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)
|
|
89
122
|
|
|
90
123
|
# 🔨 Commands
|
|
91
124
|
|
|
92
125
|
<!-- commands -->
|
|
93
|
-
* [`oclif
|
|
126
|
+
* [`oclif command NAME`](#oclif-command-name)
|
|
94
127
|
* [`oclif help [COMMAND]`](#oclif-help-command)
|
|
95
|
-
* [`oclif
|
|
96
|
-
* [`oclif
|
|
97
|
-
* [`oclif
|
|
98
|
-
* [`oclif
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
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
|
|
128
|
+
* [`oclif hook NAME`](#oclif-hook-name)
|
|
129
|
+
* [`oclif multi [PATH]`](#oclif-multi-path)
|
|
130
|
+
* [`oclif plugin [PATH]`](#oclif-plugin-path)
|
|
131
|
+
* [`oclif single [PATH]`](#oclif-single-path)
|
|
132
|
+
|
|
133
|
+
## `oclif command NAME`
|
|
134
|
+
|
|
135
|
+
add a command to an existing CLI or plugin
|
|
110
136
|
|
|
111
137
|
```
|
|
112
138
|
USAGE
|
|
113
|
-
$ oclif
|
|
139
|
+
$ oclif command NAME
|
|
114
140
|
|
|
115
141
|
ARGUMENTS
|
|
116
|
-
NAME
|
|
117
|
-
|
|
118
|
-
DESCRIPTION
|
|
119
|
-
generate a new CLI
|
|
142
|
+
NAME name of command
|
|
120
143
|
|
|
121
|
-
|
|
144
|
+
OPTIONS
|
|
145
|
+
--defaults use defaults for every setting
|
|
146
|
+
--force overwrite existing files
|
|
122
147
|
```
|
|
123
148
|
|
|
124
|
-
_See code: [src/commands/
|
|
149
|
+
_See code: [src/commands/command.ts](https://github.com/oclif/oclif/blob/v1.18.1/src/commands/command.ts)_
|
|
125
150
|
|
|
126
151
|
## `oclif help [COMMAND]`
|
|
127
152
|
|
|
@@ -129,244 +154,92 @@ display help for oclif
|
|
|
129
154
|
|
|
130
155
|
```
|
|
131
156
|
USAGE
|
|
132
|
-
$ oclif help [COMMAND]
|
|
157
|
+
$ oclif help [COMMAND]
|
|
133
158
|
|
|
134
159
|
ARGUMENTS
|
|
135
160
|
COMMAND command to show help for
|
|
136
161
|
|
|
137
|
-
|
|
162
|
+
OPTIONS
|
|
138
163
|
--all see all commands in CLI
|
|
139
|
-
|
|
140
|
-
DESCRIPTION
|
|
141
|
-
display help for oclif
|
|
142
164
|
```
|
|
143
165
|
|
|
144
|
-
_See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v3.2.
|
|
166
|
+
_See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v3.2.9/src/commands/help.ts)_
|
|
145
167
|
|
|
146
|
-
## `oclif
|
|
168
|
+
## `oclif hook NAME`
|
|
147
169
|
|
|
148
|
-
|
|
170
|
+
add a hook to an existing CLI or plugin
|
|
149
171
|
|
|
150
172
|
```
|
|
151
173
|
USAGE
|
|
152
|
-
$ oclif
|
|
174
|
+
$ oclif hook NAME
|
|
153
175
|
|
|
154
176
|
ARGUMENTS
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
DESCRIPTION
|
|
158
|
-
generates plugin manifest json
|
|
159
|
-
```
|
|
160
|
-
|
|
161
|
-
_See code: [src/commands/manifest.ts](https://github.com/oclif/oclif/blob/v2.0.0-main.9/src/commands/manifest.ts)_
|
|
162
|
-
|
|
163
|
-
## `oclif pack:deb`
|
|
164
|
-
|
|
165
|
-
pack CLI into debian package
|
|
166
|
-
|
|
167
|
-
```
|
|
168
|
-
USAGE
|
|
169
|
-
$ oclif pack:deb -r <value>
|
|
170
|
-
|
|
171
|
-
FLAGS
|
|
172
|
-
-r, --root=<value> (required) [default: .] path to oclif CLI root
|
|
173
|
-
|
|
174
|
-
DESCRIPTION
|
|
175
|
-
pack CLI into debian package
|
|
176
|
-
```
|
|
177
|
-
|
|
178
|
-
_See code: [src/commands/pack/deb.ts](https://github.com/oclif/oclif/blob/v2.0.0-main.9/src/commands/pack/deb.ts)_
|
|
179
|
-
|
|
180
|
-
## `oclif pack:macos`
|
|
181
|
-
|
|
182
|
-
pack CLI into macOS .pkg
|
|
183
|
-
|
|
184
|
-
```
|
|
185
|
-
USAGE
|
|
186
|
-
$ oclif pack:macos -r <value>
|
|
187
|
-
|
|
188
|
-
FLAGS
|
|
189
|
-
-r, --root=<value> (required) [default: .] path to oclif CLI root
|
|
190
|
-
|
|
191
|
-
DESCRIPTION
|
|
192
|
-
pack CLI into macOS .pkg
|
|
193
|
-
```
|
|
194
|
-
|
|
195
|
-
_See code: [src/commands/pack/macos.ts](https://github.com/oclif/oclif/blob/v2.0.0-main.9/src/commands/pack/macos.ts)_
|
|
196
|
-
|
|
197
|
-
## `oclif pack:tarballs`
|
|
198
|
-
|
|
199
|
-
packages oclif CLI into tarballs
|
|
200
|
-
|
|
201
|
-
```
|
|
202
|
-
USAGE
|
|
203
|
-
$ oclif pack:tarballs -r <value> [-t <value>] [--xz]
|
|
204
|
-
|
|
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] comma-separated targets to pack
|
|
208
|
-
(e.g.: linux-arm,win32-x64)
|
|
209
|
-
--[no-]xz also build xz
|
|
210
|
-
|
|
211
|
-
DESCRIPTION
|
|
212
|
-
packages oclif CLI into tarballs
|
|
177
|
+
NAME name of hook (snake_case)
|
|
213
178
|
|
|
214
|
-
|
|
179
|
+
OPTIONS
|
|
180
|
+
--defaults use defaults for every setting
|
|
181
|
+
--event=event [default: init] event to run hook on
|
|
182
|
+
--force overwrite existing files
|
|
215
183
|
```
|
|
216
184
|
|
|
217
|
-
_See code: [src/commands/
|
|
185
|
+
_See code: [src/commands/hook.ts](https://github.com/oclif/oclif/blob/v1.18.1/src/commands/hook.ts)_
|
|
218
186
|
|
|
219
|
-
## `oclif
|
|
187
|
+
## `oclif multi [PATH]`
|
|
220
188
|
|
|
221
|
-
|
|
189
|
+
generate a new multi-command CLI
|
|
222
190
|
|
|
223
191
|
```
|
|
224
192
|
USAGE
|
|
225
|
-
$ oclif
|
|
193
|
+
$ oclif multi [PATH]
|
|
226
194
|
|
|
227
|
-
|
|
228
|
-
|
|
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.0-main.9/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] comma-separated targets to
|
|
254
|
-
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.0-main.9/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.0-main.9/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.0-main.9/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
|
|
195
|
+
ARGUMENTS
|
|
196
|
+
PATH path to project, defaults to current directory
|
|
325
197
|
|
|
326
|
-
|
|
327
|
-
|
|
198
|
+
OPTIONS
|
|
199
|
+
--defaults use defaults for every setting
|
|
200
|
+
--force overwrite existing files
|
|
201
|
+
--options=options (yarn|typescript|eslint|mocha)
|
|
328
202
|
```
|
|
329
203
|
|
|
330
|
-
_See code: [src/commands/
|
|
204
|
+
_See code: [src/commands/multi.ts](https://github.com/oclif/oclif/blob/v1.18.1/src/commands/multi.ts)_
|
|
331
205
|
|
|
332
|
-
## `oclif
|
|
206
|
+
## `oclif plugin [PATH]`
|
|
333
207
|
|
|
334
|
-
|
|
208
|
+
create a new CLI plugin
|
|
335
209
|
|
|
336
210
|
```
|
|
337
211
|
USAGE
|
|
338
|
-
$ oclif
|
|
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] comma-separated targets to upload
|
|
343
|
-
(e.g.: linux-arm,win32-x64)
|
|
344
|
-
--[no-]xz also upload xz
|
|
212
|
+
$ oclif plugin [PATH]
|
|
345
213
|
|
|
346
|
-
|
|
347
|
-
|
|
214
|
+
ARGUMENTS
|
|
215
|
+
PATH path to project, defaults to current directory
|
|
348
216
|
|
|
349
|
-
|
|
217
|
+
OPTIONS
|
|
218
|
+
--defaults use defaults for every setting
|
|
219
|
+
--force overwrite existing files
|
|
220
|
+
--options=options (yarn|typescript|eslint|mocha)
|
|
350
221
|
```
|
|
351
222
|
|
|
352
|
-
_See code: [src/commands/
|
|
223
|
+
_See code: [src/commands/plugin.ts](https://github.com/oclif/oclif/blob/v1.18.1/src/commands/plugin.ts)_
|
|
353
224
|
|
|
354
|
-
## `oclif
|
|
225
|
+
## `oclif single [PATH]`
|
|
355
226
|
|
|
356
|
-
|
|
227
|
+
generate a new single-command CLI
|
|
357
228
|
|
|
358
229
|
```
|
|
359
230
|
USAGE
|
|
360
|
-
$ oclif
|
|
231
|
+
$ oclif single [PATH]
|
|
361
232
|
|
|
362
|
-
|
|
363
|
-
|
|
233
|
+
ARGUMENTS
|
|
234
|
+
PATH path to project, defaults to current directory
|
|
364
235
|
|
|
365
|
-
|
|
366
|
-
|
|
236
|
+
OPTIONS
|
|
237
|
+
--defaults use defaults for every setting
|
|
238
|
+
--force overwrite existing files
|
|
239
|
+
--options=options (yarn|typescript|eslint|mocha)
|
|
367
240
|
```
|
|
368
241
|
|
|
369
|
-
_See code: [src/commands/
|
|
242
|
+
_See code: [src/commands/single.ts](https://github.com/oclif/oclif/blob/v1.18.1/src/commands/single.ts)_
|
|
370
243
|
<!-- commandsstop -->
|
|
371
244
|
|
|
372
245
|
# 🏭 Related Repositories
|
package/bin/run
CHANGED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { flags } from '@oclif/command';
|
|
2
|
+
import Base from './command-base';
|
|
3
|
+
export default abstract class AppCommand extends Base {
|
|
4
|
+
static flags: flags.Input<any>;
|
|
5
|
+
static args: {
|
|
6
|
+
name: string;
|
|
7
|
+
required: boolean;
|
|
8
|
+
description: string;
|
|
9
|
+
}[];
|
|
10
|
+
abstract type: string;
|
|
11
|
+
run(): Promise<void>;
|
|
12
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const command_1 = require("@oclif/command");
|
|
4
|
+
const command_base_1 = require("./command-base");
|
|
5
|
+
class AppCommand extends command_base_1.default {
|
|
6
|
+
async run() {
|
|
7
|
+
const { flags, args } = this.parse(AppCommand);
|
|
8
|
+
const options = flags.options ? flags.options.split(',') : [];
|
|
9
|
+
await super.generate('app', {
|
|
10
|
+
type: this.type,
|
|
11
|
+
path: args.path,
|
|
12
|
+
options,
|
|
13
|
+
defaults: flags.defaults,
|
|
14
|
+
force: flags.force,
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
exports.default = AppCommand;
|
|
19
|
+
AppCommand.flags = {
|
|
20
|
+
defaults: command_1.flags.boolean({ description: 'use defaults for every setting' }),
|
|
21
|
+
options: command_1.flags.string({ description: '(yarn|typescript|eslint|mocha)' }),
|
|
22
|
+
force: command_1.flags.boolean({ description: 'overwrite existing files' }),
|
|
23
|
+
};
|
|
24
|
+
AppCommand.args = [
|
|
25
|
+
{ name: 'path', required: false, description: 'path to project, defaults to current directory' },
|
|
26
|
+
];
|
package/lib/aws.d.ts
CHANGED
|
@@ -11,13 +11,13 @@ export declare namespace upload {
|
|
|
11
11
|
}
|
|
12
12
|
declare const _default: {
|
|
13
13
|
readonly cloudfront: {
|
|
14
|
-
createCloudfrontInvalidation: (options: CloudFront.
|
|
14
|
+
createCloudfrontInvalidation: (options: CloudFront.CreateInvalidationRequest) => Promise<unknown>;
|
|
15
15
|
};
|
|
16
16
|
readonly s3: {
|
|
17
|
-
uploadFile: (local: string, options: S3.
|
|
18
|
-
headObject: (options: S3.
|
|
19
|
-
copyObject: (options: S3.
|
|
20
|
-
getObject: (options: S3.
|
|
17
|
+
uploadFile: (local: string, options: S3.PutObjectRequest) => Promise<unknown>;
|
|
18
|
+
headObject: (options: S3.HeadObjectRequest) => Promise<S3.HeadObjectOutput>;
|
|
19
|
+
copyObject: (options: S3.CopyObjectRequest) => Promise<unknown>;
|
|
20
|
+
getObject: (options: S3.GetObjectRequest) => Promise<S3.GetObjectOutput>;
|
|
21
21
|
};
|
|
22
22
|
};
|
|
23
23
|
export default _default;
|