Command line tool with user interface

command line interface
types of command line interface
command line interface windows
command driven interface
command line commands
graphical user interface
command line windows

I created a command line tool. I have my project almost done, but now I need to create an user interface to ask for user credentials. Is possible to add a window to my command line project, or I have to create a cocoa application to do that?

A command-line tool won't have a connection to the window server (that's done by NSApplication), so no, it can't create a window. If you need to show a window for any reason, it probably should be an application at that point anyway, so you should go with that and make it one.

Command Line Tools for Developers, (“Are you sure you want to proceed with the installation from unverified source?”) Then, there are textual user interfaces (TUIs), which are interactive GUI apps� The command-line interface was used decades before the graphical user interface (GUI). However, its speed and versatility still make it a popular choice today. Pick your command-line interface. MS-DOS, Powershell and Bash are popular.

A Cocoa App would work. I haven't used Tcl/Tk or MacRuby, but if you're brand new to Cocoa you might have an easier time picking them up.

You can't do this in AppleScript without using AppKit APIs; see Prompt user for password with dialog window when using sudo.

If you're really asking an Xcode question, you might want to repost something more specific, like "how do I convert my Command-Line project so I can add a Cocoa window."

Building Beautiful Command Line Interfaces with Python, While Command line interface is a user interface that is navigated by typing Building these command-line interfaces and tools is extremely� AWS Documentation AWS Command Line Interface User Guide Additional Documentation and Resources Using the examples About Amazon Web Services The AWS Command Line Interface (AWS CLI) is an open source tool that enables you to interact with AWS services using commands in your command-line shell.

Yea Peter is right, you should make it into an application but that doesn't mean you need to convert the tool into a Cocoa app, you can keep a command line tool alive with a UI by utilising the NSApplication class but not using NSApplicationMain() to launch it. In your situation however I don't think this is the necessary method but anyway here is how I displayed a window in a command line tool:

@interface CustomAppClass : NSApplication
    @property (strong) NSWindow *theWindow;
@implementation CustomAppClass {
    BOOL terminate;

- (void)finishLaunching {
    /* Draw windows and stuff */
    self.theWindow = [[NSWindow alloc] initWithContentRect:NSMakeRect(0, 0, 300, 200) styleMask:NSWindowStyleMaskTitled | NSWindowStyleMaskClosable | NSWindowStyleMaskMiniaturizable | NSWindowStyleMaskResizable backing:NSBackingStoreBuffered defer:NO];
    [self.theWindow setTitle:@"Why Hello There!"];
    [self.theWindow center];
    [self.theWindow makeKeyAndOrderFront:self.theWindow];

// Override run and terminate: methods
- (void)run {
    terminate = NO;
    [self finishLaunching];
    do {
        NSEvent *event = [self nextEventMatchingMask:NSAnyEventMask untilDate:[NSDate distantFuture] inMode:NSDefaultRunLoopMode dequeue:YES];
        [self sendEvent:event];
        [self updateWindows];
    } while (!terminate);
- (void)terminate:(id)sender {
    terminate = YES;


int main(int argc, const char * argv[]) {

    // Do all your pre functions here

    /* Make NSApplication from CustomAppClass */
    CustomAppClass *appObject = [CustomAppClass sharedApplication];
    if ([appObject respondsToSelector:@selector(run)]) {
        [appObject performSelectorOnMainThread:@selector(run) withObject:nil waitUntilDone:YES];

    // Do all your post functions here.

    return 0;

Sorry I didn't describe how to ask for credentials and stuff but if you want an official window based authentication (not sudo) you should probably look into the Security framework.

Some Credit to

Hope this helps in any way.

UGUI: A Universal GUI for CLI Applications, UGUI gives a face to the command line, and that face is HTML, CSS, and JavaScript. A classic example of this is using a remote access tool (RAT) to run a malicious script with PowerShell on a compromised system. The command-line interface is not a new tool or technology and operates in the same way it does on your PC. Simply put, the command-line interface offers a way to interact with a computer system and execute software.

UX for Command Line Tools. It started on a quiet thursday while , both User Experience Design and Command Line tools. A UX designer who has some development experience, or has worked closely with� A command line program is a program that operates from the command line or from a shell. While Command line interface is a user interface that is navigated by typing commands at terminals, shells or consoles, instead of using the mouse.

Designing Command Line Tool User Experience, Let's talk about how we can improve the command line user experience for everyone across the entire software ecosystem! Command Line Interface Definition : A Command Line Interface (CLI) is also known as Command-line User Interface and/or Console User Interface (CUI).It is a type of human-computer interface (i.e., a way for humans to interact with digital computers or personal computer) that relies solely on textual request and response transaction process. - CLUI: Building a Graphical Command Line -, So now command line interfaces are back again, hiding under the name There are also plugins like Runner Pro for Sketch (a UI design tool)� Command Line Tools¶ From the directory where the Mattermost server is installed, a mattermost command is available for configuring the system. For an overview of the Mattermost command line interface (CLI), read this article from Santos. These mattermost commands include: General Administration. Creating teams; Creating users; Assigning roles

  • Command-line tools don't ask for credentials, they expect to be run from sudo.
  • Ok, but if I need to ask for credentials in a custom window, Do I have to create a cocoa application?
  • @Ana: If you need to ask for credentials, do it at the command line using stdio and, for the password, getpass. If you need root powers, do what hamstergene said: Expect to already have root powers, and complain to the user if you don't have them.