From 5f337c86eba5270e31b44063e7c076d85ec0e8ed Mon Sep 17 00:00:00 2001 From: svc-cli-bot Date: Fri, 20 Dec 2024 19:14:31 +0000 Subject: [PATCH] Deploy website - based on 9e18787436a12bb7e85a458935cac0736a397f79 --- 404.html | 4 ++-- assets/js/{03a88bad.1409c117.js => 03a88bad.b6497215.js} | 2 +- assets/js/{03abeb31.62d84560.js => 03abeb31.72407742.js} | 2 +- assets/js/{0b218a01.ccfd0325.js => 0b218a01.9a52c25a.js} | 2 +- assets/js/{104cbb75.6ebad801.js => 104cbb75.a0b20b5c.js} | 2 +- assets/js/{19fd9079.d25f483e.js => 19fd9079.cddfda6f.js} | 2 +- assets/js/{1ed4142b.d388a56e.js => 1ed4142b.fe950661.js} | 2 +- assets/js/{1f61ef73.b441af12.js => 1f61ef73.d2cfd7fa.js} | 2 +- assets/js/{258a6413.6a23fa58.js => 258a6413.ffac7b9c.js} | 2 +- assets/js/{2a33acc4.63051787.js => 2a33acc4.d849c894.js} | 2 +- assets/js/{2f98ad87.8e5de7f0.js => 2f98ad87.9f0f1dd8.js} | 2 +- assets/js/{3042343a.90c0888a.js => 3042343a.d8b44873.js} | 2 +- assets/js/{30d74566.bd59d587.js => 30d74566.090b833e.js} | 2 +- assets/js/{35586d92.e0ce3e42.js => 35586d92.ad3cf996.js} | 2 +- assets/js/{3e452c7e.339cc754.js => 3e452c7e.8d65eea6.js} | 2 +- assets/js/{53e18611.30841dde.js => 53e18611.9984531f.js} | 2 +- assets/js/{5d5620c4.0e53cd74.js => 5d5620c4.67662258.js} | 2 +- assets/js/{6f3bb722.93f755f4.js => 6f3bb722.0809deda.js} | 2 +- assets/js/{713bb917.7d6cb090.js => 713bb917.c49cdaeb.js} | 2 +- assets/js/{82247a8b.48e24b1f.js => 82247a8b.62cfedd4.js} | 2 +- assets/js/{8705a681.fc23df0d.js => 8705a681.a1c95a0d.js} | 2 +- assets/js/{934303c1.e7c76cdf.js => 934303c1.31f3df98.js} | 2 +- assets/js/{935116ff.4a873b57.js => 935116ff.0b85ec73.js} | 2 +- assets/js/{9eaa546a.c6b771b1.js => 9eaa546a.892f79ee.js} | 2 +- assets/js/{af447295.b19a05e0.js => af447295.34ebad31.js} | 2 +- assets/js/{b3cc73c6.09cd525d.js => b3cc73c6.f8d02f10.js} | 2 +- assets/js/{b4a95747.cb28d04b.js => b4a95747.c1483d21.js} | 2 +- assets/js/{b93366a4.e4e9e390.js => b93366a4.3aeccdcd.js} | 2 +- assets/js/{c5890d18.eb4c0d8e.js => c5890d18.8cc455d9.js} | 2 +- assets/js/{c81fd975.0d5dbed9.js => c81fd975.3249c5ef.js} | 2 +- assets/js/{c94a68c1.fffe9ebd.js => c94a68c1.581b3534.js} | 2 +- assets/js/{cfacefa6.e95d928c.js => cfacefa6.10da6446.js} | 2 +- assets/js/{d0e73d62.2ee035a2.js => d0e73d62.1141c96d.js} | 2 +- assets/js/{d3c152a7.4871f374.js => d3c152a7.7905bf0e.js} | 2 +- assets/js/{d665a578.73b0b4f5.js => d665a578.88515b84.js} | 2 +- assets/js/{d9b0bdb4.65c1f078.js => d9b0bdb4.5f0ba31e.js} | 2 +- assets/js/{df1cd967.f6197671.js => df1cd967.a2dd420b.js} | 2 +- assets/js/{e360e27f.4ac99709.js => e360e27f.5019fa28.js} | 2 +- assets/js/{e3703649.56eda24d.js => e3703649.1695789d.js} | 2 +- assets/js/{e96c62ed.e173eafb.js => e96c62ed.c1eb87a4.js} | 2 +- assets/js/{f182954c.d2130dd2.js => f182954c.7889530d.js} | 2 +- assets/js/f6c5328e.aff8679f.js | 1 - assets/js/f6c5328e.bb748c78.js | 1 + assets/js/{f905d0fe.8d71a118.js => f905d0fe.b6cba36d.js} | 2 +- assets/js/{main.801dca18.js => main.d86acc2c.js} | 4 ++-- ...dca18.js.LICENSE.txt => main.d86acc2c.js.LICENSE.txt} | 0 ...runtime~main.d70e62bc.js => runtime~main.3bd916dd.js} | 2 +- blog/2018/03/20/introducing-oclif/index.html | 4 ++-- blog/2019/02/20/cli-flags-explained/index.html | 4 ++-- blog/2019/09/16/oclifconf-recap/index.html | 4 ++-- blog/2019/10/31/oclif-node-updates/index.html | 4 ++-- blog/2019/12/05/oclif-eslint-migration/index.html | 4 ++-- .../05/05/introducing-custom-help-classes/index.html | 4 ++-- blog/2020/07/01/pretty-printable-errors/index.html | 4 ++-- blog/2020/08/26/summer-update/index.html | 4 ++-- blog/2021/03/01/introducing-oclif-core/index.html | 4 ++-- blog/2022/01/12/announcing-oclif-v2/index.html | 4 ++-- blog/2024/03/29/spring-update/index.html | 4 ++-- blog/2024/04/10/oclif-init/index.html | 4 ++-- blog/archive/index.html | 4 ++-- blog/index.html | 4 ++-- blog/page/2/index.html | 4 ++-- docs/aliases/index.html | 6 +++--- docs/api_reference/index.html | 4 ++-- docs/args/index.html | 6 +++--- docs/base_class/index.html | 6 +++--- docs/command_discovery_strategies/index.html | 6 +++--- docs/command_execution/index.html | 6 +++--- docs/commands/index.html | 6 +++--- docs/config/index.html | 6 +++--- docs/configuring_your_cli/index.html | 6 +++--- docs/debugging/index.html | 6 +++--- docs/error_handling/index.html | 6 +++--- docs/esm/index.html | 6 +++--- docs/examples/index.html | 6 +++--- docs/external_links/index.html | 6 +++--- docs/faqs/index.html | 6 +++--- docs/features/index.html | 6 +++--- docs/feedback/index.html | 6 +++--- docs/flag_inheritance/index.html | 6 +++--- docs/flags/index.html | 6 +++--- docs/flexible_taxonomy/index.html | 6 +++--- docs/generator_commands/index.html | 6 +++--- docs/guides/index.html | 4 ++-- docs/help_classes/index.html | 6 +++--- docs/hooks/index.html | 9 +++++---- docs/how_we_work/index.html | 6 +++--- docs/index.html | 6 +++--- docs/introduction/index.html | 6 +++--- docs/jit_plugins/index.html | 6 +++--- docs/json/index.html | 6 +++--- docs/logging/index.html | 6 +++--- docs/nsis-installer_customization/index.html | 6 +++--- docs/performance/index.html | 6 +++--- docs/plugin_loading/index.html | 6 +++--- docs/plugins/index.html | 6 +++--- docs/related_repos/index.html | 6 +++--- docs/releasing/index.html | 6 +++--- docs/running_programmatically/index.html | 6 +++--- docs/single_command_cli/index.html | 6 +++--- docs/templates/index.html | 6 +++--- docs/testing/index.html | 6 +++--- docs/themes/index.html | 6 +++--- docs/topic_separator/index.html | 6 +++--- docs/topics/index.html | 6 +++--- docs/user_experience/index.html | 6 +++--- index.html | 4 ++-- search/index.html | 4 ++-- 108 files changed, 213 insertions(+), 212 deletions(-) rename assets/js/{03a88bad.1409c117.js => 03a88bad.b6497215.js} (94%) rename assets/js/{03abeb31.62d84560.js => 03abeb31.72407742.js} (97%) rename assets/js/{0b218a01.ccfd0325.js => 0b218a01.9a52c25a.js} (98%) rename assets/js/{104cbb75.6ebad801.js => 104cbb75.a0b20b5c.js} (98%) rename assets/js/{19fd9079.d25f483e.js => 19fd9079.cddfda6f.js} (96%) rename assets/js/{1ed4142b.d388a56e.js => 1ed4142b.fe950661.js} (98%) rename assets/js/{1f61ef73.b441af12.js => 1f61ef73.d2cfd7fa.js} (98%) rename assets/js/{258a6413.6a23fa58.js => 258a6413.ffac7b9c.js} (97%) rename assets/js/{2a33acc4.63051787.js => 2a33acc4.d849c894.js} (97%) rename assets/js/{2f98ad87.8e5de7f0.js => 2f98ad87.9f0f1dd8.js} (99%) rename assets/js/{3042343a.90c0888a.js => 3042343a.d8b44873.js} (99%) rename assets/js/{30d74566.bd59d587.js => 30d74566.090b833e.js} (99%) rename assets/js/{35586d92.e0ce3e42.js => 35586d92.ad3cf996.js} (98%) rename assets/js/{3e452c7e.339cc754.js => 3e452c7e.8d65eea6.js} (98%) rename assets/js/{53e18611.30841dde.js => 53e18611.9984531f.js} (99%) rename assets/js/{5d5620c4.0e53cd74.js => 5d5620c4.67662258.js} (99%) rename assets/js/{6f3bb722.93f755f4.js => 6f3bb722.0809deda.js} (99%) rename assets/js/{713bb917.7d6cb090.js => 713bb917.c49cdaeb.js} (99%) rename assets/js/{82247a8b.48e24b1f.js => 82247a8b.62cfedd4.js} (99%) rename assets/js/{8705a681.fc23df0d.js => 8705a681.a1c95a0d.js} (98%) rename assets/js/{934303c1.e7c76cdf.js => 934303c1.31f3df98.js} (98%) rename assets/js/{935116ff.4a873b57.js => 935116ff.0b85ec73.js} (99%) rename assets/js/{9eaa546a.c6b771b1.js => 9eaa546a.892f79ee.js} (99%) rename assets/js/{af447295.b19a05e0.js => af447295.34ebad31.js} (99%) rename assets/js/{b3cc73c6.09cd525d.js => b3cc73c6.f8d02f10.js} (98%) rename assets/js/{b4a95747.cb28d04b.js => b4a95747.c1483d21.js} (97%) rename assets/js/{b93366a4.e4e9e390.js => b93366a4.3aeccdcd.js} (98%) rename assets/js/{c5890d18.eb4c0d8e.js => c5890d18.8cc455d9.js} (99%) rename assets/js/{c81fd975.0d5dbed9.js => c81fd975.3249c5ef.js} (98%) rename assets/js/{c94a68c1.fffe9ebd.js => c94a68c1.581b3534.js} (98%) rename assets/js/{cfacefa6.e95d928c.js => cfacefa6.10da6446.js} (99%) rename assets/js/{d0e73d62.2ee035a2.js => d0e73d62.1141c96d.js} (97%) rename assets/js/{d3c152a7.4871f374.js => d3c152a7.7905bf0e.js} (98%) rename assets/js/{d665a578.73b0b4f5.js => d665a578.88515b84.js} (97%) rename assets/js/{d9b0bdb4.65c1f078.js => d9b0bdb4.5f0ba31e.js} (96%) rename assets/js/{df1cd967.f6197671.js => df1cd967.a2dd420b.js} (97%) rename assets/js/{e360e27f.4ac99709.js => e360e27f.5019fa28.js} (98%) rename assets/js/{e3703649.56eda24d.js => e3703649.1695789d.js} (99%) rename assets/js/{e96c62ed.e173eafb.js => e96c62ed.c1eb87a4.js} (99%) rename assets/js/{f182954c.d2130dd2.js => f182954c.7889530d.js} (97%) delete mode 100644 assets/js/f6c5328e.aff8679f.js create mode 100644 assets/js/f6c5328e.bb748c78.js rename assets/js/{f905d0fe.8d71a118.js => f905d0fe.b6cba36d.js} (96%) rename assets/js/{main.801dca18.js => main.d86acc2c.js} (98%) rename assets/js/{main.801dca18.js.LICENSE.txt => main.d86acc2c.js.LICENSE.txt} (100%) rename assets/js/{runtime~main.d70e62bc.js => runtime~main.3bd916dd.js} (50%) diff --git a/404.html b/404.html index 53be71b5..836df659 100644 --- a/404.html +++ b/404.html @@ -12,8 +12,8 @@ - - + +
Skip to main content

Page Not Found

We could not find what you were looking for.

Please contact the owner of the site that linked you to the original URL and let them know their link is broken.

diff --git a/assets/js/03a88bad.1409c117.js b/assets/js/03a88bad.b6497215.js similarity index 94% rename from assets/js/03a88bad.1409c117.js rename to assets/js/03a88bad.b6497215.js index 1043e0a3..94f5bf9c 100644 --- a/assets/js/03a88bad.1409c117.js +++ b/assets/js/03a88bad.b6497215.js @@ -1 +1 @@ -"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[8078],{9165:(t,e,n)=>{n.r(e),n.d(e,{assets:()=>d,contentTitle:()=>c,default:()=>l,frontMatter:()=>s,metadata:()=>i,toc:()=>u});var o=n(4848),r=n(8453);const s={},c=void 0,i={id:"index",title:"index",description:"",source:"@site/../docs/index.md",sourceDirName:".",slug:"/",permalink:"/docs/",draft:!1,unlisted:!1,editUrl:"https://github.com/oclif/oclif.github.io/tree/docs/docs/../docs/index.md",tags:[],version:"current",lastUpdatedBy:"Mike Donnalley",lastUpdatedAt:1734361515e3,frontMatter:{}},d={},u=[];function a(t){return(0,o.jsx)("meta",{"http-equiv":"refresh",content:"0; url=https://oclif.io/docs/introduction.html"})}function l(t={}){const{wrapper:e}={...(0,r.R)(),...t.components};return e?(0,o.jsx)(e,{...t,children:(0,o.jsx)(a,{...t})}):a()}},8453:(t,e,n)=>{n.d(e,{R:()=>c,x:()=>i});var o=n(6540);const r={},s=o.createContext(r);function c(t){const e=o.useContext(s);return o.useMemo((function(){return"function"==typeof t?t(e):{...e,...t}}),[e,t])}function i(t){let e;return e=t.disableParentContext?"function"==typeof t.components?t.components(r):t.components||r:c(t.components),o.createElement(s.Provider,{value:e},t.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[8078],{9165:(t,e,n)=>{n.r(e),n.d(e,{assets:()=>d,contentTitle:()=>c,default:()=>l,frontMatter:()=>s,metadata:()=>i,toc:()=>u});var o=n(4848),r=n(8453);const s={},c=void 0,i={id:"index",title:"index",description:"",source:"@site/../docs/index.md",sourceDirName:".",slug:"/",permalink:"/docs/",draft:!1,unlisted:!1,editUrl:"https://github.com/oclif/oclif.github.io/tree/docs/docs/../docs/index.md",tags:[],version:"current",lastUpdatedBy:"Mike Donnalley",lastUpdatedAt:1734722012e3,frontMatter:{}},d={},u=[];function a(t){return(0,o.jsx)("meta",{"http-equiv":"refresh",content:"0; url=https://oclif.io/docs/introduction.html"})}function l(t={}){const{wrapper:e}={...(0,r.R)(),...t.components};return e?(0,o.jsx)(e,{...t,children:(0,o.jsx)(a,{...t})}):a()}},8453:(t,e,n)=>{n.d(e,{R:()=>c,x:()=>i});var o=n(6540);const r={},s=o.createContext(r);function c(t){const e=o.useContext(s);return o.useMemo((function(){return"function"==typeof t?t(e):{...e,...t}}),[e,t])}function i(t){let e;return e=t.disableParentContext?"function"==typeof t.components?t.components(r):t.components||r:c(t.components),o.createElement(s.Provider,{value:e},t.children)}}}]); \ No newline at end of file diff --git a/assets/js/03abeb31.62d84560.js b/assets/js/03abeb31.72407742.js similarity index 97% rename from assets/js/03abeb31.62d84560.js rename to assets/js/03abeb31.72407742.js index 4db48adc..3e1f5191 100644 --- a/assets/js/03abeb31.62d84560.js +++ b/assets/js/03abeb31.72407742.js @@ -1 +1 @@ -"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[844],{2433:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>d,contentTitle:()=>r,default:()=>l,frontMatter:()=>s,metadata:()=>c,toc:()=>u});var o=t(4848),i=t(8453);const s={title:"Debugging",description:"How to access debug logs"},r=void 0,c={id:"debugging",title:"Debugging",description:"How to access debug logs",source:"@site/../docs/debugging.md",sourceDirName:".",slug:"/debugging",permalink:"/docs/debugging",draft:!1,unlisted:!1,editUrl:"https://github.com/oclif/oclif.github.io/tree/docs/docs/../docs/debugging.md",tags:[],version:"current",lastUpdatedBy:"Mike Donnalley",lastUpdatedAt:1734361515e3,frontMatter:{title:"Debugging",description:"How to access debug logs"},sidebar:"docs",previous:{title:"Configuring Your CLI",permalink:"/docs/configuring_your_cli"},next:{title:"Error Handling",permalink:"/docs/error_handling"}},d={},u=[];function g(e){const n={a:"a",code:"code",img:"img",p:"p",...(0,i.R)(),...e.components};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)(n.p,{children:["Use the ",(0,o.jsx)(n.a,{href:"https://github.com/visionmedia/debug",children:"debug"})," for debugging. The CLI uses this module for all of its debugging. If you set the environment variable ",(0,o.jsx)(n.code,{children:"DEBUG=*"})," it will print all the debug output to the screen."]}),"\n",(0,o.jsxs)(n.p,{children:["Depending on your shell you may need to escape this with ",(0,o.jsx)(n.code,{children:"DEBUG=\\*"}),". On Windows you can't set environment variables in line, so you'll need to run ",(0,o.jsx)(n.code,{children:"set DEBUG=*"})," before running the command."]}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.img,{alt:"debug demo",src:t(1466).A+"",width:"2658",height:"1250"})})]})}function l(e={}){const{wrapper:n}={...(0,i.R)(),...e.components};return n?(0,o.jsx)(n,{...e,children:(0,o.jsx)(g,{...e})}):g(e)}},1466:(e,n,t)=>{t.d(n,{A:()=>o});const o=t.p+"assets/images/debug_demo-efc07abda59d2b82da3fc695b96596c8.png"},8453:(e,n,t)=>{t.d(n,{R:()=>r,x:()=>c});var o=t(6540);const i={},s=o.createContext(i);function r(e){const n=o.useContext(s);return o.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function c(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:r(e.components),o.createElement(s.Provider,{value:n},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[844],{2433:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>d,contentTitle:()=>r,default:()=>l,frontMatter:()=>s,metadata:()=>c,toc:()=>u});var o=t(4848),i=t(8453);const s={title:"Debugging",description:"How to access debug logs"},r=void 0,c={id:"debugging",title:"Debugging",description:"How to access debug logs",source:"@site/../docs/debugging.md",sourceDirName:".",slug:"/debugging",permalink:"/docs/debugging",draft:!1,unlisted:!1,editUrl:"https://github.com/oclif/oclif.github.io/tree/docs/docs/../docs/debugging.md",tags:[],version:"current",lastUpdatedBy:"Mike Donnalley",lastUpdatedAt:1734722012e3,frontMatter:{title:"Debugging",description:"How to access debug logs"},sidebar:"docs",previous:{title:"Configuring Your CLI",permalink:"/docs/configuring_your_cli"},next:{title:"Error Handling",permalink:"/docs/error_handling"}},d={},u=[];function g(e){const n={a:"a",code:"code",img:"img",p:"p",...(0,i.R)(),...e.components};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)(n.p,{children:["Use the ",(0,o.jsx)(n.a,{href:"https://github.com/visionmedia/debug",children:"debug"})," for debugging. The CLI uses this module for all of its debugging. If you set the environment variable ",(0,o.jsx)(n.code,{children:"DEBUG=*"})," it will print all the debug output to the screen."]}),"\n",(0,o.jsxs)(n.p,{children:["Depending on your shell you may need to escape this with ",(0,o.jsx)(n.code,{children:"DEBUG=\\*"}),". On Windows you can't set environment variables in line, so you'll need to run ",(0,o.jsx)(n.code,{children:"set DEBUG=*"})," before running the command."]}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.img,{alt:"debug demo",src:t(1466).A+"",width:"2658",height:"1250"})})]})}function l(e={}){const{wrapper:n}={...(0,i.R)(),...e.components};return n?(0,o.jsx)(n,{...e,children:(0,o.jsx)(g,{...e})}):g(e)}},1466:(e,n,t)=>{t.d(n,{A:()=>o});const o=t.p+"assets/images/debug_demo-efc07abda59d2b82da3fc695b96596c8.png"},8453:(e,n,t)=>{t.d(n,{R:()=>r,x:()=>c});var o=t(6540);const i={},s=o.createContext(i);function r(e){const n=o.useContext(s);return o.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function c(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:r(e.components),o.createElement(s.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/0b218a01.ccfd0325.js b/assets/js/0b218a01.9a52c25a.js similarity index 98% rename from assets/js/0b218a01.ccfd0325.js rename to assets/js/0b218a01.9a52c25a.js index 0b4da3cd..4fdaef5f 100644 --- a/assets/js/0b218a01.ccfd0325.js +++ b/assets/js/0b218a01.9a52c25a.js @@ -1 +1 @@ -"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[3454],{577:(e,s,n)=>{n.r(s),n.d(s,{assets:()=>c,contentTitle:()=>t,default:()=>m,frontMatter:()=>o,metadata:()=>l,toc:()=>d});var a=n(4848),i=n(8453);const o={title:"Aliases",description:"Define aliases for commands, flags, and bins"},t=void 0,l={id:"aliases",title:"Aliases",description:"Define aliases for commands, flags, and bins",source:"@site/../docs/aliases.md",sourceDirName:".",slug:"/aliases",permalink:"/docs/aliases",draft:!1,unlisted:!1,editUrl:"https://github.com/oclif/oclif.github.io/tree/docs/docs/../docs/aliases.md",tags:[],version:"current",lastUpdatedBy:"Mike Donnalley",lastUpdatedAt:1734361515e3,frontMatter:{title:"Aliases",description:"Define aliases for commands, flags, and bins"},sidebar:"docs",previous:{title:"Guides",permalink:"/docs/guides"},next:{title:"Custom Base Class",permalink:"/docs/base_class"}},c={},d=[{value:"Command Aliases",id:"command-aliases",level:2},{value:"Flag Aliases",id:"flag-aliases",level:2},{value:"Bin Aliases",id:"bin-aliases",level:2}];function r(e){const s={code:"code",h2:"h2",p:"p",pre:"pre",...(0,i.R)(),...e.components};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(s.h2,{id:"command-aliases",children:"Command Aliases"}),"\n",(0,a.jsxs)(s.p,{children:["Aliases let you define a string that maps to a command. This command can be run as ",(0,a.jsx)(s.code,{children:"mycli config"}),", ",(0,a.jsx)(s.code,{children:"mycli config:index"}),", or ",(0,a.jsx)(s.code,{children:"mycli config:list"}),":"]}),"\n",(0,a.jsx)(s.pre,{children:(0,a.jsx)(s.code,{className:"language-js",children:"import {Command, Flags} from '@oclif/core'\n\nexport class ConfigIndex extends Command {\n static aliases = ['config:index', 'config:list']\n}\n"})}),"\n",(0,a.jsxs)(s.p,{children:['By default, aliases find the "real" command and just work. If you\'re providing command aliases for backward compatibility but prefer users to use the "real" command, set ',(0,a.jsx)(s.code,{children:"deprecateAliases"})," to ",(0,a.jsx)(s.code,{children:"true"})," to warn users about the correct name"]}),"\n",(0,a.jsx)(s.pre,{children:(0,a.jsx)(s.code,{className:"language-js",children:"export class ConfigIndex extends Command {\n static aliases = ['config:index', 'config:list']\n static deprecateAliases = true\n}\n"})}),"\n",(0,a.jsx)(s.h2,{id:"flag-aliases",children:"Flag Aliases"}),"\n",(0,a.jsx)(s.p,{children:"Like command aliases, but on an individual flag. You can alias the name and short character, and optionally emit warnings when aliased names are used."}),"\n",(0,a.jsx)(s.pre,{children:(0,a.jsx)(s.code,{className:"language-js",children:"export class ConfigIndex extends Command {\n static flags = {\n 'new-name': Flags.boolean({\n char: 'c',\n aliases: ['old-name', 'o'],\n deprecateAliases: true\n })\n }\n}\n\n"})}),"\n",(0,a.jsx)(s.h2,{id:"bin-aliases",children:"Bin Aliases"}),"\n",(0,a.jsxs)(s.p,{children:['Creating a CLI that responds to different names or "aliases" is easy, simply add a ',(0,a.jsx)(s.code,{children:"binAliases"})," property to your CLI's ",(0,a.jsx)(s.code,{children:"oclif"})," property in ",(0,a.jsx)(s.code,{children:"package.json"}),":"]}),"\n",(0,a.jsx)(s.pre,{children:(0,a.jsx)(s.code,{className:"language-json",children:'{\n "name": "mycli",\n "version": "0.0.0",\n "description": "My CLI",\n "main": "bin/run.js",\n "bin": {\n "mycli": "./bin/run.js",\n "mycli-alias": "./bin/run.js"\n },\n "oclif": {\n "binAliases": ["mycli", "mycli-alias"]\n }\n}\n'})}),"\n",(0,a.jsxs)(s.p,{children:["Adding this property allows your CLI to respond to either of those names, and is used during the bundling and building process when shipping your CLI. Note that the ",(0,a.jsx)(s.code,{children:"bin"})," section was also modified to include both aliases, which is how npm creates bin aliases. To create a unified experience, regardless of the installation method, a CLI author must change both to match. Bin aliases also play nicely with ",(0,a.jsx)(s.code,{children:"@oclif/plugin-autocomplete"}),", so typing an alias and using autocomplete is the same experience as using the original name."]})]})}function m(e={}){const{wrapper:s}={...(0,i.R)(),...e.components};return s?(0,a.jsx)(s,{...e,children:(0,a.jsx)(r,{...e})}):r(e)}},8453:(e,s,n)=>{n.d(s,{R:()=>t,x:()=>l});var a=n(6540);const i={},o=a.createContext(i);function t(e){const s=a.useContext(o);return a.useMemo((function(){return"function"==typeof e?e(s):{...s,...e}}),[s,e])}function l(e){let s;return s=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:t(e.components),a.createElement(o.Provider,{value:s},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[3454],{577:(e,s,n)=>{n.r(s),n.d(s,{assets:()=>c,contentTitle:()=>t,default:()=>m,frontMatter:()=>o,metadata:()=>l,toc:()=>d});var a=n(4848),i=n(8453);const o={title:"Aliases",description:"Define aliases for commands, flags, and bins"},t=void 0,l={id:"aliases",title:"Aliases",description:"Define aliases for commands, flags, and bins",source:"@site/../docs/aliases.md",sourceDirName:".",slug:"/aliases",permalink:"/docs/aliases",draft:!1,unlisted:!1,editUrl:"https://github.com/oclif/oclif.github.io/tree/docs/docs/../docs/aliases.md",tags:[],version:"current",lastUpdatedBy:"Mike Donnalley",lastUpdatedAt:1734722012e3,frontMatter:{title:"Aliases",description:"Define aliases for commands, flags, and bins"},sidebar:"docs",previous:{title:"Guides",permalink:"/docs/guides"},next:{title:"Custom Base Class",permalink:"/docs/base_class"}},c={},d=[{value:"Command Aliases",id:"command-aliases",level:2},{value:"Flag Aliases",id:"flag-aliases",level:2},{value:"Bin Aliases",id:"bin-aliases",level:2}];function r(e){const s={code:"code",h2:"h2",p:"p",pre:"pre",...(0,i.R)(),...e.components};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(s.h2,{id:"command-aliases",children:"Command Aliases"}),"\n",(0,a.jsxs)(s.p,{children:["Aliases let you define a string that maps to a command. This command can be run as ",(0,a.jsx)(s.code,{children:"mycli config"}),", ",(0,a.jsx)(s.code,{children:"mycli config:index"}),", or ",(0,a.jsx)(s.code,{children:"mycli config:list"}),":"]}),"\n",(0,a.jsx)(s.pre,{children:(0,a.jsx)(s.code,{className:"language-js",children:"import {Command, Flags} from '@oclif/core'\n\nexport class ConfigIndex extends Command {\n static aliases = ['config:index', 'config:list']\n}\n"})}),"\n",(0,a.jsxs)(s.p,{children:['By default, aliases find the "real" command and just work. If you\'re providing command aliases for backward compatibility but prefer users to use the "real" command, set ',(0,a.jsx)(s.code,{children:"deprecateAliases"})," to ",(0,a.jsx)(s.code,{children:"true"})," to warn users about the correct name"]}),"\n",(0,a.jsx)(s.pre,{children:(0,a.jsx)(s.code,{className:"language-js",children:"export class ConfigIndex extends Command {\n static aliases = ['config:index', 'config:list']\n static deprecateAliases = true\n}\n"})}),"\n",(0,a.jsx)(s.h2,{id:"flag-aliases",children:"Flag Aliases"}),"\n",(0,a.jsx)(s.p,{children:"Like command aliases, but on an individual flag. You can alias the name and short character, and optionally emit warnings when aliased names are used."}),"\n",(0,a.jsx)(s.pre,{children:(0,a.jsx)(s.code,{className:"language-js",children:"export class ConfigIndex extends Command {\n static flags = {\n 'new-name': Flags.boolean({\n char: 'c',\n aliases: ['old-name', 'o'],\n deprecateAliases: true\n })\n }\n}\n\n"})}),"\n",(0,a.jsx)(s.h2,{id:"bin-aliases",children:"Bin Aliases"}),"\n",(0,a.jsxs)(s.p,{children:['Creating a CLI that responds to different names or "aliases" is easy, simply add a ',(0,a.jsx)(s.code,{children:"binAliases"})," property to your CLI's ",(0,a.jsx)(s.code,{children:"oclif"})," property in ",(0,a.jsx)(s.code,{children:"package.json"}),":"]}),"\n",(0,a.jsx)(s.pre,{children:(0,a.jsx)(s.code,{className:"language-json",children:'{\n "name": "mycli",\n "version": "0.0.0",\n "description": "My CLI",\n "main": "bin/run.js",\n "bin": {\n "mycli": "./bin/run.js",\n "mycli-alias": "./bin/run.js"\n },\n "oclif": {\n "binAliases": ["mycli", "mycli-alias"]\n }\n}\n'})}),"\n",(0,a.jsxs)(s.p,{children:["Adding this property allows your CLI to respond to either of those names, and is used during the bundling and building process when shipping your CLI. Note that the ",(0,a.jsx)(s.code,{children:"bin"})," section was also modified to include both aliases, which is how npm creates bin aliases. To create a unified experience, regardless of the installation method, a CLI author must change both to match. Bin aliases also play nicely with ",(0,a.jsx)(s.code,{children:"@oclif/plugin-autocomplete"}),", so typing an alias and using autocomplete is the same experience as using the original name."]})]})}function m(e={}){const{wrapper:s}={...(0,i.R)(),...e.components};return s?(0,a.jsx)(s,{...e,children:(0,a.jsx)(r,{...e})}):r(e)}},8453:(e,s,n)=>{n.d(s,{R:()=>t,x:()=>l});var a=n(6540);const i={},o=a.createContext(i);function t(e){const s=a.useContext(o);return a.useMemo((function(){return"function"==typeof e?e(s):{...s,...e}}),[s,e])}function l(e){let s;return s=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:t(e.components),a.createElement(o.Provider,{value:s},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/104cbb75.6ebad801.js b/assets/js/104cbb75.a0b20b5c.js similarity index 98% rename from assets/js/104cbb75.6ebad801.js rename to assets/js/104cbb75.a0b20b5c.js index 24677433..2814bed5 100644 --- a/assets/js/104cbb75.6ebad801.js +++ b/assets/js/104cbb75.a0b20b5c.js @@ -1 +1 @@ -"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[6471],{6798:(e,n,o)=>{o.r(n),o.d(n,{assets:()=>c,contentTitle:()=>l,default:()=>m,frontMatter:()=>s,metadata:()=>r,toc:()=>a});var t=o(4848),i=o(8453);const s={title:"Flexible Taxonomy",description:"Unlock new levels of user-friendliness"},l=void 0,r={id:"flexible_taxonomy",title:"Flexible Taxonomy",description:"Unlock new levels of user-friendliness",source:"@site/../docs/flexible_taxonomy.md",sourceDirName:".",slug:"/flexible_taxonomy",permalink:"/docs/flexible_taxonomy",draft:!1,unlisted:!1,editUrl:"https://github.com/oclif/oclif.github.io/tree/docs/docs/../docs/flexible_taxonomy.md",tags:[],version:"current",lastUpdatedBy:"Mike Donnalley",lastUpdatedAt:1734361515e3,frontMatter:{title:"Flexible Taxonomy",description:"Unlock new levels of user-friendliness"},sidebar:"docs",previous:{title:"Flag Inheritance",permalink:"/docs/flag_inheritance"},next:{title:"Just-in-Time Plugin Installation",permalink:"/docs/jit_plugins"}},c={},a=[{value:"Hook Implementation",id:"hook-implementation",level:3}];function d(e){const n={a:"a",code:"code",h3:"h3",li:"li",ol:"ol",p:"p",pre:"pre",...(0,i.R)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(n.p,{children:["If you'd like for your customers to execute commands without adhering to the defined command taxonomy, you can enable ",(0,t.jsx)(n.code,{children:"flexibleTaxonomy"})," and add a hook to the ",(0,t.jsx)(n.code,{children:"oclif"})," section of your package.json:"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-json",children:'{\n "oclif": {\n "flexibleTaxonomy": true,\n "hooks": {\n "command_incomplete": "./dist/hooks/command_incomplete.js"\n }\n }\n}\n'})}),"\n",(0,t.jsx)(n.p,{children:"There are two main benefits to enabling flexible taxonomy:"}),"\n",(0,t.jsxs)(n.ol,{children:["\n",(0,t.jsxs)(n.li,{children:["It makes your CLI more user-friendly. For example, you might have a command, ",(0,t.jsx)(n.code,{children:"my-cli foobars list"}),". If a user mistakenly enters ",(0,t.jsx)(n.code,{children:"my-cli list foobars"})," then oclif will automatically know that it should execute ",(0,t.jsx)(n.code,{children:"foobars list"})," instead of throwing an error."]}),"\n",(0,t.jsxs)(n.li,{children:["It gives you the opportunity to prompt a user for the right command if they only provide part of a command. This makes individual commands more discoverable, especially if you have a large number of commands. See ",(0,t.jsx)(n.a,{href:"#hook-implementation",children:"Hook Implementation"})," for more details."]}),"\n"]}),"\n",(0,t.jsx)(n.h3,{id:"hook-implementation",children:"Hook Implementation"}),"\n",(0,t.jsxs)(n.p,{children:["When ",(0,t.jsx)(n.code,{children:"flexibleTaxonomy"})," is enabled, oclif will run the ",(0,t.jsx)(n.code,{children:"command_incomplete"})," hook anytime a user enters an incomplete command (e.g. the command is ",(0,t.jsx)(n.code,{children:"one two three"})," but they only entered ",(0,t.jsx)(n.code,{children:"two"}),"). This hook gives you the opportunity to create an interactive user experience."]}),"\n",(0,t.jsxs)(n.p,{children:["This example shows how you can use the ",(0,t.jsx)(n.a,{href:"https://www.npmjs.com/package/inquirer",children:"inquirer"})," package to prompt the user for which command they would like to run:"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-typescript",children:"import { Hook, toConfiguredId, toStandardizedId } from '@oclif/core';\nimport { select } from '@inquirer/prompts';\n\nconst hook: Hook.CommandIncomplete = async function ({\n config,\n matches,\n argv,\n}) {\n const command = await select({\n message: 'Which of these commands would you like to run?',\n choices: matches.map((p) => toConfiguredId(p.id, config)),\n });\n\n if (argv.includes('--help') || argv.includes('-h')) {\n return config.runCommand('help', [toStandardizedId(command, config)]);\n }\n\n return config.runCommand(toStandardizedId(command, config), argv);\n};\n\nexport default hook;\n"})}),"\n",(0,t.jsx)(n.p,{children:"This is the prompt that the user would see:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{children:"$ my-cli list\n? Which of these commands did you mean (Use arrow keys)\n\u276f foobars list\n config list\n env list\n"})})]})}function m(e={}){const{wrapper:n}={...(0,i.R)(),...e.components};return n?(0,t.jsx)(n,{...e,children:(0,t.jsx)(d,{...e})}):d(e)}},8453:(e,n,o)=>{o.d(n,{R:()=>l,x:()=>r});var t=o(6540);const i={},s=t.createContext(i);function l(e){const n=t.useContext(s);return t.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function r(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:l(e.components),t.createElement(s.Provider,{value:n},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[6471],{6798:(e,n,o)=>{o.r(n),o.d(n,{assets:()=>c,contentTitle:()=>l,default:()=>m,frontMatter:()=>s,metadata:()=>r,toc:()=>a});var t=o(4848),i=o(8453);const s={title:"Flexible Taxonomy",description:"Unlock new levels of user-friendliness"},l=void 0,r={id:"flexible_taxonomy",title:"Flexible Taxonomy",description:"Unlock new levels of user-friendliness",source:"@site/../docs/flexible_taxonomy.md",sourceDirName:".",slug:"/flexible_taxonomy",permalink:"/docs/flexible_taxonomy",draft:!1,unlisted:!1,editUrl:"https://github.com/oclif/oclif.github.io/tree/docs/docs/../docs/flexible_taxonomy.md",tags:[],version:"current",lastUpdatedBy:"Mike Donnalley",lastUpdatedAt:1734722012e3,frontMatter:{title:"Flexible Taxonomy",description:"Unlock new levels of user-friendliness"},sidebar:"docs",previous:{title:"Flag Inheritance",permalink:"/docs/flag_inheritance"},next:{title:"Just-in-Time Plugin Installation",permalink:"/docs/jit_plugins"}},c={},a=[{value:"Hook Implementation",id:"hook-implementation",level:3}];function d(e){const n={a:"a",code:"code",h3:"h3",li:"li",ol:"ol",p:"p",pre:"pre",...(0,i.R)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(n.p,{children:["If you'd like for your customers to execute commands without adhering to the defined command taxonomy, you can enable ",(0,t.jsx)(n.code,{children:"flexibleTaxonomy"})," and add a hook to the ",(0,t.jsx)(n.code,{children:"oclif"})," section of your package.json:"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-json",children:'{\n "oclif": {\n "flexibleTaxonomy": true,\n "hooks": {\n "command_incomplete": "./dist/hooks/command_incomplete.js"\n }\n }\n}\n'})}),"\n",(0,t.jsx)(n.p,{children:"There are two main benefits to enabling flexible taxonomy:"}),"\n",(0,t.jsxs)(n.ol,{children:["\n",(0,t.jsxs)(n.li,{children:["It makes your CLI more user-friendly. For example, you might have a command, ",(0,t.jsx)(n.code,{children:"my-cli foobars list"}),". If a user mistakenly enters ",(0,t.jsx)(n.code,{children:"my-cli list foobars"})," then oclif will automatically know that it should execute ",(0,t.jsx)(n.code,{children:"foobars list"})," instead of throwing an error."]}),"\n",(0,t.jsxs)(n.li,{children:["It gives you the opportunity to prompt a user for the right command if they only provide part of a command. This makes individual commands more discoverable, especially if you have a large number of commands. See ",(0,t.jsx)(n.a,{href:"#hook-implementation",children:"Hook Implementation"})," for more details."]}),"\n"]}),"\n",(0,t.jsx)(n.h3,{id:"hook-implementation",children:"Hook Implementation"}),"\n",(0,t.jsxs)(n.p,{children:["When ",(0,t.jsx)(n.code,{children:"flexibleTaxonomy"})," is enabled, oclif will run the ",(0,t.jsx)(n.code,{children:"command_incomplete"})," hook anytime a user enters an incomplete command (e.g. the command is ",(0,t.jsx)(n.code,{children:"one two three"})," but they only entered ",(0,t.jsx)(n.code,{children:"two"}),"). This hook gives you the opportunity to create an interactive user experience."]}),"\n",(0,t.jsxs)(n.p,{children:["This example shows how you can use the ",(0,t.jsx)(n.a,{href:"https://www.npmjs.com/package/inquirer",children:"inquirer"})," package to prompt the user for which command they would like to run:"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-typescript",children:"import { Hook, toConfiguredId, toStandardizedId } from '@oclif/core';\nimport { select } from '@inquirer/prompts';\n\nconst hook: Hook.CommandIncomplete = async function ({\n config,\n matches,\n argv,\n}) {\n const command = await select({\n message: 'Which of these commands would you like to run?',\n choices: matches.map((p) => toConfiguredId(p.id, config)),\n });\n\n if (argv.includes('--help') || argv.includes('-h')) {\n return config.runCommand('help', [toStandardizedId(command, config)]);\n }\n\n return config.runCommand(toStandardizedId(command, config), argv);\n};\n\nexport default hook;\n"})}),"\n",(0,t.jsx)(n.p,{children:"This is the prompt that the user would see:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{children:"$ my-cli list\n? Which of these commands did you mean (Use arrow keys)\n\u276f foobars list\n config list\n env list\n"})})]})}function m(e={}){const{wrapper:n}={...(0,i.R)(),...e.components};return n?(0,t.jsx)(n,{...e,children:(0,t.jsx)(d,{...e})}):d(e)}},8453:(e,n,o)=>{o.d(n,{R:()=>l,x:()=>r});var t=o(6540);const i={},s=t.createContext(i);function l(e){const n=t.useContext(s);return t.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function r(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:l(e.components),t.createElement(s.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/19fd9079.d25f483e.js b/assets/js/19fd9079.cddfda6f.js similarity index 96% rename from assets/js/19fd9079.d25f483e.js rename to assets/js/19fd9079.cddfda6f.js index 04d618a8..925ddabb 100644 --- a/assets/js/19fd9079.d25f483e.js +++ b/assets/js/19fd9079.cddfda6f.js @@ -1 +1 @@ -"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[8080],{4900:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>c,contentTitle:()=>l,default:()=>u,frontMatter:()=>r,metadata:()=>i,toc:()=>a});var o=t(4848),s=t(8453);const r={title:"External Links"},l=void 0,i={id:"external_links",title:"External Links",description:"* Salesforce Release Announcement",source:"@site/../docs/external_links.md",sourceDirName:".",slug:"/external_links",permalink:"/docs/external_links",draft:!1,unlisted:!1,editUrl:"https://github.com/oclif/oclif.github.io/tree/docs/docs/../docs/external_links.md",tags:[],version:"current",lastUpdatedBy:"Mike Donnalley",lastUpdatedAt:1734361515e3,frontMatter:{title:"External Links"},sidebar:"docs",previous:{title:"Examples",permalink:"/docs/examples"},next:{title:"Related Repositories",permalink:"/docs/related_repos"}},c={},a=[];function d(e){const n={a:"a",li:"li",ul:"ul",...(0,s.R)(),...e.components};return(0,o.jsxs)(n.ul,{children:["\n",(0,o.jsx)(n.li,{children:(0,o.jsx)(n.a,{href:"https://engineering.salesforce.com/open-sourcing-oclif-the-cli-framework-that-powers-our-clis-21fbda99d33a",children:"Salesforce Release Announcement"})}),"\n",(0,o.jsx)(n.li,{children:(0,o.jsx)(n.a,{href:"https://blog.heroku.com/open-cli-framework",children:"Heroku Release Announcement"})}),"\n"]})}function u(e={}){const{wrapper:n}={...(0,s.R)(),...e.components};return n?(0,o.jsx)(n,{...e,children:(0,o.jsx)(d,{...e})}):d(e)}},8453:(e,n,t)=>{t.d(n,{R:()=>l,x:()=>i});var o=t(6540);const s={},r=o.createContext(s);function l(e){const n=o.useContext(r);return o.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function i(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:l(e.components),o.createElement(r.Provider,{value:n},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[8080],{4900:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>c,contentTitle:()=>l,default:()=>u,frontMatter:()=>r,metadata:()=>i,toc:()=>a});var o=t(4848),s=t(8453);const r={title:"External Links"},l=void 0,i={id:"external_links",title:"External Links",description:"* Salesforce Release Announcement",source:"@site/../docs/external_links.md",sourceDirName:".",slug:"/external_links",permalink:"/docs/external_links",draft:!1,unlisted:!1,editUrl:"https://github.com/oclif/oclif.github.io/tree/docs/docs/../docs/external_links.md",tags:[],version:"current",lastUpdatedBy:"Mike Donnalley",lastUpdatedAt:1734722012e3,frontMatter:{title:"External Links"},sidebar:"docs",previous:{title:"Examples",permalink:"/docs/examples"},next:{title:"Related Repositories",permalink:"/docs/related_repos"}},c={},a=[];function d(e){const n={a:"a",li:"li",ul:"ul",...(0,s.R)(),...e.components};return(0,o.jsxs)(n.ul,{children:["\n",(0,o.jsx)(n.li,{children:(0,o.jsx)(n.a,{href:"https://engineering.salesforce.com/open-sourcing-oclif-the-cli-framework-that-powers-our-clis-21fbda99d33a",children:"Salesforce Release Announcement"})}),"\n",(0,o.jsx)(n.li,{children:(0,o.jsx)(n.a,{href:"https://blog.heroku.com/open-cli-framework",children:"Heroku Release Announcement"})}),"\n"]})}function u(e={}){const{wrapper:n}={...(0,s.R)(),...e.components};return n?(0,o.jsx)(n,{...e,children:(0,o.jsx)(d,{...e})}):d(e)}},8453:(e,n,t)=>{t.d(n,{R:()=>l,x:()=>i});var o=t(6540);const s={},r=o.createContext(s);function l(e){const n=o.useContext(r);return o.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function i(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:l(e.components),o.createElement(r.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/1ed4142b.d388a56e.js b/assets/js/1ed4142b.fe950661.js similarity index 98% rename from assets/js/1ed4142b.d388a56e.js rename to assets/js/1ed4142b.fe950661.js index 68a8e371..2e3157f6 100644 --- a/assets/js/1ed4142b.d388a56e.js +++ b/assets/js/1ed4142b.fe950661.js @@ -1 +1 @@ -"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[3782],{2381:(n,e,t)=>{t.r(e),t.d(e,{assets:()=>a,contentTitle:()=>l,default:()=>d,frontMatter:()=>s,metadata:()=>r,toc:()=>c});var i=t(4848),o=t(8453);const s={title:"Just-in-Time Plugin Installation",description:"Support for just-in-time plugin installation"},l=void 0,r={id:"jit_plugins",title:"Just-in-Time Plugin Installation",description:"Support for just-in-time plugin installation",source:"@site/../docs/jit_plugins.md",sourceDirName:".",slug:"/jit_plugins",permalink:"/docs/jit_plugins",draft:!1,unlisted:!1,editUrl:"https://github.com/oclif/oclif.github.io/tree/docs/docs/../docs/jit_plugins.md",tags:[],version:"current",lastUpdatedBy:"Mike Donnalley",lastUpdatedAt:1734361515e3,frontMatter:{title:"Just-in-Time Plugin Installation",description:"Support for just-in-time plugin installation"},sidebar:"docs",previous:{title:"Flexible Taxonomy",permalink:"/docs/flexible_taxonomy"},next:{title:"JSON",permalink:"/docs/json"}},a={},c=[];function u(n){const e={a:"a",code:"code",li:"li",ol:"ol",p:"p",pre:"pre",strong:"strong",...(0,o.R)(),...n.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(e.p,{children:"Sometimes you might want to have a plugin that isn't bundled in your CLI but gets installed the first time it's executed by the user - we call this just-in-time plugin installation, or JIT for short. This can be useful if you need to reduce the package size of your CLI while still allowing users access to all the plugins."}),"\n",(0,i.jsx)(e.p,{children:"To use this feature you need to:"}),"\n",(0,i.jsxs)(e.ol,{children:["\n",(0,i.jsxs)(e.li,{children:["Add ",(0,i.jsx)(e.code,{children:"jitPlugins"})," to the ",(0,i.jsx)(e.code,{children:"oclif"})," section of your package.json"]}),"\n"]}),"\n",(0,i.jsx)(e.pre,{children:(0,i.jsx)(e.code,{className:"language-json",children:'"oclif": {\n "jitPlugins": {\n "my-plugin": "^1.2.3",\n "another-plugin": "^1.2.3",\n }\n}\n'})}),"\n",(0,i.jsxs)(e.ol,{start:"2",children:["\n",(0,i.jsxs)(e.li,{children:["\n",(0,i.jsxs)(e.p,{children:["Ensure that your build process includes generating a manifest using ",(0,i.jsx)(e.code,{children:"oclif manifest"}),". The manifest will include the information about all the commands owned by JIT plugins which allows users to run ",(0,i.jsx)(e.code,{children:"--help"})," on those commands without having them installed yet. ",(0,i.jsx)(e.strong,{children:"If the generated manifest doesn't get packed with your CLI, then the feature will not work."})]}),"\n"]}),"\n",(0,i.jsxs)(e.li,{children:["\n",(0,i.jsxs)(e.p,{children:["Implement the ",(0,i.jsx)(e.code,{children:"jit_plugin_not_installed"})," hook."]}),"\n"]}),"\n"]}),"\n",(0,i.jsxs)(e.p,{children:["oclif attempts to be UX-agnostic, meaning that we don't want to impose any particular user experience on you. Any time a user experience is required we utilize ",(0,i.jsx)(e.a,{href:"/docs/hooks",children:"hooks"})," so that you can design the exact user experience you want your users to have."]}),"\n",(0,i.jsx)(e.p,{children:"In the case of JIT plugin installation, there are many possible user experiences that you might want - maybe you want to prompt the user for confirmation first, or maybe you want to log a specific message, etc..."}),"\n",(0,i.jsx)(e.p,{children:"Here's an example of how you might implement the hook,"}),"\n",(0,i.jsx)(e.pre,{children:(0,i.jsx)(e.code,{className:"language-typescript",children:"import { Hook, Errors } from '@oclif/core';\nimport confirm from '@inquirer/confirm';\n\nconst hook: Hook.JitPluginNotInstalled = async function (opts) {\n try {\n const answer = await confirm({\n message: `${opts.command.pluginName} not installed. Would you like to install?`\n })\n if (answer) {\n await opts.config.runCommand('plugins:install', [`${opts.command.pluginName}@${opts.pluginVersion}`]);\n }\n } catch (error) {\n throw new Errors.CLIError(`Could not install ${opts.command.pluginName}`, 'JitPluginInstallError');\n }\n};\n\nexport default hook;\n\n"})})]})}function d(n={}){const{wrapper:e}={...(0,o.R)(),...n.components};return e?(0,i.jsx)(e,{...n,children:(0,i.jsx)(u,{...n})}):u(n)}},8453:(n,e,t)=>{t.d(e,{R:()=>l,x:()=>r});var i=t(6540);const o={},s=i.createContext(o);function l(n){const e=i.useContext(s);return i.useMemo((function(){return"function"==typeof n?n(e):{...e,...n}}),[e,n])}function r(n){let e;return e=n.disableParentContext?"function"==typeof n.components?n.components(o):n.components||o:l(n.components),i.createElement(s.Provider,{value:e},n.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[3782],{2381:(n,e,t)=>{t.r(e),t.d(e,{assets:()=>a,contentTitle:()=>l,default:()=>d,frontMatter:()=>s,metadata:()=>r,toc:()=>c});var i=t(4848),o=t(8453);const s={title:"Just-in-Time Plugin Installation",description:"Support for just-in-time plugin installation"},l=void 0,r={id:"jit_plugins",title:"Just-in-Time Plugin Installation",description:"Support for just-in-time plugin installation",source:"@site/../docs/jit_plugins.md",sourceDirName:".",slug:"/jit_plugins",permalink:"/docs/jit_plugins",draft:!1,unlisted:!1,editUrl:"https://github.com/oclif/oclif.github.io/tree/docs/docs/../docs/jit_plugins.md",tags:[],version:"current",lastUpdatedBy:"Mike Donnalley",lastUpdatedAt:1734722012e3,frontMatter:{title:"Just-in-Time Plugin Installation",description:"Support for just-in-time plugin installation"},sidebar:"docs",previous:{title:"Flexible Taxonomy",permalink:"/docs/flexible_taxonomy"},next:{title:"JSON",permalink:"/docs/json"}},a={},c=[];function u(n){const e={a:"a",code:"code",li:"li",ol:"ol",p:"p",pre:"pre",strong:"strong",...(0,o.R)(),...n.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(e.p,{children:"Sometimes you might want to have a plugin that isn't bundled in your CLI but gets installed the first time it's executed by the user - we call this just-in-time plugin installation, or JIT for short. This can be useful if you need to reduce the package size of your CLI while still allowing users access to all the plugins."}),"\n",(0,i.jsx)(e.p,{children:"To use this feature you need to:"}),"\n",(0,i.jsxs)(e.ol,{children:["\n",(0,i.jsxs)(e.li,{children:["Add ",(0,i.jsx)(e.code,{children:"jitPlugins"})," to the ",(0,i.jsx)(e.code,{children:"oclif"})," section of your package.json"]}),"\n"]}),"\n",(0,i.jsx)(e.pre,{children:(0,i.jsx)(e.code,{className:"language-json",children:'"oclif": {\n "jitPlugins": {\n "my-plugin": "^1.2.3",\n "another-plugin": "^1.2.3",\n }\n}\n'})}),"\n",(0,i.jsxs)(e.ol,{start:"2",children:["\n",(0,i.jsxs)(e.li,{children:["\n",(0,i.jsxs)(e.p,{children:["Ensure that your build process includes generating a manifest using ",(0,i.jsx)(e.code,{children:"oclif manifest"}),". The manifest will include the information about all the commands owned by JIT plugins which allows users to run ",(0,i.jsx)(e.code,{children:"--help"})," on those commands without having them installed yet. ",(0,i.jsx)(e.strong,{children:"If the generated manifest doesn't get packed with your CLI, then the feature will not work."})]}),"\n"]}),"\n",(0,i.jsxs)(e.li,{children:["\n",(0,i.jsxs)(e.p,{children:["Implement the ",(0,i.jsx)(e.code,{children:"jit_plugin_not_installed"})," hook."]}),"\n"]}),"\n"]}),"\n",(0,i.jsxs)(e.p,{children:["oclif attempts to be UX-agnostic, meaning that we don't want to impose any particular user experience on you. Any time a user experience is required we utilize ",(0,i.jsx)(e.a,{href:"/docs/hooks",children:"hooks"})," so that you can design the exact user experience you want your users to have."]}),"\n",(0,i.jsx)(e.p,{children:"In the case of JIT plugin installation, there are many possible user experiences that you might want - maybe you want to prompt the user for confirmation first, or maybe you want to log a specific message, etc..."}),"\n",(0,i.jsx)(e.p,{children:"Here's an example of how you might implement the hook,"}),"\n",(0,i.jsx)(e.pre,{children:(0,i.jsx)(e.code,{className:"language-typescript",children:"import { Hook, Errors } from '@oclif/core';\nimport confirm from '@inquirer/confirm';\n\nconst hook: Hook.JitPluginNotInstalled = async function (opts) {\n try {\n const answer = await confirm({\n message: `${opts.command.pluginName} not installed. Would you like to install?`\n })\n if (answer) {\n await opts.config.runCommand('plugins:install', [`${opts.command.pluginName}@${opts.pluginVersion}`]);\n }\n } catch (error) {\n throw new Errors.CLIError(`Could not install ${opts.command.pluginName}`, 'JitPluginInstallError');\n }\n};\n\nexport default hook;\n\n"})})]})}function d(n={}){const{wrapper:e}={...(0,o.R)(),...n.components};return e?(0,i.jsx)(e,{...n,children:(0,i.jsx)(u,{...n})}):u(n)}},8453:(n,e,t)=>{t.d(e,{R:()=>l,x:()=>r});var i=t(6540);const o={},s=i.createContext(o);function l(n){const e=i.useContext(s);return i.useMemo((function(){return"function"==typeof n?n(e):{...e,...n}}),[e,n])}function r(n){let e;return e=n.disableParentContext?"function"==typeof n.components?n.components(o):n.components||o:l(n.components),i.createElement(s.Provider,{value:e},n.children)}}}]); \ No newline at end of file diff --git a/assets/js/1f61ef73.b441af12.js b/assets/js/1f61ef73.d2cfd7fa.js similarity index 98% rename from assets/js/1f61ef73.b441af12.js rename to assets/js/1f61ef73.d2cfd7fa.js index d8ee909d..06712f81 100644 --- a/assets/js/1f61ef73.b441af12.js +++ b/assets/js/1f61ef73.d2cfd7fa.js @@ -1 +1 @@ -"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[5082],{9539:(e,n,r)=>{r.r(n),r.d(n,{assets:()=>a,contentTitle:()=>i,default:()=>h,frontMatter:()=>c,metadata:()=>s,toc:()=>d});var o=r(4848),t=r(8453);const c={title:"Error Handling",description:"Customize error handling"},i=void 0,s={id:"error_handling",title:"Error Handling",description:"Customize error handling",source:"@site/../docs/error_handling.md",sourceDirName:".",slug:"/error_handling",permalink:"/docs/error_handling",draft:!1,unlisted:!1,editUrl:"https://github.com/oclif/oclif.github.io/tree/docs/docs/../docs/error_handling.md",tags:[],version:"current",lastUpdatedBy:"Mike Donnalley",lastUpdatedAt:1734361515e3,frontMatter:{title:"Error Handling",description:"Customize error handling"},sidebar:"docs",previous:{title:"Debugging",permalink:"/docs/debugging"},next:{title:"ESM",permalink:"/docs/esm"}},a={},d=[{value:"Error Handling in the catch method",id:"error-handling-in-the-catch-method",level:2},{value:"bin/run.js catch handler",id:"binrunjs-catch-handler",level:2}];function l(e){const n={a:"a",code:"code",h2:"h2",p:"p",pre:"pre",...(0,t.R)(),...e.components};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)(n.p,{children:["oclif handles intentionally - and unintentionally - thrown errors in two places. First in the ",(0,o.jsx)(n.code,{children:"Command.catch"})," method and then, finally, in the ",(0,o.jsx)(n.code,{children:"bin/run.js"})," ",(0,o.jsx)(n.code,{children:"catch"})," handler where the Error is printed and the CLI exits. This error flow makes it possible for you to control and respond to errors that occur in your CLI as you see fit."]}),"\n",(0,o.jsxs)(n.h2,{id:"error-handling-in-the-catch-method",children:["Error Handling in the ",(0,o.jsx)(n.code,{children:"catch"})," method"]}),"\n",(0,o.jsxs)(n.p,{children:["Every ",(0,o.jsx)(n.code,{children:"Command"})," instance has a ",(0,o.jsx)(n.code,{children:"catch"})," method that is called when an error occurs throughout the course of a command run. This method handles the edge case of users asking for help or version output, if applicable, otherwise, it re-throws the error. You can extend or overwrite the ",(0,o.jsx)(n.code,{children:"catch"})," method in your command class."]}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-js",children:"import {Command, flags} from '@oclif/core'\n\nexport default class Hello extends Command {\n async catch(error) {\n // do something or\n // re-throw to be handled globally\n throw error;\n }\n}\n"})}),"\n",(0,o.jsxs)(n.p,{children:["If this type of error handling is being implemented across multiple commands consider using a ",(0,o.jsx)(n.a,{href:"/docs/base_class",children:"Custom Base Class"})," for your commands and overriding the ",(0,o.jsx)(n.code,{children:"catch"})," method."]}),"\n",(0,o.jsxs)(n.h2,{id:"binrunjs-catch-handler",children:["bin/run.js ",(0,o.jsx)(n.code,{children:"catch"})," handler"]}),"\n",(0,o.jsxs)(n.p,{children:["Every oclif CLI has a ",(0,o.jsx)(n.code,{children:"./bin/run.js"})," file that is the entry point of command invocation. Errors that occur in the CLI, including re-thrown errors from a Command, are caught and handled by oclif's ",(0,o.jsx)(n.code,{children:"handle"})," function, which displays the error to the user."]}),"\n",(0,o.jsxs)(n.p,{children:["If you generated your CLI using ",(0,o.jsx)(n.code,{children:"oclif generate"}),", then you will see an ",(0,o.jsx)(n.code,{children:"execute"})," function that's responsible for running the CLI and catching any errors. You can, however, implement this yourself if you need to customize the error handling."]}),"\n",(0,o.jsxs)(n.p,{children:["Here's the generic ",(0,o.jsx)(n.code,{children:"bin/run.js"})," that comes with ",(0,o.jsx)(n.code,{children:"oclif generate"}),":"]}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-javascript",children:"#!/usr/bin/env node\n\nimport {execute} from '@oclif/core'\n\nawait execute({dir: import.meta.url})\n"})}),"\n",(0,o.jsxs)(n.p,{children:["To customize error handling, you'll want to use oclif's ",(0,o.jsx)(n.code,{children:"run"})," function instead of ",(0,o.jsx)(n.code,{children:"execute"}),":"]}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-javascript",children:"#!/usr/bin/env node\n\nimport {run, handle, flush} from '@oclif/core'\n\nawait run(process.argv.slice(2), import.meta.url)\n .catch(async (error) => handle(error))\n .finally(async () => flush())\n"})}),"\n",(0,o.jsxs)(n.p,{children:["The ",(0,o.jsx)(n.code,{children:"catch"})," handler can be swapped for any function that receives an error argument. If you chose to implement your own handler here, we still recommend you delegate finally to the ",(0,o.jsx)(n.code,{children:"handle"})," function for clean-up and exiting logic."]}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-js",children:".catch((error) => {\n // do any extra work with error\n return handle(error);\n})\n"})})]})}function h(e={}){const{wrapper:n}={...(0,t.R)(),...e.components};return n?(0,o.jsx)(n,{...e,children:(0,o.jsx)(l,{...e})}):l(e)}},8453:(e,n,r)=>{r.d(n,{R:()=>i,x:()=>s});var o=r(6540);const t={},c=o.createContext(t);function i(e){const n=o.useContext(c);return o.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function s(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(t):e.components||t:i(e.components),o.createElement(c.Provider,{value:n},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[5082],{9539:(e,n,r)=>{r.r(n),r.d(n,{assets:()=>a,contentTitle:()=>i,default:()=>h,frontMatter:()=>c,metadata:()=>s,toc:()=>d});var o=r(4848),t=r(8453);const c={title:"Error Handling",description:"Customize error handling"},i=void 0,s={id:"error_handling",title:"Error Handling",description:"Customize error handling",source:"@site/../docs/error_handling.md",sourceDirName:".",slug:"/error_handling",permalink:"/docs/error_handling",draft:!1,unlisted:!1,editUrl:"https://github.com/oclif/oclif.github.io/tree/docs/docs/../docs/error_handling.md",tags:[],version:"current",lastUpdatedBy:"Mike Donnalley",lastUpdatedAt:1734722012e3,frontMatter:{title:"Error Handling",description:"Customize error handling"},sidebar:"docs",previous:{title:"Debugging",permalink:"/docs/debugging"},next:{title:"ESM",permalink:"/docs/esm"}},a={},d=[{value:"Error Handling in the catch method",id:"error-handling-in-the-catch-method",level:2},{value:"bin/run.js catch handler",id:"binrunjs-catch-handler",level:2}];function l(e){const n={a:"a",code:"code",h2:"h2",p:"p",pre:"pre",...(0,t.R)(),...e.components};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)(n.p,{children:["oclif handles intentionally - and unintentionally - thrown errors in two places. First in the ",(0,o.jsx)(n.code,{children:"Command.catch"})," method and then, finally, in the ",(0,o.jsx)(n.code,{children:"bin/run.js"})," ",(0,o.jsx)(n.code,{children:"catch"})," handler where the Error is printed and the CLI exits. This error flow makes it possible for you to control and respond to errors that occur in your CLI as you see fit."]}),"\n",(0,o.jsxs)(n.h2,{id:"error-handling-in-the-catch-method",children:["Error Handling in the ",(0,o.jsx)(n.code,{children:"catch"})," method"]}),"\n",(0,o.jsxs)(n.p,{children:["Every ",(0,o.jsx)(n.code,{children:"Command"})," instance has a ",(0,o.jsx)(n.code,{children:"catch"})," method that is called when an error occurs throughout the course of a command run. This method handles the edge case of users asking for help or version output, if applicable, otherwise, it re-throws the error. You can extend or overwrite the ",(0,o.jsx)(n.code,{children:"catch"})," method in your command class."]}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-js",children:"import {Command, flags} from '@oclif/core'\n\nexport default class Hello extends Command {\n async catch(error) {\n // do something or\n // re-throw to be handled globally\n throw error;\n }\n}\n"})}),"\n",(0,o.jsxs)(n.p,{children:["If this type of error handling is being implemented across multiple commands consider using a ",(0,o.jsx)(n.a,{href:"/docs/base_class",children:"Custom Base Class"})," for your commands and overriding the ",(0,o.jsx)(n.code,{children:"catch"})," method."]}),"\n",(0,o.jsxs)(n.h2,{id:"binrunjs-catch-handler",children:["bin/run.js ",(0,o.jsx)(n.code,{children:"catch"})," handler"]}),"\n",(0,o.jsxs)(n.p,{children:["Every oclif CLI has a ",(0,o.jsx)(n.code,{children:"./bin/run.js"})," file that is the entry point of command invocation. Errors that occur in the CLI, including re-thrown errors from a Command, are caught and handled by oclif's ",(0,o.jsx)(n.code,{children:"handle"})," function, which displays the error to the user."]}),"\n",(0,o.jsxs)(n.p,{children:["If you generated your CLI using ",(0,o.jsx)(n.code,{children:"oclif generate"}),", then you will see an ",(0,o.jsx)(n.code,{children:"execute"})," function that's responsible for running the CLI and catching any errors. You can, however, implement this yourself if you need to customize the error handling."]}),"\n",(0,o.jsxs)(n.p,{children:["Here's the generic ",(0,o.jsx)(n.code,{children:"bin/run.js"})," that comes with ",(0,o.jsx)(n.code,{children:"oclif generate"}),":"]}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-javascript",children:"#!/usr/bin/env node\n\nimport {execute} from '@oclif/core'\n\nawait execute({dir: import.meta.url})\n"})}),"\n",(0,o.jsxs)(n.p,{children:["To customize error handling, you'll want to use oclif's ",(0,o.jsx)(n.code,{children:"run"})," function instead of ",(0,o.jsx)(n.code,{children:"execute"}),":"]}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-javascript",children:"#!/usr/bin/env node\n\nimport {run, handle, flush} from '@oclif/core'\n\nawait run(process.argv.slice(2), import.meta.url)\n .catch(async (error) => handle(error))\n .finally(async () => flush())\n"})}),"\n",(0,o.jsxs)(n.p,{children:["The ",(0,o.jsx)(n.code,{children:"catch"})," handler can be swapped for any function that receives an error argument. If you chose to implement your own handler here, we still recommend you delegate finally to the ",(0,o.jsx)(n.code,{children:"handle"})," function for clean-up and exiting logic."]}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-js",children:".catch((error) => {\n // do any extra work with error\n return handle(error);\n})\n"})})]})}function h(e={}){const{wrapper:n}={...(0,t.R)(),...e.components};return n?(0,o.jsx)(n,{...e,children:(0,o.jsx)(l,{...e})}):l(e)}},8453:(e,n,r)=>{r.d(n,{R:()=>i,x:()=>s});var o=r(6540);const t={},c=o.createContext(t);function i(e){const n=o.useContext(c);return o.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function s(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(t):e.components||t:i(e.components),o.createElement(c.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/258a6413.6a23fa58.js b/assets/js/258a6413.ffac7b9c.js similarity index 97% rename from assets/js/258a6413.6a23fa58.js rename to assets/js/258a6413.ffac7b9c.js index a8e9c8ed..e5ecae38 100644 --- a/assets/js/258a6413.6a23fa58.js +++ b/assets/js/258a6413.ffac7b9c.js @@ -1 +1 @@ -"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[3651],{8654:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>a,contentTitle:()=>c,default:()=>m,frontMatter:()=>s,metadata:()=>r,toc:()=>d});var o=t(4848),i=t(8453);const s={title:"Single Command CLI",description:"Configure CLI to be a single command"},c=void 0,r={id:"single_command_cli",title:"Single Command CLI",description:"Configure CLI to be a single command",source:"@site/../docs/single_command_cli.md",sourceDirName:".",slug:"/single_command_cli",permalink:"/docs/single_command_cli",draft:!1,unlisted:!1,editUrl:"https://github.com/oclif/oclif.github.io/tree/docs/docs/../docs/single_command_cli.md",tags:[],version:"current",lastUpdatedBy:"Mike Donnalley",lastUpdatedAt:1734361515e3,frontMatter:{title:"Single Command CLI",description:"Configure CLI to be a single command"},sidebar:"docs",previous:{title:"Running Commands Programmatically",permalink:"/docs/running_programmatically"},next:{title:"Testing",permalink:"/docs/testing"}},a={},d=[];function l(e){const n={a:"a",code:"code",p:"p",pre:"pre",...(0,i.R)(),...e.components};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)(n.p,{children:["Sometimes you may want your CLI's executable to also be the only command, similar to many bash utilities like ",(0,o.jsx)(n.code,{children:"ls"})," or ",(0,o.jsx)(n.code,{children:"cat"}),"."]}),"\n",(0,o.jsxs)(n.p,{children:["To support this, you will need to put your command logic into ",(0,o.jsx)(n.code,{children:"src/index.ts"})," and add the following to the oclif section of your package.json:"]}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-json",children:'{\n "oclif": {\n "commands": {\n "strategy": "single",\n "target": "./dist/index.js"\n }\n }\n}\n'})}),"\n",(0,o.jsxs)(n.p,{children:["where ",(0,o.jsx)(n.code,{children:"./dist/index.js"})," is a file that exports a ",(0,o.jsx)(n.code,{children:"Command"})," class. See ",(0,o.jsx)(n.a,{href:"./command_discovery_strategies",children:"Command Discovery Strategies"})," for more details."]})]})}function m(e={}){const{wrapper:n}={...(0,i.R)(),...e.components};return n?(0,o.jsx)(n,{...e,children:(0,o.jsx)(l,{...e})}):l(e)}},8453:(e,n,t)=>{t.d(n,{R:()=>c,x:()=>r});var o=t(6540);const i={},s=o.createContext(i);function c(e){const n=o.useContext(s);return o.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function r(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:c(e.components),o.createElement(s.Provider,{value:n},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[3651],{8654:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>a,contentTitle:()=>c,default:()=>m,frontMatter:()=>s,metadata:()=>r,toc:()=>d});var o=t(4848),i=t(8453);const s={title:"Single Command CLI",description:"Configure CLI to be a single command"},c=void 0,r={id:"single_command_cli",title:"Single Command CLI",description:"Configure CLI to be a single command",source:"@site/../docs/single_command_cli.md",sourceDirName:".",slug:"/single_command_cli",permalink:"/docs/single_command_cli",draft:!1,unlisted:!1,editUrl:"https://github.com/oclif/oclif.github.io/tree/docs/docs/../docs/single_command_cli.md",tags:[],version:"current",lastUpdatedBy:"Mike Donnalley",lastUpdatedAt:1734722012e3,frontMatter:{title:"Single Command CLI",description:"Configure CLI to be a single command"},sidebar:"docs",previous:{title:"Running Commands Programmatically",permalink:"/docs/running_programmatically"},next:{title:"Testing",permalink:"/docs/testing"}},a={},d=[];function l(e){const n={a:"a",code:"code",p:"p",pre:"pre",...(0,i.R)(),...e.components};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)(n.p,{children:["Sometimes you may want your CLI's executable to also be the only command, similar to many bash utilities like ",(0,o.jsx)(n.code,{children:"ls"})," or ",(0,o.jsx)(n.code,{children:"cat"}),"."]}),"\n",(0,o.jsxs)(n.p,{children:["To support this, you will need to put your command logic into ",(0,o.jsx)(n.code,{children:"src/index.ts"})," and add the following to the oclif section of your package.json:"]}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-json",children:'{\n "oclif": {\n "commands": {\n "strategy": "single",\n "target": "./dist/index.js"\n }\n }\n}\n'})}),"\n",(0,o.jsxs)(n.p,{children:["where ",(0,o.jsx)(n.code,{children:"./dist/index.js"})," is a file that exports a ",(0,o.jsx)(n.code,{children:"Command"})," class. See ",(0,o.jsx)(n.a,{href:"./command_discovery_strategies",children:"Command Discovery Strategies"})," for more details."]})]})}function m(e={}){const{wrapper:n}={...(0,i.R)(),...e.components};return n?(0,o.jsx)(n,{...e,children:(0,o.jsx)(l,{...e})}):l(e)}},8453:(e,n,t)=>{t.d(n,{R:()=>c,x:()=>r});var o=t(6540);const i={},s=o.createContext(i);function c(e){const n=o.useContext(s);return o.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function r(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:c(e.components),o.createElement(s.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/2a33acc4.63051787.js b/assets/js/2a33acc4.d849c894.js similarity index 97% rename from assets/js/2a33acc4.63051787.js rename to assets/js/2a33acc4.d849c894.js index 7f3e590f..8222170b 100644 --- a/assets/js/2a33acc4.63051787.js +++ b/assets/js/2a33acc4.d849c894.js @@ -1 +1 @@ -"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[1427],{4693:(e,t,s)=>{s.r(t),s.d(t,{assets:()=>a,contentTitle:()=>c,default:()=>l,frontMatter:()=>n,metadata:()=>r,toc:()=>d});var i=s(4848),o=s(8453);const n={title:"Topics"},c=void 0,r={id:"topics",title:"Topics",description:"As CLIs grow it can be useful to nest commands within topics. This is supported simply by placing command files in subdirectories. For example, with the Salesforce CLI we have a topic sf config with commands like sf config set and sf config get. The directory structure looks like this:",source:"@site/../docs/topics.md",sourceDirName:".",slug:"/topics",permalink:"/docs/topics",draft:!1,unlisted:!1,editUrl:"https://github.com/oclif/oclif.github.io/tree/docs/docs/../docs/topics.md",tags:[],version:"current",lastUpdatedBy:"Mike Donnalley",lastUpdatedAt:1734361515e3,frontMatter:{title:"Topics"},sidebar:"docs",previous:{title:"Command Discovery Strategies",permalink:"/docs/command_discovery_strategies"},next:{title:"Topic Separators",permalink:"/docs/topic_separator"}},a={},d=[];function p(e){const t={code:"code",p:"p",pre:"pre",...(0,o.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(t.p,{children:["As CLIs grow it can be useful to nest commands within topics. This is supported simply by placing command files in subdirectories. For example, with the Salesforce CLI we have a topic ",(0,i.jsx)(t.code,{children:"sf config"})," with commands like ",(0,i.jsx)(t.code,{children:"sf config set"})," and ",(0,i.jsx)(t.code,{children:"sf config get"}),". The directory structure looks like this:"]}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{children:"package.json\nsrc/\n\u2514\u2500\u2500 commands/\n \u2514\u2500\u2500 config/\n \xa0 \u251c\u2500\u2500 index.ts\n \xa0\xa0\u251c\u2500\u2500 set.ts\n \xa0\xa0 \u2514\u2500\u2500 get.ts\n"})}),"\n",(0,i.jsxs)(t.p,{children:["The help descriptions will be the description of the first command within a directory. If you'd like to customize the help description, add it to the ",(0,i.jsx)(t.code,{children:"package.json"})," like so:"]}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-js",children:'{\n "oclif": {\n "topics": {\n "apps:favorites": { "description": "manage favorite apps" },\n "config": { "description": "manage heroku config variables" },\n }\n }\n}\n'})}),"\n",(0,i.jsx)(t.p,{children:"Subtopics can be created by making subdirectories within topic directories, but for UX reasons we generally discourage going more than 1 or 2 levels deep even for the largest CLIs."})]})}function l(e={}){const{wrapper:t}={...(0,o.R)(),...e.components};return t?(0,i.jsx)(t,{...e,children:(0,i.jsx)(p,{...e})}):p(e)}},8453:(e,t,s)=>{s.d(t,{R:()=>c,x:()=>r});var i=s(6540);const o={},n=i.createContext(o);function c(e){const t=i.useContext(n);return i.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function r(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(o):e.components||o:c(e.components),i.createElement(n.Provider,{value:t},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[1427],{4693:(e,t,s)=>{s.r(t),s.d(t,{assets:()=>a,contentTitle:()=>c,default:()=>l,frontMatter:()=>n,metadata:()=>r,toc:()=>d});var i=s(4848),o=s(8453);const n={title:"Topics"},c=void 0,r={id:"topics",title:"Topics",description:"As CLIs grow it can be useful to nest commands within topics. This is supported simply by placing command files in subdirectories. For example, with the Salesforce CLI we have a topic sf config with commands like sf config set and sf config get. The directory structure looks like this:",source:"@site/../docs/topics.md",sourceDirName:".",slug:"/topics",permalink:"/docs/topics",draft:!1,unlisted:!1,editUrl:"https://github.com/oclif/oclif.github.io/tree/docs/docs/../docs/topics.md",tags:[],version:"current",lastUpdatedBy:"Mike Donnalley",lastUpdatedAt:1734722012e3,frontMatter:{title:"Topics"},sidebar:"docs",previous:{title:"Command Discovery Strategies",permalink:"/docs/command_discovery_strategies"},next:{title:"Topic Separators",permalink:"/docs/topic_separator"}},a={},d=[];function p(e){const t={code:"code",p:"p",pre:"pre",...(0,o.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(t.p,{children:["As CLIs grow it can be useful to nest commands within topics. This is supported simply by placing command files in subdirectories. For example, with the Salesforce CLI we have a topic ",(0,i.jsx)(t.code,{children:"sf config"})," with commands like ",(0,i.jsx)(t.code,{children:"sf config set"})," and ",(0,i.jsx)(t.code,{children:"sf config get"}),". The directory structure looks like this:"]}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{children:"package.json\nsrc/\n\u2514\u2500\u2500 commands/\n \u2514\u2500\u2500 config/\n \xa0 \u251c\u2500\u2500 index.ts\n \xa0\xa0\u251c\u2500\u2500 set.ts\n \xa0\xa0 \u2514\u2500\u2500 get.ts\n"})}),"\n",(0,i.jsxs)(t.p,{children:["The help descriptions will be the description of the first command within a directory. If you'd like to customize the help description, add it to the ",(0,i.jsx)(t.code,{children:"package.json"})," like so:"]}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-js",children:'{\n "oclif": {\n "topics": {\n "apps:favorites": { "description": "manage favorite apps" },\n "config": { "description": "manage heroku config variables" },\n }\n }\n}\n'})}),"\n",(0,i.jsx)(t.p,{children:"Subtopics can be created by making subdirectories within topic directories, but for UX reasons we generally discourage going more than 1 or 2 levels deep even for the largest CLIs."})]})}function l(e={}){const{wrapper:t}={...(0,o.R)(),...e.components};return t?(0,i.jsx)(t,{...e,children:(0,i.jsx)(p,{...e})}):p(e)}},8453:(e,t,s)=>{s.d(t,{R:()=>c,x:()=>r});var i=s(6540);const o={},n=i.createContext(o);function c(e){const t=i.useContext(n);return i.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function r(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(o):e.components||o:c(e.components),i.createElement(n.Provider,{value:t},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/2f98ad87.8e5de7f0.js b/assets/js/2f98ad87.9f0f1dd8.js similarity index 99% rename from assets/js/2f98ad87.8e5de7f0.js rename to assets/js/2f98ad87.9f0f1dd8.js index ba16cba3..bdecc62d 100644 --- a/assets/js/2f98ad87.8e5de7f0.js +++ b/assets/js/2f98ad87.9f0f1dd8.js @@ -1 +1 @@ -"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[8664],{9805:(e,n,o)=>{o.r(n),o.d(n,{assets:()=>l,contentTitle:()=>c,default:()=>m,frontMatter:()=>a,metadata:()=>i,toc:()=>s});var t=o(4848),r=o(8453);const a={title:"Generator Commands"},c=void 0,i={id:"generator_commands",title:"Generator Commands",description:"Use these commands to generate the scaffoling for a new CLI, a command, or a hook. The scaffolding includes CLI configuration files, scripts, and sample TypeScript files for a simple hello world command.",source:"@site/../docs/generator_commands.md",sourceDirName:".",slug:"/generator_commands",permalink:"/docs/generator_commands",draft:!1,unlisted:!1,editUrl:"https://github.com/oclif/oclif.github.io/tree/docs/docs/../docs/generator_commands.md",tags:[],version:"current",lastUpdatedBy:"Mike Donnalley",lastUpdatedAt:1734361515e3,frontMatter:{title:"Generator Commands"},sidebar:"docs",previous:{title:"FAQs",permalink:"/docs/faqs"},next:{title:"Templates",permalink:"/docs/templates"}},l={},s=[{value:"oclif generate NAME",id:"oclif-generate-name",level:2},{value:"oclif generate command NAME",id:"oclif-generate-command-name",level:2},{value:"oclif generate hook NAME",id:"oclif-generate-hook-name",level:2}];function d(e){const n={a:"a",code:"code",em:"em",h2:"h2",li:"li",p:"p",pre:"pre",ul:"ul",...(0,r.R)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(n.p,{children:["Use these commands to generate the scaffoling for a new CLI, a command, or a hook. The scaffolding includes CLI configuration files, scripts, and sample TypeScript files for a simple ",(0,t.jsx)(n.code,{children:"hello world"})," command."]}),"\n",(0,t.jsxs)(n.p,{children:["Run each command with the ",(0,t.jsx)(n.code,{children:"--help"})," flag, but without its argument, to see the same information documented below; for example, ",(0,t.jsx)(n.code,{children:"oclif generate --help"}),"."]}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.a,{href:"#oclif-generate-name",children:(0,t.jsx)(n.code,{children:"oclif generate NAME"})})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.a,{href:"#oclif-generate-command-name",children:(0,t.jsx)(n.code,{children:"oclif generate command NAME"})})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.a,{href:"#oclif-generate-hook-name",children:(0,t.jsx)(n.code,{children:"oclif generate hook NAME"})})}),"\n"]}),"\n",(0,t.jsx)(n.h2,{id:"oclif-generate-name",children:(0,t.jsx)(n.code,{children:"oclif generate NAME"})}),"\n",(0,t.jsx)(n.p,{children:"Generate a new CLI."}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{children:'USAGE\n $ oclif generate NAME [--author ] [--bin ] [--description ] [--license ]\n [--module-type CommonJS|ESM] [--name ] [--owner ] [--package-manager npm|yarn|pnpm] [--repository\n ] [-d ] [-y]\n\nARGUMENTS\n NAME Directory name of new project.\n\nFLAGS\n -d, --output-dir= Directory to build the CLI in.\n -y, --yes Use defaults for all prompts. Individual flags will override defaults.\n --author= Supply answer for prompt: Author\n --bin= Supply answer for prompt: Command bin name the CLI will export\n --description= Supply answer for prompt: Description\n --license= Supply answer for prompt: License\n --module-type=