1 | <img src="https://user-images.githubusercontent.com/449385/38243295-e0a47d58-372e-11e8-9bc0-8c02a6f4d2ac.png" width="260" height="73">
|
2 |
|
3 | # `oclif` CLI
|
4 |
|
5 | [![Version](https://img.shields.io/npm/v/oclif.svg)](https://npmjs.org/package/oclif)
|
6 | [![Downloads/week](https://img.shields.io/npm/dw/oclif.svg)](https://npmjs.org/package/oclif/oclif)
|
7 | [![License](https://img.shields.io/npm/l/oclif.svg)](https://github.com/oclif/oclif/blob/main/package.json)
|
8 |
|
9 |
|
10 |
|
11 | - [`oclif` CLI](#oclif-cli)
|
12 | - [🗒 Description](#-description)
|
13 | - [🚀 Getting Started Tutorial](#-getting-started-tutorial)
|
14 | - [📌 Requirements](#-requirements)
|
15 | - [📌 Migrating from V1](#-migrating-from-v1)
|
16 | - [🏗 Usage](#-usage)
|
17 | - [📚 Examples](#-examples)
|
18 | - [🔨 Commands](#-commands)
|
19 | - [Command Topics](#command-topics)
|
20 | - [🚀 Contributing](#-contributing)
|
21 | - [🏭 Related Repositories](#-related-repositories)
|
22 | - [🦔 Learn More](#-learn-more)
|
23 |
|
24 |
|
25 | # 🗒 Description
|
26 |
|
27 | This is the `oclif` CLI for the [Open CLI Framework](https://github.com/oclif/core), that supports the development of oclif plugins and CLIs.
|
28 |
|
29 | [See the docs for more information](http://oclif.io).
|
30 |
|
31 | # 🚀 Getting Started Tutorial
|
32 |
|
33 | The [Getting Started tutorial](http://oclif.io/docs/introduction) is a step-by-step guide to introduce you to oclif. If you have not developed anything in a command line before, this tutorial is a great place to get started.
|
34 |
|
35 | See [Usage](#-usage) below for an overview of the `oclif` CLI.
|
36 |
|
37 | # 📌 Requirements
|
38 |
|
39 | Currently, Node 18+ 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.
|
40 |
|
41 | # 📌 Migrating from V1
|
42 |
|
43 | If you have been using version 1 of the [`oclif` CLI](https://github.com/oclif/oclif/tree/v1.18.4) there are some important differences to note when using the latest version.
|
44 |
|
45 | ## Breaking Changes
|
46 |
|
47 | - `oclif multi`, `oclif plugin`, and `oclif single` have all been removed in favor of `oclif generate`, which generates an oclif based CLI using the [hello-world example repo](https://github.com/oclif/hello-world).
|
48 | - The reason is that there's not enough of a meaningful difference between a "multi command cli", a "single command cli", and a "plugin" to justify the maintenance cost. The generated CLI can be easily used for any of those use cases.
|
49 | - `oclif hook` is now `oclif generate:hook`
|
50 | - `oclif command` is now `oclif generate:command`
|
51 |
|
52 | ## New Commands
|
53 |
|
54 | Version 2 now includes all the commands from the [`oclif-dev` CLI](https://github.com/oclif/dev-cli). This means that you can now use a single CLI for all your oclif needs. These commands include:
|
55 |
|
56 | - `oclif manifest`
|
57 | - `oclif pack`
|
58 | - `oclif pack:deb`
|
59 | - `oclif pack:macos`
|
60 | - `oclif pack:win`
|
61 | - `oclif upload` (formerly known as `oclif-dev publish`)
|
62 | - `oclif upload:deb` (formerly known as `oclif-dev publish:deb`)
|
63 | - `oclif upload:macos` (formerly known as `oclif-dev publish:macos`)
|
64 | - `oclif upload:win` (formerly known as `oclif-dev publish:win`)
|
65 | - `oclif readme`
|
66 |
|
67 | # 🏗 Usage
|
68 |
|
69 | Creating a CLI:
|
70 |
|
71 | ```sh-session
|
72 | $ npx oclif generate mynewcli
|
73 | ? npm package name (mynewcli): mynewcli
|
74 | $ cd mynewcli
|
75 | $ ./bin/run.js --version
|
76 | mynewcli/0.0.0 darwin-x64 node-v9.5.0
|
77 | $ ./bin/run.js --help
|
78 | USAGE
|
79 | $ mynewcli [COMMAND]
|
80 |
|
81 | COMMANDS
|
82 | hello
|
83 | help display help for mynewcli
|
84 |
|
85 | $ ./bin/run.js hello world
|
86 | hello world! (./src/commands/hello/world.ts)
|
87 | ```
|
88 |
|
89 | # 📚 Examples
|
90 |
|
91 | - [Hello-World](https://github.com/oclif/hello-world)
|
92 | - [Salesforce CLI](https://github.com/salesforcecli/cli)
|
93 | - [Heroku CLI](https://github.com/heroku/cli)
|
94 |
|
95 | # 🔨 Commands
|
96 |
|
97 |
|
98 |
|
99 | # Command Topics
|
100 |
|
101 | - [`oclif generate`](docs/generate.md) - Generate a new CLI
|
102 | - [`oclif help`](docs/help.md) - Display help for oclif.
|
103 | - [`oclif init`](docs/init.md) - Initialize a new oclif CLI
|
104 | - [`oclif manifest`](docs/manifest.md) - Generates plugin manifest json (oclif.manifest.json).
|
105 | - [`oclif pack`](docs/pack.md) - Package an oclif CLI into installable artifacts.
|
106 | - [`oclif promote`](docs/promote.md) - Promote CLI builds to a S3 release channel.
|
107 | - [`oclif readme`](docs/readme.md) - Adds commands to README.md in current directory.
|
108 | - [`oclif upload`](docs/upload.md) - Upload installable CLI artifacts to AWS S3.
|
109 |
|
110 |
|
111 |
|
112 | # 🚀 Contributing
|
113 |
|
114 | See the [contributing guide](./CONRTIBUTING.md).
|
115 |
|
116 | # 🏭 Related Repositories
|
117 |
|
118 | - [@oclif/core](https://github.com/oclif/core) - Base library for oclif. This can be used directly without the generator.
|
119 | - [@oclif/test](https://github.com/oclif/test) - Test helper for oclif.
|
120 |
|
121 | # 🦔 Learn More
|
122 |
|
123 | - [Salesforce Release Announcement](https://engineering.salesforce.com/open-sourcing-oclif-the-cli-framework-that-powers-our-clis-21fbda99d33a)
|
124 | - [Heroku Release Announcement](https://blog.heroku.com/open-cli-framework)
|