Questions tagged [cli]
A command-line interface (CLI) is a mechanism for interacting with a computer operating system or software by typing commands to perform specific tasks.
40 questions
4
votes
3
answers
297
views
The applicability of functional core - imperative shell to a cli program which contains a wrapper around a binary
Not long ago while I was exploring for solutions to test without mocks I've found out about the functional core, imperative shell architecture. It sounds great, I also think that it would play nicely ...
2
votes
1
answer
224
views
Problems with designing an intuitive cli experience
Warning: This may be a stupid/atypical question but I just don't know what to do. Any suggestion is welcome when it comes to change the existing behavior as long as the features are the same.
The ...
13
votes
7
answers
3k
views
How are applications where any command can be run CLI, but also has a UI element, structured?
Sorry if the title sounds too broad, I'll try to clarify. I am trying to understand the structure of applications that have a GUI, but any action can also be run from a CLI (either integrated in the ...
-3
votes
2
answers
5k
views
Is it better practice to set default values for optional argparse arguments?
I mention python's argparse as an example but this would apply to any CLI argument parser library for any language. Just generally speaking, at a high level, if there are a lot of optional arguments ...
0
votes
3
answers
438
views
Adding a CLI to a Windows service
I have a Windows service that I would like to extend and add a CLI to it similar to docker or Elastic Agent, so I have a question about what kind of approach I should use for the *.exe to communicate ...
-1
votes
1
answer
246
views
Why have a path argument when there is cwd
When writing a program that uses a working directory, e.g., PostgreSQL data directory or download target for wget, is there an advantage of having a CLI argument (or an environment variable) for such ...
2
votes
2
answers
230
views
Is there a canonical way to format 'usage' output for a cli script?
I have a python script that is supposed to be used as a small cli program.
This is google's recommendations on how to document cli syntax. I was wondering, are there similar recommendations, or ...
2
votes
2
answers
131
views
Dynamic loading of objects defined during development for a running system
So I have a design/architectural question. I want to develop a pattern in a programming language that is able to allow a app command-line shell to send commands to a running application to create ...
-2
votes
1
answer
164
views
Event loop for console input
I have a server application that runs in an infinite loop, only reacting to SIGINT. It is put inside a screen process. If I have to make any changes (reload configuration, add new plugins, etc) I ...
-3
votes
1
answer
236
views
How does a site API determine the difference between a user and program request in a browser?
So this is in regards to scraping yes; no language in particular. Some sites allow you to see a JSON modal if you pull it directly from a web browser. But, at any notion a program is used, immediately ...
2
votes
1
answer
210
views
Parsing complex object-like parameters via CLI arguments
Say we have an API that accepts a list of objects. Something like:
{
"family": "Does",
"contact_details": [
{
"name": "John&...
1
vote
2
answers
148
views
How to write documentation for CLI app that requires stdin?
I am writing CLI program that can accept very long strings. For this reason I decided to pipe the data into the program as I would hit limitation of the shell / OS.
How should these CLI program ...
0
votes
1
answer
1k
views
How to launch a detached child process in Node, and reuse it on subsequent executions if already running?
I want to write a Node CLI that leaves a server/daemon running in the background, so subsequent calls to the CLI are much faster, as it can just print the latest info from the daemon (which is already ...
1
vote
1
answer
66
views
CLI and Lib package, where to put module loading code
My Software contains a lib package, a cli package and an arbitrary number of plugin packages.
The plugin packages do the algorithmic work.
The lib package basically just executes the plugins and ...
1
vote
2
answers
323
views
Is MVC an architectural pattern for user-interactive applications only?
Is it correct that MVC is an architectural pattern only for user-interactive applications? (That is my understanding.)
An application can interact with users via GUI or CLI.
Does MVC apply to both ...