oclif is an open source framework for building a command line interface (CLI) in Node.js.
Questions tagged [oclif]
38 questions
1
vote
1 answer
How do I programatically read the version of a currently running oclif app?
This title says it all: How do I programatically read the version of a currently running oclif command-line app (from within the app)?

neu242
- 15,796
- 20
- 79
- 114
1
vote
0 answers
terminal window in web page with OCLIF
I have an existing cli with OCLIF. I'd like to embed the cli in an angular web application. Is this possible? How might I start this? I started looking at xterm.js. Can these two technologies be combined? If not OCLIF what other librbaries…

Ken
- 1,529
- 12
- 12
1
vote
2 answers
how do you launch oclif tests with debugging using vscode?
What does the launch.json look like to run oclif project tests in debug mode? I can't seem to get it so that I set breakpoints and step in.

Ken
- 1,529
- 12
- 12
1
vote
0 answers
Why oclif-dev manifest command is executing source code?
oclif-dev manifest will execute your source code, why is this happening?
Step to reproduce:
run npx oclif multi mynewcli
create an index.ts file under root folder src/app/index.ts
you put console.log("test..."); inside the index.ts file
import the…

Joseph
- 3,974
- 7
- 34
- 67
1
vote
1 answer
How can I test oclif CLI that consumes Rest API
How can I test the following code build using Typescript in Oclif? This CLI consumes a rest api build with node.js and express.js. I am testing my api with mocha/chai which I have become familiar with. However, I saw the example on the oclif site…
user12610369
1
vote
1 answer
Including parameters seperated by space in Oclif CLI
I am trying to build a CLI that consumes a Rest API using oclif.
My code is the following:
import Command from '@oclif/command'
import axios from 'axios'
export class AggregatedCommand extends Command {
static args = [
{name: 'Area',…
user12610369
1
vote
2 answers
Install Local Plugin
I generated a multi-command CLI using npx oclif multi mynewcli. I'm trying to install the default plugin created using npx oclif plugin mynewplugin as referenced here. I don't know see any documentation on how to actually do that though. Is there…

Mojo982
- 117
- 1
- 10
1
vote
0 answers
Oclif cli released as a tarball: How to auto link the command to the bashRc without having to write "npm link"?
I am trying to release a cli built with oclif as a tarball. In the local env, I need to write npm link to link the code with the command. But in prod, I do not want the user to open a terminal and write npm link after he downloaded the zip.
It…

Albert Louzon
- 11
- 1
1
vote
1 answer
How can I create Git-style subcommands with oclif?
I'm writing a CLI using Heroku's CLI framework oclif. It works great, but I would like to have Git-like subcommands, something like that:
$ mycli mycommand subcommand
$ mycli mycommand subcommand --flags="are awesome"
$ mycli mycommand…

Joel Jucá
- 23
- 5
1
vote
1 answer
How to force --help command to execute in run method in Oclif
My requirement is quite simple. I want to execute help command when a user executes a specific command without enough arguments.
async run() {
if (!args.name) {
this.log(please provide a project name.)
// help ()
}
}

Nipuna Prashan
- 91
- 9
1
vote
1 answer
How to display db retrieved data in table in oclif-cli like mysql-client-cli?
I am developing a CLI tool using OCLIF Framework and TypeScript, I have command that returns all the values from the database , Everything works fine until the retrieval , How ever I wanted the retrieved data to be displayed like tables in the…

Mahesh Kumaran
- 887
- 2
- 12
- 30
0
votes
0 answers
using oclif how can i have flags at runtime that are not precompiled?
i want to add a command like mycli --foo=bar where foo is not predefined in the static flags definitions. When i try, i always get errors like "Unexpected argument". I have added code to examine the argv returned by parse but the command fails…

linojon
- 1,052
- 1
- 10
- 19
0
votes
0 answers
How to Keep Base Command Using plugin-plugins?
Currently, I have a been trying to install a plugin, but the 2 plugins have similar commands and I would like to keep the base command of the plugin I've installed. Adding an extra command to the plugin is hacky and is not a good dev experience.…
0
votes
0 answers
How to create different commands as alias with oclif?
Oclif can create multiple commands like these:
mycli do1
mycli do2
mycli do3
I want to get alias for the above commands:
myclido1 # alias for 'mycli do1'
myclido2
myclido3
Is possible for oclif to create such alias? Or only using a script to…

Henry
- 1,077
- 1
- 16
- 41
0
votes
0 answers
How to make electron app supports CLI, embed oclif project?
I built an CLI app using oclif, and is planning to support desktop app using electron.
I am wondering if it's possible to let electron supports CLI without opening a window.
It would be the best if I can reuse existing oclif code in the electron…

Huakun Shen
- 312
- 2
- 9