From 4ba23f8e8553a5cec0482b38eb3a1e17e846d68f Mon Sep 17 00:00:00 2001 From: svc-cli-bot Date: Thu, 28 Mar 2024 17:48:19 +0000 Subject: [PATCH] Deploy website - based on 743f86ab690655d72e1b0e8a2bc3ba51a12cd9fa --- 404.html | 4 +- ...88bad.e2c41b25.js => 03a88bad.e4e218e3.js} | 2 +- ...beb31.92c8b546.js => 03abeb31.6dc74dd5.js} | 2 +- ...18a01.98989636.js => 0b218a01.cfc579ed.js} | 2 +- assets/js/104cbb75.6be57dc9.js | 1 + assets/js/104cbb75.b8a0f7f4.js | 1 - ...d9079.e4bcbbe8.js => 19fd9079.96525bdb.js} | 2 +- assets/js/1ed4142b.4fd4ea02.js | 1 + assets/js/1ed4142b.b17aa3a9.js | 1 - assets/js/1f61ef73.def02bb5.js | 1 - assets/js/1f61ef73.f68119de.js | 1 + ...6267b.3eff173f.js => 2486267b.c1b6895d.js} | 2 +- assets/js/258a6413.0362cb75.js | 1 + assets/js/258a6413.7571cfa2.js | 1 - ...3acc4.85c45bca.js => 2a33acc4.53e519de.js} | 2 +- ...8ad87.228f4401.js => 2f98ad87.86268d63.js} | 2 +- ...2343a.5990f799.js => 3042343a.e28a3ddf.js} | 2 +- ...74566.b0a1e544.js => 30d74566.546b46b6.js} | 2 +- ...60389.4ed86e32.js => 32060389.3e131ae3.js} | 2 +- ...86d92.d7148524.js => 35586d92.4dc47803.js} | 2 +- assets/js/3e452c7e.414162ce.js | 1 + assets/js/3e452c7e.c0a60494.js | 1 - ...18611.8353b2b3.js => 53e18611.0fb9de33.js} | 2 +- assets/js/5d5620c4.42ab4378.js | 1 - assets/js/5d5620c4.a2876507.js | 1 + ...bb722.f0f88331.js => 6f3bb722.02a2f8ab.js} | 2 +- assets/js/713bb917.1d45124b.js | 1 + assets/js/713bb917.51bb646a.js | 1 - ...58895.4f67c193.js => 7bd58895.7df2e0fa.js} | 2 +- ...47a8b.0de224a5.js => 82247a8b.b66c0358.js} | 2 +- assets/js/8705a681.6ea32481.js | 1 + assets/js/8705a681.b6c93c33.js | 1 - ...116ff.c77cc093.js => 935116ff.55edcd25.js} | 2 +- assets/js/935f2afb.48e369fc.js | 1 - assets/js/935f2afb.c7a88113.js | 1 + ...a546a.94067195.js => 9eaa546a.99390459.js} | 2 +- assets/js/a92e169d.12baa570.js | 1 - ...ec439.b2c5e185.js => a96ec439.6aa36911.js} | 2 +- ...c73c6.5efea308.js => b3cc73c6.60782236.js} | 2 +- assets/js/b4a95747.1177b0ed.js | 1 - assets/js/b4a95747.408989e3.js | 1 + assets/js/b93366a4.6c311929.js | 1 + ...90d18.455ba959.js => c5890d18.e78a8f29.js} | 2 +- ...fd975.3b60cd10.js => c81fd975.ccf41faf.js} | 2 +- ...a68c1.4f481c6d.js => c94a68c1.4d01cf27.js} | 2 +- assets/js/cfacefa6.e6399204.js | 1 + ...73d62.8abaa7b2.js => d0e73d62.a4548f66.js} | 2 +- ...5a578.93367260.js => d665a578.f4539599.js} | 2 +- ...0bdb4.f64cdb78.js => d9b0bdb4.3747e9d7.js} | 2 +- ...cd967.3a02a917.js => df1cd967.a7094501.js} | 2 +- ...0e27f.86e6a8e3.js => e360e27f.a4727791.js} | 2 +- assets/js/e3703649.0f40a824.js | 1 + assets/js/e3703649.1ae0b24d.js | 1 - ...c62ed.9a883f86.js => e96c62ed.1fe02f63.js} | 2 +- ...2954c.8081666c.js => f182954c.0960838f.js} | 2 +- assets/js/f6c5328e.79d8cd99.js | 1 - assets/js/f6c5328e.d1222fb2.js | 1 + ...5d0fe.951db945.js => f905d0fe.7bbb5b94.js} | 2 +- assets/js/main.2bc133f3.js | 2 + ...CENSE.txt => main.2bc133f3.js.LICENSE.txt} | 0 assets/js/main.3a0c36f1.js | 2 - assets/js/runtime~main.ba04c6bc.js | 1 + assets/js/runtime~main.bb1cce72.js | 1 - blog/2018/03/20/introducing-oclif/index.html | 4 +- .../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 +- .../12/05/oclif-eslint-migration/index.html | 4 +- .../index.html | 4 +- .../07/01/pretty-printable-errors/index.html | 4 +- blog/2020/08/26/summer-update/index.html | 4 +- .../03/01/introducing-oclif-core/index.html | 4 +- .../2022/01/12/announcing-oclif-v2/index.html | 4 +- blog/archive/index.html | 4 +- blog/index.html | 4 +- docs/aliases/index.html | 8 ++-- docs/args/index.html | 8 ++-- docs/base_class/index.html | 10 ++--- docs/command_discovery_strategies/index.html | 8 ++-- docs/command_execution/index.html | 6 +-- docs/commands/index.html | 8 ++-- docs/config/index.html | 8 ++-- docs/debugging/index.html | 8 ++-- docs/error_handling/index.html | 23 ++++++----- docs/esm/index.html | 10 ++--- 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 | 24 +++++++++++ docs/flags/index.html | 8 ++-- docs/flexible_taxonomy/index.html | 16 ++++---- docs/generator_commands/index.html | 6 +-- docs/global_flags/index.html | 22 ---------- docs/help_classes/index.html | 23 ++++------- docs/hooks/index.html | 17 ++++---- docs/how_we_work/index.html | 6 +-- docs/index.html | 6 +-- docs/introduction/index.html | 6 +-- docs/jit_plugins/index.html | 10 ++--- docs/json/index.html | 10 ++--- docs/notifications/index.html | 8 ++-- docs/nsis-installer_customization/index.html | 8 ++-- docs/performance/index.html | 40 +++++++++++++++++++ docs/plugin_loading/index.html | 6 +-- docs/plugins/index.html | 8 ++-- docs/prompting/index.html | 8 ++-- docs/related_repos/index.html | 6 +-- docs/releasing/index.html | 8 ++-- docs/running_programmatically/index.html | 19 +++++---- docs/single_command_cli/index.html | 8 ++-- docs/spinner/index.html | 8 ++-- docs/table/index.html | 8 ++-- docs/templates/index.html | 6 +-- docs/testing/index.html | 8 ++-- docs/themes/index.html | 8 ++-- docs/topic_separator/index.html | 8 ++-- docs/topics/index.html | 8 ++-- index.html | 4 +- search/index.html | 4 +- sitemap.xml | 2 +- 122 files changed, 327 insertions(+), 282 deletions(-) rename assets/js/{03a88bad.e2c41b25.js => 03a88bad.e4e218e3.js} (94%) rename assets/js/{03abeb31.92c8b546.js => 03abeb31.6dc74dd5.js} (97%) rename assets/js/{0b218a01.98989636.js => 0b218a01.cfc579ed.js} (98%) create mode 100644 assets/js/104cbb75.6be57dc9.js delete mode 100644 assets/js/104cbb75.b8a0f7f4.js rename assets/js/{19fd9079.e4bcbbe8.js => 19fd9079.96525bdb.js} (96%) create mode 100644 assets/js/1ed4142b.4fd4ea02.js delete mode 100644 assets/js/1ed4142b.b17aa3a9.js delete mode 100644 assets/js/1f61ef73.def02bb5.js create mode 100644 assets/js/1f61ef73.f68119de.js rename assets/js/{2486267b.3eff173f.js => 2486267b.c1b6895d.js} (98%) create mode 100644 assets/js/258a6413.0362cb75.js delete mode 100644 assets/js/258a6413.7571cfa2.js rename assets/js/{2a33acc4.85c45bca.js => 2a33acc4.53e519de.js} (97%) rename assets/js/{2f98ad87.228f4401.js => 2f98ad87.86268d63.js} (99%) rename assets/js/{3042343a.5990f799.js => 3042343a.e28a3ddf.js} (99%) rename assets/js/{30d74566.b0a1e544.js => 30d74566.546b46b6.js} (99%) rename assets/js/{32060389.4ed86e32.js => 32060389.3e131ae3.js} (99%) rename assets/js/{35586d92.d7148524.js => 35586d92.4dc47803.js} (98%) create mode 100644 assets/js/3e452c7e.414162ce.js delete mode 100644 assets/js/3e452c7e.c0a60494.js rename assets/js/{53e18611.8353b2b3.js => 53e18611.0fb9de33.js} (98%) delete mode 100644 assets/js/5d5620c4.42ab4378.js create mode 100644 assets/js/5d5620c4.a2876507.js rename assets/js/{6f3bb722.f0f88331.js => 6f3bb722.02a2f8ab.js} (99%) create mode 100644 assets/js/713bb917.1d45124b.js delete mode 100644 assets/js/713bb917.51bb646a.js rename assets/js/{7bd58895.4f67c193.js => 7bd58895.7df2e0fa.js} (98%) rename assets/js/{82247a8b.0de224a5.js => 82247a8b.b66c0358.js} (99%) create mode 100644 assets/js/8705a681.6ea32481.js delete mode 100644 assets/js/8705a681.b6c93c33.js rename assets/js/{935116ff.c77cc093.js => 935116ff.55edcd25.js} (99%) delete mode 100644 assets/js/935f2afb.48e369fc.js create mode 100644 assets/js/935f2afb.c7a88113.js rename assets/js/{9eaa546a.94067195.js => 9eaa546a.99390459.js} (99%) delete mode 100644 assets/js/a92e169d.12baa570.js rename assets/js/{a96ec439.b2c5e185.js => a96ec439.6aa36911.js} (97%) rename assets/js/{b3cc73c6.5efea308.js => b3cc73c6.60782236.js} (98%) delete mode 100644 assets/js/b4a95747.1177b0ed.js create mode 100644 assets/js/b4a95747.408989e3.js create mode 100644 assets/js/b93366a4.6c311929.js rename assets/js/{c5890d18.455ba959.js => c5890d18.e78a8f29.js} (99%) rename assets/js/{c81fd975.3b60cd10.js => c81fd975.ccf41faf.js} (99%) rename assets/js/{c94a68c1.4f481c6d.js => c94a68c1.4d01cf27.js} (98%) create mode 100644 assets/js/cfacefa6.e6399204.js rename assets/js/{d0e73d62.8abaa7b2.js => d0e73d62.a4548f66.js} (98%) rename assets/js/{d665a578.93367260.js => d665a578.f4539599.js} (97%) rename assets/js/{d9b0bdb4.f64cdb78.js => d9b0bdb4.3747e9d7.js} (96%) rename assets/js/{df1cd967.3a02a917.js => df1cd967.a7094501.js} (97%) rename assets/js/{e360e27f.86e6a8e3.js => e360e27f.a4727791.js} (98%) create mode 100644 assets/js/e3703649.0f40a824.js delete mode 100644 assets/js/e3703649.1ae0b24d.js rename assets/js/{e96c62ed.9a883f86.js => e96c62ed.1fe02f63.js} (98%) rename assets/js/{f182954c.8081666c.js => f182954c.0960838f.js} (97%) delete mode 100644 assets/js/f6c5328e.79d8cd99.js create mode 100644 assets/js/f6c5328e.d1222fb2.js rename assets/js/{f905d0fe.951db945.js => f905d0fe.7bbb5b94.js} (96%) create mode 100644 assets/js/main.2bc133f3.js rename assets/js/{main.3a0c36f1.js.LICENSE.txt => main.2bc133f3.js.LICENSE.txt} (100%) delete mode 100644 assets/js/main.3a0c36f1.js create mode 100644 assets/js/runtime~main.ba04c6bc.js delete mode 100644 assets/js/runtime~main.bb1cce72.js create mode 100644 docs/flag_inheritance/index.html delete mode 100644 docs/global_flags/index.html create mode 100644 docs/performance/index.html diff --git a/404.html b/404.html index 0c168f4a..3d02fa3f 100644 --- a/404.html +++ b/404.html @@ -11,8 +11,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.e2c41b25.js b/assets/js/03a88bad.e4e218e3.js similarity index 94% rename from assets/js/03a88bad.e2c41b25.js rename to assets/js/03a88bad.e4e218e3.js index 182c84da..486b7ce6 100644 --- a/assets/js/03a88bad.e2c41b25.js +++ b/assets/js/03a88bad.e4e218e3.js @@ -1 +1 @@ -"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[8078],{2584:(t,e,n)=>{n.r(e),n.d(e,{assets:()=>d,contentTitle:()=>c,default:()=>l,frontMatter:()=>s,metadata:()=>i,toc:()=>a});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:1711647920,formattedLastUpdatedAt:"Mar 28, 2024",frontMatter:{}},d={},a=[];function u(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)(u,{...t})}):u()}},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],{2584:(t,e,n)=>{n.r(e),n.d(e,{assets:()=>d,contentTitle:()=>c,default:()=>l,frontMatter:()=>s,metadata:()=>i,toc:()=>a});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:1711648030,formattedLastUpdatedAt:"Mar 28, 2024",frontMatter:{}},d={},a=[];function u(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)(u,{...t})}):u()}},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.92c8b546.js b/assets/js/03abeb31.6dc74dd5.js similarity index 97% rename from assets/js/03abeb31.92c8b546.js rename to assets/js/03abeb31.6dc74dd5.js index 6dde5ad1..25b37c38 100644 --- a/assets/js/03abeb31.92c8b546.js +++ b/assets/js/03abeb31.6dc74dd5.js @@ -1 +1 @@ -"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[844],{3680:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>c,contentTitle:()=>d,default:()=>l,frontMatter:()=>s,metadata:()=>r,toc:()=>u});var o=n(4848),i=n(8453);const s={title:"Debugging"},d=void 0,r={id:"debugging",title:"Debugging",description:"Use the debug for debugging. The CLI uses this module for all of its debugging. If you set the environment variable DEBUG=* it will print all the debug output to the screen.",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:1711647920,formattedLastUpdatedAt:"Mar 28, 2024",frontMatter:{title:"Debugging"},sidebar:"docs",previous:{title:"Notifications",permalink:"/docs/notifications"},next:{title:"Flexible Taxonomy",permalink:"/docs/flexible_taxonomy"}},c={},u=[];function a(e){const t={a:"a",code:"code",img:"img",p:"p",...(0,i.R)(),...e.components};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)(t.p,{children:["Use the ",(0,o.jsx)(t.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)(t.code,{children:"DEBUG=*"})," it will print all the debug output to the screen."]}),"\n",(0,o.jsxs)(t.p,{children:["Depending on your shell you may need to escape this with ",(0,o.jsx)(t.code,{children:"DEBUG=\\*"}),". On Windows you can't set environment variables in line, so you'll need to run ",(0,o.jsx)(t.code,{children:"set DEBUG=*"})," before running the command."]}),"\n",(0,o.jsx)(t.p,{children:(0,o.jsx)(t.img,{alt:"debug demo",src:n(1466).A+"",width:"2658",height:"1250"})})]})}function l(e={}){const{wrapper:t}={...(0,i.R)(),...e.components};return t?(0,o.jsx)(t,{...e,children:(0,o.jsx)(a,{...e})}):a(e)}},1466:(e,t,n)=>{n.d(t,{A:()=>o});const o=n.p+"assets/images/debug_demo-efc07abda59d2b82da3fc695b96596c8.png"},8453:(e,t,n)=>{n.d(t,{R:()=>d,x:()=>r});var o=n(6540);const i={},s=o.createContext(i);function d(e){const t=o.useContext(s);return o.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(i):e.components||i:d(e.components),o.createElement(s.Provider,{value:t},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[844],{3680:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>c,contentTitle:()=>d,default:()=>l,frontMatter:()=>s,metadata:()=>r,toc:()=>u});var o=n(4848),i=n(8453);const s={title:"Debugging"},d=void 0,r={id:"debugging",title:"Debugging",description:"Use the debug for debugging. The CLI uses this module for all of its debugging. If you set the environment variable DEBUG=* it will print all the debug output to the screen.",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:1711648030,formattedLastUpdatedAt:"Mar 28, 2024",frontMatter:{title:"Debugging"},sidebar:"docs",previous:{title:"Notifications",permalink:"/docs/notifications"},next:{title:"Flexible Taxonomy",permalink:"/docs/flexible_taxonomy"}},c={},u=[];function a(e){const t={a:"a",code:"code",img:"img",p:"p",...(0,i.R)(),...e.components};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)(t.p,{children:["Use the ",(0,o.jsx)(t.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)(t.code,{children:"DEBUG=*"})," it will print all the debug output to the screen."]}),"\n",(0,o.jsxs)(t.p,{children:["Depending on your shell you may need to escape this with ",(0,o.jsx)(t.code,{children:"DEBUG=\\*"}),". On Windows you can't set environment variables in line, so you'll need to run ",(0,o.jsx)(t.code,{children:"set DEBUG=*"})," before running the command."]}),"\n",(0,o.jsx)(t.p,{children:(0,o.jsx)(t.img,{alt:"debug demo",src:n(1466).A+"",width:"2658",height:"1250"})})]})}function l(e={}){const{wrapper:t}={...(0,i.R)(),...e.components};return t?(0,o.jsx)(t,{...e,children:(0,o.jsx)(a,{...e})}):a(e)}},1466:(e,t,n)=>{n.d(t,{A:()=>o});const o=n.p+"assets/images/debug_demo-efc07abda59d2b82da3fc695b96596c8.png"},8453:(e,t,n)=>{n.d(t,{R:()=>d,x:()=>r});var o=n(6540);const i={},s=o.createContext(i);function d(e){const t=o.useContext(s);return o.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(i):e.components||i:d(e.components),o.createElement(s.Provider,{value:t},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/0b218a01.98989636.js b/assets/js/0b218a01.cfc579ed.js similarity index 98% rename from assets/js/0b218a01.98989636.js rename to assets/js/0b218a01.cfc579ed.js index 292bb9f4..027ebf3e 100644 --- a/assets/js/0b218a01.98989636.js +++ b/assets/js/0b218a01.cfc579ed.js @@ -1 +1 @@ -"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[3454],{6040:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>c,contentTitle:()=>o,default:()=>m,frontMatter:()=>t,metadata:()=>l,toc:()=>r});var a=s(4848),i=s(8453);const t={title:"Aliases"},o=void 0,l={id:"aliases",title:"Aliases",description:"Command Aliases",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:1711647920,formattedLastUpdatedAt:"Mar 28, 2024",frontMatter:{title:"Aliases"},sidebar:"docs",previous:{title:"Just-in-Time Plugin Installation",permalink:"/docs/jit_plugins"},next:{title:"NSIS Installer Customization",permalink:"/docs/nsis-installer_customization"}},c={},r=[{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 d(e){const n={code:"code",h2:"h2",p:"p",pre:"pre",...(0,i.R)(),...e.components};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(n.h2,{id:"command-aliases",children:"Command Aliases"}),"\n",(0,a.jsxs)(n.p,{children:["Aliases let you define a string that maps to a command. This command can be run as ",(0,a.jsx)(n.code,{children:"mycli config"}),", ",(0,a.jsx)(n.code,{children:"mycli config:index"}),", or ",(0,a.jsx)(n.code,{children:"mycli config:list"}),":"]}),"\n",(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.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)(n.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)(n.code,{children:"deprecateAliases"})," to ",(0,a.jsx)(n.code,{children:"true"})," to warn users about the correct name"]}),"\n",(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.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)(n.h2,{id:"flag-aliases",children:"Flag Aliases"}),"\n",(0,a.jsx)(n.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)(n.pre,{children:(0,a.jsx)(n.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)(n.h2,{id:"bin-aliases",children:"Bin Aliases"}),"\n",(0,a.jsxs)(n.p,{children:['Creating a CLI that responds to different names or "aliases" is easy, simply add a ',(0,a.jsx)(n.code,{children:"binAliases"})," property to your CLI's ",(0,a.jsx)(n.code,{children:"oclif"})," property in ",(0,a.jsx)(n.code,{children:"package.json"}),":"]}),"\n",(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.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)(n.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)(n.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)(n.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:n}={...(0,i.R)(),...e.components};return n?(0,a.jsx)(n,{...e,children:(0,a.jsx)(d,{...e})}):d(e)}},8453:(e,n,s)=>{s.d(n,{R:()=>o,x:()=>l});var a=s(6540);const i={},t=a.createContext(i);function o(e){const n=a.useContext(t);return a.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function l(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:o(e.components),a.createElement(t.Provider,{value:n},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[3454],{6040:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>c,contentTitle:()=>o,default:()=>m,frontMatter:()=>t,metadata:()=>l,toc:()=>r});var a=s(4848),i=s(8453);const t={title:"Aliases"},o=void 0,l={id:"aliases",title:"Aliases",description:"Command Aliases",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:1711648030,formattedLastUpdatedAt:"Mar 28, 2024",frontMatter:{title:"Aliases"},sidebar:"docs",previous:{title:"Just-in-Time Plugin Installation",permalink:"/docs/jit_plugins"},next:{title:"NSIS Installer Customization",permalink:"/docs/nsis-installer_customization"}},c={},r=[{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 d(e){const n={code:"code",h2:"h2",p:"p",pre:"pre",...(0,i.R)(),...e.components};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(n.h2,{id:"command-aliases",children:"Command Aliases"}),"\n",(0,a.jsxs)(n.p,{children:["Aliases let you define a string that maps to a command. This command can be run as ",(0,a.jsx)(n.code,{children:"mycli config"}),", ",(0,a.jsx)(n.code,{children:"mycli config:index"}),", or ",(0,a.jsx)(n.code,{children:"mycli config:list"}),":"]}),"\n",(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.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)(n.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)(n.code,{children:"deprecateAliases"})," to ",(0,a.jsx)(n.code,{children:"true"})," to warn users about the correct name"]}),"\n",(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.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)(n.h2,{id:"flag-aliases",children:"Flag Aliases"}),"\n",(0,a.jsx)(n.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)(n.pre,{children:(0,a.jsx)(n.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)(n.h2,{id:"bin-aliases",children:"Bin Aliases"}),"\n",(0,a.jsxs)(n.p,{children:['Creating a CLI that responds to different names or "aliases" is easy, simply add a ',(0,a.jsx)(n.code,{children:"binAliases"})," property to your CLI's ",(0,a.jsx)(n.code,{children:"oclif"})," property in ",(0,a.jsx)(n.code,{children:"package.json"}),":"]}),"\n",(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.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)(n.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)(n.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)(n.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:n}={...(0,i.R)(),...e.components};return n?(0,a.jsx)(n,{...e,children:(0,a.jsx)(d,{...e})}):d(e)}},8453:(e,n,s)=>{s.d(n,{R:()=>o,x:()=>l});var a=s(6540);const i={},t=a.createContext(i);function o(e){const n=a.useContext(t);return a.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function l(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:o(e.components),a.createElement(t.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/104cbb75.6be57dc9.js b/assets/js/104cbb75.6be57dc9.js new file mode 100644 index 00000000..7253aed0 --- /dev/null +++ b/assets/js/104cbb75.6be57dc9.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[6471],{8907:(e,o,n)=>{n.r(o),n.d(o,{assets:()=>s,contentTitle:()=>r,default:()=>m,frontMatter:()=>a,metadata:()=>c,toc:()=>l});var t=n(4848),i=n(8453);const a={title:"Flexible Taxonomy"},r=void 0,c={id:"flexible_taxonomy",title:"Flexible Taxonomy",description:"If you'd like for your customers to execute commands without adhereing to the defined command taxonomy, you can enable flexibleTaxonomy and add a hook to the oclif section of your package.json:",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:1711648030,formattedLastUpdatedAt:"Mar 28, 2024",frontMatter:{title:"Flexible Taxonomy"},sidebar:"docs",previous:{title:"Debugging",permalink:"/docs/debugging"},next:{title:"Flag Inheritance",permalink:"/docs/flag_inheritance"}},s={},l=[{value:"Hook Implementation",id:"hook-implementation",level:3}];function d(e){const o={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)(o.p,{children:["If you'd like for your customers to execute commands without adhereing to the defined command taxonomy, you can enable ",(0,t.jsx)(o.code,{children:"flexibleTaxonomy"})," and add a hook to the ",(0,t.jsx)(o.code,{children:"oclif"})," section of your package.json:"]}),"\n",(0,t.jsx)(o.pre,{children:(0,t.jsx)(o.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)(o.p,{children:"There are two main benefits to enabling flexible taxonomy:"}),"\n",(0,t.jsxs)(o.ol,{children:["\n",(0,t.jsxs)(o.li,{children:["It makes your CLI more user-friendly. For example, you might have a command, ",(0,t.jsx)(o.code,{children:"my-cli foobars list"}),". If a user mistakenly enters ",(0,t.jsx)(o.code,{children:"my-cli list foobars"})," then oclif will automatically know that it should execute ",(0,t.jsx)(o.code,{children:"foobars list"})," instead of throwing an error."]}),"\n",(0,t.jsxs)(o.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)(o.a,{href:"#hook-implementation",children:"Hook Implementation"})," for more details."]}),"\n"]}),"\n",(0,t.jsx)(o.h3,{id:"hook-implementation",children:"Hook Implementation"}),"\n",(0,t.jsxs)(o.p,{children:["When ",(0,t.jsx)(o.code,{children:"flexibleTaxonomy"})," is enabled, oclif will run the ",(0,t.jsx)(o.code,{children:"command_incomplete"})," hook anytime a user enters an incomplete command (e.g. the command is ",(0,t.jsx)(o.code,{children:"one two three"})," but they only entered ",(0,t.jsx)(o.code,{children:"two"}),"). This hook gives you the opportunity to create an interactive user experience."]}),"\n",(0,t.jsxs)(o.p,{children:["This example shows how you can use the ",(0,t.jsx)(o.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)(o.pre,{children:(0,t.jsx)(o.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)(o.p,{children:"This is the prompt that the user would see:"}),"\n",(0,t.jsx)(o.pre,{children:(0,t.jsx)(o.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:o}={...(0,i.R)(),...e.components};return o?(0,t.jsx)(o,{...e,children:(0,t.jsx)(d,{...e})}):d(e)}},8453:(e,o,n)=>{n.d(o,{R:()=>r,x:()=>c});var t=n(6540);const i={},a=t.createContext(i);function r(e){const o=t.useContext(a);return t.useMemo((function(){return"function"==typeof e?e(o):{...o,...e}}),[o,e])}function c(e){let o;return o=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:r(e.components),t.createElement(a.Provider,{value:o},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/104cbb75.b8a0f7f4.js b/assets/js/104cbb75.b8a0f7f4.js deleted file mode 100644 index e457aa37..00000000 --- a/assets/js/104cbb75.b8a0f7f4.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[6471],{8907:(e,o,n)=>{n.r(o),n.d(o,{assets:()=>c,contentTitle:()=>r,default:()=>m,frontMatter:()=>a,metadata:()=>s,toc:()=>l});var t=n(4848),i=n(8453);const a={title:"Flexible Taxonomy"},r=void 0,s={id:"flexible_taxonomy",title:"Flexible Taxonomy",description:"If you'd like for your customers to execute commands without adhereing to the defined command taxonomy, you can enable flexibleTaxonomy and add a hook to the oclif section of your package.json:",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:1711647920,formattedLastUpdatedAt:"Mar 28, 2024",frontMatter:{title:"Flexible Taxonomy"},sidebar:"docs",previous:{title:"Debugging",permalink:"/docs/debugging"},next:{title:"Global Flags",permalink:"/docs/global_flags"}},c={},l=[{value:"Hook Implementation",id:"hook-implementation",level:3}];function d(e){const o={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)(o.p,{children:["If you'd like for your customers to execute commands without adhereing to the defined command taxonomy, you can enable ",(0,t.jsx)(o.code,{children:"flexibleTaxonomy"})," and add a hook to the ",(0,t.jsx)(o.code,{children:"oclif"})," section of your package.json:"]}),"\n",(0,t.jsx)(o.pre,{children:(0,t.jsx)(o.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)(o.p,{children:"There are two main benefits to enabling flexible taxonomy:"}),"\n",(0,t.jsxs)(o.ol,{children:["\n",(0,t.jsxs)(o.li,{children:["It makes your CLI more user-friendly. For example, you might have a command, ",(0,t.jsx)(o.code,{children:"my-cli foobars:list"}),". If a user mistakenly enters ",(0,t.jsx)(o.code,{children:"my-cli list:foobars"})," then oclif will automatically know that it should execute ",(0,t.jsx)(o.code,{children:"foobars:list"})," instead of throwing an error."]}),"\n",(0,t.jsxs)(o.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)(o.a,{href:"#hook-implementation",children:"Hook Implementation"})," for more details."]}),"\n"]}),"\n",(0,t.jsx)(o.h3,{id:"hook-implementation",children:"Hook Implementation"}),"\n",(0,t.jsxs)(o.p,{children:["When ",(0,t.jsx)(o.code,{children:"flexibleTaxonomy"})," is enabled, oclif will run the ",(0,t.jsx)(o.code,{children:"command_incomplete"})," hook anytime a user enters an incomplete command (e.g. the command is ",(0,t.jsx)(o.code,{children:"one:two:three"})," but they only entered ",(0,t.jsx)(o.code,{children:"two"}),"). This hook gives you the opportunity to create an interactive user experience."]}),"\n",(0,t.jsxs)(o.p,{children:["This example shows how you can use the ",(0,t.jsx)(o.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)(o.pre,{children:(0,t.jsx)(o.code,{className:"language-typescript",children:'import { Hook, toConfiguredId, toStandardizedId } from "@oclif/core";\nimport { prompt } from "inquirer";\n\nconst hook: Hook.CommandIncomplete = async function ({\n config,\n matches,\n argv,\n}) {\n const { command } = await prompt<{ command: string }>([\n {\n name: "command",\n type: "list",\n message: "Which of these commands would you like to run?",\n choices: matches.map((p) => toConfiguredId(p.id, config)),\n },\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)(o.p,{children:"This is the prompt that the user would see:"}),"\n",(0,t.jsx)(o.pre,{children:(0,t.jsx)(o.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:o}={...(0,i.R)(),...e.components};return o?(0,t.jsx)(o,{...e,children:(0,t.jsx)(d,{...e})}):d(e)}},8453:(e,o,n)=>{n.d(o,{R:()=>r,x:()=>s});var t=n(6540);const i={},a=t.createContext(i);function r(e){const o=t.useContext(a);return t.useMemo((function(){return"function"==typeof e?e(o):{...o,...e}}),[o,e])}function s(e){let o;return o=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:r(e.components),t.createElement(a.Provider,{value:o},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/19fd9079.e4bcbbe8.js b/assets/js/19fd9079.96525bdb.js similarity index 96% rename from assets/js/19fd9079.e4bcbbe8.js rename to assets/js/19fd9079.96525bdb.js index fd78bfab..45805b40 100644 --- a/assets/js/19fd9079.e4bcbbe8.js +++ b/assets/js/19fd9079.96525bdb.js @@ -1 +1 @@ -"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[8080],{4015:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>a,contentTitle:()=>l,default:()=>u,frontMatter:()=>r,metadata:()=>i,toc:()=>c});var o=n(4848),s=n(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:1711647920,formattedLastUpdatedAt:"Mar 28, 2024",frontMatter:{title:"External Links"},sidebar:"docs",previous:{title:"Examples",permalink:"/docs/examples"},next:{title:"Related Repositories",permalink:"/docs/related_repos"}},a={},c=[];function d(e){const t={a:"a",li:"li",ul:"ul",...(0,s.R)(),...e.components};return(0,o.jsxs)(t.ul,{children:["\n",(0,o.jsx)(t.li,{children:(0,o.jsx)(t.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)(t.li,{children:(0,o.jsx)(t.a,{href:"https://blog.heroku.com/open-cli-framework",children:"Heroku Release Announcement"})}),"\n"]})}function u(e={}){const{wrapper:t}={...(0,s.R)(),...e.components};return t?(0,o.jsx)(t,{...e,children:(0,o.jsx)(d,{...e})}):d(e)}},8453:(e,t,n)=>{n.d(t,{R:()=>l,x:()=>i});var o=n(6540);const s={},r=o.createContext(s);function l(e){const t=o.useContext(r);return o.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function i(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:l(e.components),o.createElement(r.Provider,{value:t},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[8080],{4015:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>a,contentTitle:()=>l,default:()=>u,frontMatter:()=>r,metadata:()=>i,toc:()=>c});var o=n(4848),s=n(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:1711648030,formattedLastUpdatedAt:"Mar 28, 2024",frontMatter:{title:"External Links"},sidebar:"docs",previous:{title:"Examples",permalink:"/docs/examples"},next:{title:"Related Repositories",permalink:"/docs/related_repos"}},a={},c=[];function d(e){const t={a:"a",li:"li",ul:"ul",...(0,s.R)(),...e.components};return(0,o.jsxs)(t.ul,{children:["\n",(0,o.jsx)(t.li,{children:(0,o.jsx)(t.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)(t.li,{children:(0,o.jsx)(t.a,{href:"https://blog.heroku.com/open-cli-framework",children:"Heroku Release Announcement"})}),"\n"]})}function u(e={}){const{wrapper:t}={...(0,s.R)(),...e.components};return t?(0,o.jsx)(t,{...e,children:(0,o.jsx)(d,{...e})}):d(e)}},8453:(e,t,n)=>{n.d(t,{R:()=>l,x:()=>i});var o=n(6540);const s={},r=o.createContext(s);function l(e){const t=o.useContext(r);return o.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function i(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:l(e.components),o.createElement(r.Provider,{value:t},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/1ed4142b.4fd4ea02.js b/assets/js/1ed4142b.4fd4ea02.js new file mode 100644 index 00000000..b9804875 --- /dev/null +++ b/assets/js/1ed4142b.4fd4ea02.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[3782],{32:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>r,contentTitle:()=>l,default:()=>d,frontMatter:()=>s,metadata:()=>a,toc:()=>c});var i=t(4848),o=t(8453);const s={title:"Just-in-Time Plugin Installation"},l=void 0,a={id:"jit_plugins",title:"Just-in-Time Plugin Installation",description:"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.",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:1711648030,formattedLastUpdatedAt:"Mar 28, 2024",frontMatter:{title:"Just-in-Time Plugin Installation"},sidebar:"docs",previous:{title:"Running Commands Programmatically",permalink:"/docs/running_programmatically"},next:{title:"Aliases",permalink:"/docs/aliases"}},r={},c=[];function u(e){const n={a:"a",code:"code",li:"li",ol:"ol",p:"p",pre:"pre",strong:"strong",...(0,o.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(n.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)(n.p,{children:"To use this feature you need to:"}),"\n",(0,i.jsxs)(n.ol,{children:["\n",(0,i.jsxs)(n.li,{children:["Add ",(0,i.jsx)(n.code,{children:"jitPlugins"})," to the ",(0,i.jsx)(n.code,{children:"oclif"})," section of your package.json"]}),"\n"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.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)(n.ol,{start:"2",children:["\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:["Ensure that your build process includes generating a manifest using ",(0,i.jsx)(n.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)(n.code,{children:"--help"})," on those commands without having them installed yet. ",(0,i.jsx)(n.strong,{children:"If the generated manifest doesn't get packed with your CLI, then the feature will not work."})]}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:["Implement the ",(0,i.jsx)(n.code,{children:"jit_plugin_not_installed"})," hook."]}),"\n"]}),"\n"]}),"\n",(0,i.jsxs)(n.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)(n.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)(n.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)(n.p,{children:"Here's an example of how you might implement the hook,"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typescript",children:"import { Hook, Errors, ux } from '@oclif/core';\n\nconst hook: Hook.JitPluginNotInstalled = async function (opts) {\n try {\n const answer = await ux.confirm(`${opts.command.pluginName} not installed. Would you like to install?`)\n if (answer === 'y') {\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(e={}){const{wrapper:n}={...(0,o.R)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(u,{...e})}):u(e)}},8453:(e,n,t)=>{t.d(n,{R:()=>l,x:()=>a});var i=t(6540);const o={},s=i.createContext(o);function l(e){const n=i.useContext(s);return i.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function a(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(o):e.components||o:l(e.components),i.createElement(s.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/1ed4142b.b17aa3a9.js b/assets/js/1ed4142b.b17aa3a9.js deleted file mode 100644 index f7edab2f..00000000 --- a/assets/js/1ed4142b.b17aa3a9.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[3782],{32:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>r,contentTitle:()=>l,default:()=>d,frontMatter:()=>s,metadata:()=>a,toc:()=>c});var i=t(4848),o=t(8453);const s={title:"Just-in-Time Plugin Installation"},l=void 0,a={id:"jit_plugins",title:"Just-in-Time Plugin Installation",description:"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.",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:1711647920,formattedLastUpdatedAt:"Mar 28, 2024",frontMatter:{title:"Just-in-Time Plugin Installation"},sidebar:"docs",previous:{title:"Running Commands Programmatically",permalink:"/docs/running_programmatically"},next:{title:"Aliases",permalink:"/docs/aliases"}},r={},c=[];function u(e){const n={code:"code",li:"li",ol:"ol",p:"p",pre:"pre",strong:"strong",...(0,o.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(n.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)(n.p,{children:"To use this feature you need to:"}),"\n",(0,i.jsxs)(n.ol,{children:["\n",(0,i.jsxs)(n.li,{children:["Add ",(0,i.jsx)(n.code,{children:"jitPlugins"})," to the ",(0,i.jsx)(n.code,{children:"oclif"})," section of your package.json"]}),"\n"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.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)(n.ol,{start:"2",children:["\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:["Ensure that your build process includes generating a manifest using ",(0,i.jsx)(n.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)(n.code,{children:"--help"})," on those commands without having them installed yet. ",(0,i.jsx)(n.strong,{children:"If the generated manifest doesn't get packed with your CLI, then the feature will not work."})]}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:["Implement the ",(0,i.jsx)(n.code,{children:"jit_plugin_not_installed"})," hook."]}),"\n"]}),"\n"]}),"\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.code,{children:"@oclif/core"})," 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 hooks so that you can design the exact user experience you want your users to have."]}),"\n",(0,i.jsx)(n.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)(n.p,{children:"Here's an example of how you might implement the hook,"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typescript",children:"import { Hook, CLIError, ux } from '@oclif/core';\n\nconst hook: Hook<'jit_plugin_not_installed'> = async function (opts) {\n try {\n const answer = await ux.confirm(`${opts.command.pluginName} not installed. Would you like to install?`)\n if (answer === 'y') {\n await opts.config.runCommand('plugins:install', [`${opts.command.pluginName}@${opts.pluginVersion}`]);\n }\n } catch (error) {\n throw new CLIError(`Could not install ${opts.command.pluginName}`, 'JitPluginInstallError');\n }\n};\n\nexport default hook;\n\n"})})]})}function d(e={}){const{wrapper:n}={...(0,o.R)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(u,{...e})}):u(e)}},8453:(e,n,t)=>{t.d(n,{R:()=>l,x:()=>a});var i=t(6540);const o={},s=i.createContext(o);function l(e){const n=i.useContext(s);return i.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function a(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(o):e.components||o:l(e.components),i.createElement(s.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/1f61ef73.def02bb5.js b/assets/js/1f61ef73.def02bb5.js deleted file mode 100644 index 86df3579..00000000 --- a/assets/js/1f61ef73.def02bb5.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[5082],{492:(e,n,r)=>{r.r(n),r.d(n,{assets:()=>i,contentTitle:()=>s,default:()=>h,frontMatter:()=>c,metadata:()=>a,toc:()=>d});var o=r(4848),t=r(8453);const c={title:"Error Handling"},s=void 0,a={id:"error_handling",title:"Error Handling",description:"oclif handles intentionally - and unintentionally - thrown errors in two places. First in the Command.catch method and then, finally, in the bin/run 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.",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:1711647920,formattedLastUpdatedAt:"Mar 28, 2024",frontMatter:{title:"Error Handling"},sidebar:"docs",previous:{title:"Help Classes",permalink:"/docs/help_classes"},next:{title:"JSON",permalink:"/docs/json"}},i={},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 bin/run ",(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 Custom Base Class (",(0,o.jsx)(n.a,{href:"https://oclif.io/docs/base_class#docsNav",children:"https://oclif.io/docs/base_class#docsNav"}),") 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 ./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 here in the bin/run.js ",(0,o.jsx)(n.code,{children:"catch"})," handler."]}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-js",children:".catch(require('@oclif/core/handle'))\n"})}),"\n",(0,o.jsxs)(n.p,{children:["This catch handler uses the ",(0,o.jsx)(n.code,{children:"@oclif/errors/handle"})," function to display (and cleanup, if necessary) the error to the user. This handler can be swapped for any function that receives an error argument."]}),"\n",(0,o.jsxs)(n.p,{children:["If you chose to implement your own handler here, we still recommend you delegate finally to the ",(0,o.jsx)(n.code,{children:"@oclif/core/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 const oclifHandler = require('@oclif/core/handle');\n // do any extra work with error\n return oclifHandler(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:()=>s,x:()=>a});var o=r(6540);const t={},c=o.createContext(t);function s(e){const n=o.useContext(c);return o.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function a(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(t):e.components||t:s(e.components),o.createElement(c.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/1f61ef73.f68119de.js b/assets/js/1f61ef73.f68119de.js new file mode 100644 index 00000000..d906ad4e --- /dev/null +++ b/assets/js/1f61ef73.f68119de.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[5082],{492:(e,n,r)=>{r.r(n),r.d(n,{assets:()=>a,contentTitle:()=>s,default:()=>h,frontMatter:()=>c,metadata:()=>i,toc:()=>d});var o=r(4848),t=r(8453);const c={title:"Error Handling"},s=void 0,i={id:"error_handling",title:"Error Handling",description:"oclif handles intentionally - and unintentionally - thrown errors in two places. First in the Command.catch method and then, finally, in the bin/run.js 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.",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:1711648030,formattedLastUpdatedAt:"Mar 28, 2024",frontMatter:{title:"Error Handling"},sidebar:"docs",previous:{title:"Help Classes",permalink:"/docs/help_classes"},next:{title:"JSON",permalink:"/docs/json"}},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:()=>s,x:()=>i});var o=r(6540);const t={},c=o.createContext(t);function s(e){const n=o.useContext(c);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(t):e.components||t:s(e.components),o.createElement(c.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/2486267b.3eff173f.js b/assets/js/2486267b.c1b6895d.js similarity index 98% rename from assets/js/2486267b.3eff173f.js rename to assets/js/2486267b.c1b6895d.js index 6748f40f..44f82f20 100644 --- a/assets/js/2486267b.3eff173f.js +++ b/assets/js/2486267b.c1b6895d.js @@ -1 +1 @@ -"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[9e3],{7413:(e,t,s)=>{s.r(t),s.d(t,{assets:()=>a,contentTitle:()=>r,default:()=>p,frontMatter:()=>i,metadata:()=>c,toc:()=>d});var n=s(4848),o=s(8453);const i={title:"Spinner"},r=void 0,c={id:"spinner",title:"Spinner",description:"@oclif/core provides a simple ux.action, for more complex progress indicators we recommend using the listr library.",source:"@site/../docs/spinner.md",sourceDirName:".",slug:"/spinner",permalink:"/docs/spinner",draft:!1,unlisted:!1,editUrl:"https://github.com/oclif/oclif.github.io/tree/docs/docs/../docs/spinner.md",tags:[],version:"current",lastUpdatedBy:"Mike Donnalley",lastUpdatedAt:1711647920,formattedLastUpdatedAt:"Mar 28, 2024",frontMatter:{title:"Spinner"},sidebar:"docs",previous:{title:"Prompting",permalink:"/docs/prompting"},next:{title:"Table",permalink:"/docs/table"}},a={},d=[{value:"ux.action",id:"uxaction",level:2},{value:"listr",id:"listr",level:2}];function l(e){const t={a:"a",code:"code",h2:"h2",img:"img",p:"p",pre:"pre",...(0,o.R)(),...e.components};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(t.p,{children:[(0,n.jsx)(t.a,{href:"https://github.com/oclif/core",children:"@oclif/core"})," provides a simple ",(0,n.jsx)(t.code,{children:"ux.action"}),", for more complex progress indicators we recommend using the ",(0,n.jsx)(t.a,{href:"https://www.npmjs.com/package/listr",children:"listr"})," library."]}),"\n",(0,n.jsx)(t.h2,{id:"uxaction",children:(0,n.jsx)(t.code,{children:"ux.action"})}),"\n",(0,n.jsx)(t.p,{children:"Shows a basic spinner"}),"\n",(0,n.jsx)(t.pre,{children:(0,n.jsx)(t.code,{className:"language-typescript",children:"import {Command, ux} from '@oclif/core'\n\nexport class MyCommand extends Command {\n async run() {\n // start the spinner\n ux.action.start('starting a process')\n // do some action...\n // stop the spinner\n ux.action.stop() // shows 'starting a process... done'\n\n // show on stdout instead of stderr\n ux.action.start('starting a process', 'initializing', {stdout: true})\n // do some action...\n // stop the spinner with a custom message\n ux.action.stop('custom message') // shows 'starting a process... custom message'\n }\n}\n"})}),"\n",(0,n.jsx)(t.p,{children:"This degrades gracefully when not connected to a TTY. It queues up any writes to stdout/stderr so they are displayed above the spinner."}),"\n",(0,n.jsx)(t.p,{children:(0,n.jsx)(t.img,{alt:"action demo",src:s(262).A+"",width:"563",height:"271"})}),"\n",(0,n.jsx)(t.h2,{id:"listr",children:"listr"}),"\n",(0,n.jsxs)(t.p,{children:["Here is an example of the complex workflows supported by ",(0,n.jsx)(t.a,{href:"https://www.npmjs.com/package/listr",children:"listr"}),"."]}),"\n",(0,n.jsx)(t.p,{children:(0,n.jsx)(t.img,{alt:"listr demo",src:s(1146).A+"",width:"1177",height:"709"})})]})}function p(e={}){const{wrapper:t}={...(0,o.R)(),...e.components};return t?(0,n.jsx)(t,{...e,children:(0,n.jsx)(l,{...e})}):l(e)}},262:(e,t,s)=>{s.d(t,{A:()=>n});const n=s.p+"assets/images/action-3dc2f1c9da2526e7dacc7ba55a2e3f5a.gif"},1146:(e,t,s)=>{s.d(t,{A:()=>n});const n=s.p+"assets/images/listr-fb034a43c5d3159c331547ffba3b6559.gif"},8453:(e,t,s)=>{s.d(t,{R:()=>r,x:()=>c});var n=s(6540);const o={},i=n.createContext(o);function r(e){const t=n.useContext(i);return n.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function c(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(o):e.components||o:r(e.components),n.createElement(i.Provider,{value:t},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[9e3],{7413:(e,t,s)=>{s.r(t),s.d(t,{assets:()=>a,contentTitle:()=>r,default:()=>p,frontMatter:()=>i,metadata:()=>c,toc:()=>d});var n=s(4848),o=s(8453);const i={title:"Spinner"},r=void 0,c={id:"spinner",title:"Spinner",description:"@oclif/core provides a simple ux.action, for more complex progress indicators we recommend using the listr library.",source:"@site/../docs/spinner.md",sourceDirName:".",slug:"/spinner",permalink:"/docs/spinner",draft:!1,unlisted:!1,editUrl:"https://github.com/oclif/oclif.github.io/tree/docs/docs/../docs/spinner.md",tags:[],version:"current",lastUpdatedBy:"Mike Donnalley",lastUpdatedAt:1711648030,formattedLastUpdatedAt:"Mar 28, 2024",frontMatter:{title:"Spinner"},sidebar:"docs",previous:{title:"Prompting",permalink:"/docs/prompting"},next:{title:"Table",permalink:"/docs/table"}},a={},d=[{value:"ux.action",id:"uxaction",level:2},{value:"listr",id:"listr",level:2}];function l(e){const t={a:"a",code:"code",h2:"h2",img:"img",p:"p",pre:"pre",...(0,o.R)(),...e.components};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(t.p,{children:[(0,n.jsx)(t.a,{href:"https://github.com/oclif/core",children:"@oclif/core"})," provides a simple ",(0,n.jsx)(t.code,{children:"ux.action"}),", for more complex progress indicators we recommend using the ",(0,n.jsx)(t.a,{href:"https://www.npmjs.com/package/listr",children:"listr"})," library."]}),"\n",(0,n.jsx)(t.h2,{id:"uxaction",children:(0,n.jsx)(t.code,{children:"ux.action"})}),"\n",(0,n.jsx)(t.p,{children:"Shows a basic spinner"}),"\n",(0,n.jsx)(t.pre,{children:(0,n.jsx)(t.code,{className:"language-typescript",children:"import {Command, ux} from '@oclif/core'\n\nexport class MyCommand extends Command {\n async run() {\n // start the spinner\n ux.action.start('starting a process')\n // do some action...\n // stop the spinner\n ux.action.stop() // shows 'starting a process... done'\n\n // show on stdout instead of stderr\n ux.action.start('starting a process', 'initializing', {stdout: true})\n // do some action...\n // stop the spinner with a custom message\n ux.action.stop('custom message') // shows 'starting a process... custom message'\n }\n}\n"})}),"\n",(0,n.jsx)(t.p,{children:"This degrades gracefully when not connected to a TTY. It queues up any writes to stdout/stderr so they are displayed above the spinner."}),"\n",(0,n.jsx)(t.p,{children:(0,n.jsx)(t.img,{alt:"action demo",src:s(262).A+"",width:"563",height:"271"})}),"\n",(0,n.jsx)(t.h2,{id:"listr",children:"listr"}),"\n",(0,n.jsxs)(t.p,{children:["Here is an example of the complex workflows supported by ",(0,n.jsx)(t.a,{href:"https://www.npmjs.com/package/listr",children:"listr"}),"."]}),"\n",(0,n.jsx)(t.p,{children:(0,n.jsx)(t.img,{alt:"listr demo",src:s(1146).A+"",width:"1177",height:"709"})})]})}function p(e={}){const{wrapper:t}={...(0,o.R)(),...e.components};return t?(0,n.jsx)(t,{...e,children:(0,n.jsx)(l,{...e})}):l(e)}},262:(e,t,s)=>{s.d(t,{A:()=>n});const n=s.p+"assets/images/action-3dc2f1c9da2526e7dacc7ba55a2e3f5a.gif"},1146:(e,t,s)=>{s.d(t,{A:()=>n});const n=s.p+"assets/images/listr-fb034a43c5d3159c331547ffba3b6559.gif"},8453:(e,t,s)=>{s.d(t,{R:()=>r,x:()=>c});var n=s(6540);const o={},i=n.createContext(o);function r(e){const t=n.useContext(i);return n.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function c(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(o):e.components||o:r(e.components),n.createElement(i.Provider,{value:t},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/258a6413.0362cb75.js b/assets/js/258a6413.0362cb75.js new file mode 100644 index 00000000..32f3b8b2 --- /dev/null +++ b/assets/js/258a6413.0362cb75.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[3651],{5453:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>r,contentTitle:()=>c,default:()=>m,frontMatter:()=>i,metadata:()=>a,toc:()=>l});var o=n(4848),s=n(8453);const i={title:"Single Command CLI"},c=void 0,a={id:"single_command_cli",title:"Single Command CLI",description:"Sometimes you may want your CLI's executable to also be the only command, similar to many bash utilities like ls or cat.",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:1711648030,formattedLastUpdatedAt:"Mar 28, 2024",frontMatter:{title:"Single Command CLI"},sidebar:"docs",previous:{title:"Flag Inheritance",permalink:"/docs/flag_inheritance"},next:{title:"ESM",permalink:"/docs/esm"}},r={},l=[];function d(e){const t={a:"a",code:"code",p:"p",pre:"pre",...(0,s.R)(),...e.components};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)(t.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)(t.code,{children:"ls"})," or ",(0,o.jsx)(t.code,{children:"cat"}),"."]}),"\n",(0,o.jsxs)(t.p,{children:["To support this, you will need to put your command logic into ",(0,o.jsx)(t.code,{children:"src/index.ts"})," and add the following to the oclif section of your package.json:"]}),"\n",(0,o.jsx)(t.pre,{children:(0,o.jsx)(t.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)(t.p,{children:["where ",(0,o.jsx)(t.code,{children:"./dist/index.js"})," is a file that exports a ",(0,o.jsx)(t.code,{children:"Command"})," class. See ",(0,o.jsx)(t.a,{href:"./command_discovery_strategies",children:"Command Discovery Strategies"})," for more details."]})]})}function m(e={}){const{wrapper:t}={...(0,s.R)(),...e.components};return t?(0,o.jsx)(t,{...e,children:(0,o.jsx)(d,{...e})}):d(e)}},8453:(e,t,n)=>{n.d(t,{R:()=>c,x:()=>a});var o=n(6540);const s={},i=o.createContext(s);function c(e){const t=o.useContext(i);return o.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function a(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:c(e.components),o.createElement(i.Provider,{value:t},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/258a6413.7571cfa2.js b/assets/js/258a6413.7571cfa2.js deleted file mode 100644 index 64b905d9..00000000 --- a/assets/js/258a6413.7571cfa2.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[3651],{5453:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>l,contentTitle:()=>c,default:()=>m,frontMatter:()=>i,metadata:()=>a,toc:()=>r});var o=n(4848),s=n(8453);const i={title:"Single Command CLI"},c=void 0,a={id:"single_command_cli",title:"Single Command CLI",description:"Sometimes you may want your CLI's executable to also be the only command, similar to many bash utilities like ls or cat.",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:1711647920,formattedLastUpdatedAt:"Mar 28, 2024",frontMatter:{title:"Single Command CLI"},sidebar:"docs",previous:{title:"Global Flags",permalink:"/docs/global_flags"},next:{title:"ESM",permalink:"/docs/esm"}},l={},r=[];function d(e){const t={a:"a",code:"code",p:"p",pre:"pre",...(0,s.R)(),...e.components};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)(t.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)(t.code,{children:"ls"})," or ",(0,o.jsx)(t.code,{children:"cat"}),"."]}),"\n",(0,o.jsxs)(t.p,{children:["To support this, you will need to put your command logic into ",(0,o.jsx)(t.code,{children:"src/index.ts"})," and add the following to the oclif section of your package.json:"]}),"\n",(0,o.jsx)(t.pre,{children:(0,o.jsx)(t.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)(t.p,{children:["See ",(0,o.jsx)(t.a,{href:"./command_discovery_strategies",children:"Command Discovery Strategies"})," for more details."]})]})}function m(e={}){const{wrapper:t}={...(0,s.R)(),...e.components};return t?(0,o.jsx)(t,{...e,children:(0,o.jsx)(d,{...e})}):d(e)}},8453:(e,t,n)=>{n.d(t,{R:()=>c,x:()=>a});var o=n(6540);const s={},i=o.createContext(s);function c(e){const t=o.useContext(i);return o.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function a(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:c(e.components),o.createElement(i.Provider,{value:t},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/2a33acc4.85c45bca.js b/assets/js/2a33acc4.53e519de.js similarity index 97% rename from assets/js/2a33acc4.85c45bca.js rename to assets/js/2a33acc4.53e519de.js index 7cd164e0..dbe32070 100644 --- a/assets/js/2a33acc4.85c45bca.js +++ b/assets/js/2a33acc4.53e519de.js @@ -1 +1 @@ -"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[1427],{2130:(e,t,s)=>{s.r(t),s.d(t,{assets:()=>a,contentTitle:()=>c,default:()=>l,frontMatter:()=>n,metadata:()=>r,toc:()=>d});var o=s(4848),i=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:1711647920,formattedLastUpdatedAt:"Mar 28, 2024",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,i.R)(),...e.components};return(0,o.jsxs)(o.Fragment,{children:[(0,o.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,o.jsx)(t.code,{children:"sf config"})," with commands like ",(0,o.jsx)(t.code,{children:"sf config set"})," and ",(0,o.jsx)(t.code,{children:"sf config get"}),". The directory structure looks like this:"]}),"\n",(0,o.jsx)(t.pre,{children:(0,o.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,o.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,o.jsx)(t.code,{children:"package.json"})," like so:"]}),"\n",(0,o.jsx)(t.pre,{children:(0,o.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,o.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,i.R)(),...e.components};return t?(0,o.jsx)(t,{...e,children:(0,o.jsx)(p,{...e})}):p(e)}},8453:(e,t,s)=>{s.d(t,{R:()=>c,x:()=>r});var o=s(6540);const i={},n=o.createContext(i);function c(e){const t=o.useContext(n);return o.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(i):e.components||i:c(e.components),o.createElement(n.Provider,{value:t},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[1427],{2130:(e,t,s)=>{s.r(t),s.d(t,{assets:()=>a,contentTitle:()=>c,default:()=>l,frontMatter:()=>n,metadata:()=>r,toc:()=>d});var o=s(4848),i=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:1711648030,formattedLastUpdatedAt:"Mar 28, 2024",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,i.R)(),...e.components};return(0,o.jsxs)(o.Fragment,{children:[(0,o.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,o.jsx)(t.code,{children:"sf config"})," with commands like ",(0,o.jsx)(t.code,{children:"sf config set"})," and ",(0,o.jsx)(t.code,{children:"sf config get"}),". The directory structure looks like this:"]}),"\n",(0,o.jsx)(t.pre,{children:(0,o.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,o.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,o.jsx)(t.code,{children:"package.json"})," like so:"]}),"\n",(0,o.jsx)(t.pre,{children:(0,o.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,o.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,i.R)(),...e.components};return t?(0,o.jsx)(t,{...e,children:(0,o.jsx)(p,{...e})}):p(e)}},8453:(e,t,s)=>{s.d(t,{R:()=>c,x:()=>r});var o=s(6540);const i={},n=o.createContext(i);function c(e){const t=o.useContext(n);return o.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(i):e.components||i:c(e.components),o.createElement(n.Provider,{value:t},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/2f98ad87.228f4401.js b/assets/js/2f98ad87.86268d63.js similarity index 99% rename from assets/js/2f98ad87.228f4401.js rename to assets/js/2f98ad87.86268d63.js index 2551f5c0..4709785d 100644 --- a/assets/js/2f98ad87.228f4401.js +++ b/assets/js/2f98ad87.86268d63.js @@ -1 +1 @@ -"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[8664],{2678:(e,n,o)=>{o.r(n),o.d(n,{assets:()=>i,contentTitle:()=>c,default:()=>m,frontMatter:()=>a,metadata:()=>l,toc:()=>s});var r=o(4848),t=o(8453);const a={title:"Generator Commands"},c=void 0,l={id:"generator_commands",title:"Generator Commands",description:"- oclif generate NAME",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:1711647920,formattedLastUpdatedAt:"Mar 28, 2024",frontMatter:{title:"Generator Commands"},sidebar:"docs",previous:{title:"FAQs",permalink:"/docs/faqs"},next:{title:"Templates",permalink:"/docs/templates"}},i={},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,t.R)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.a,{href:"#oclif-generate-name",children:(0,r.jsx)(n.code,{children:"oclif generate NAME"})})}),"\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.a,{href:"#oclif-generate-command-name",children:(0,r.jsx)(n.code,{children:"oclif generate command NAME"})})}),"\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.a,{href:"#oclif-generate-hook-name",children:(0,r.jsx)(n.code,{children:"oclif generate hook NAME"})})}),"\n"]}),"\n",(0,r.jsx)(n.h2,{id:"oclif-generate-name",children:(0,r.jsx)(n.code,{children:"oclif generate NAME"})}),"\n",(0,r.jsx)(n.p,{children:"Generate a new CLI"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{children:"USAGE\n $ oclif generate NAME [-y] [--author ] [--bin ] [--description ] [--license ]\n [--module-type CommonJS|ESM] [--name ] [--owner ] [--package-manager npm|yarn] [--repository ]\n [-d ]\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=