{"id":262900,"date":"2017-11-27T11:43:48","date_gmt":"2017-11-27T18:43:48","guid":{"rendered":"http:\/\/css-tricks.com\/?p=262900"},"modified":"2017-11-27T11:43:48","modified_gmt":"2017-11-27T18:43:48","slug":"apps-command-prompts-now","status":"publish","type":"post","link":"https:\/\/css-tricks.com\/apps-command-prompts-now\/","title":{"rendered":"Apps Have Command Prompts Now"},"content":{"rendered":"

Command lines were an early innovation in computers, and were the dominant way to interact with them in the 1960’s – 80’s. That gave way to GUIs<\/abbr> for most users after that. I don’t think we need to launch a scientific study to figure out why. Most users find it more comfortable and intuitive to accomplish things with interactive moments and visual feedback. <\/p>\n

But command lines never went away. GUI’s are generally a limited abstraction of what you could do through a command line anyway, so power users gravitate toward the closer-to-the-metal nature of the command line.<\/p>\n

But we might be in the middle of a return to a happy medium.<\/p>\n

<\/p>\n

Finder-ing<\/h3>\n

We know Apple is quite fond of cutting features. Particularly little-used features or power-user-only features. Curiously, this one has stuck around:<\/p>\n

\"\"
The “Go To Folder” dialog, via Command-Shift-G<\/figcaption><\/figure>\n

William Pearson wrote<\/a>: <\/p>\n

If there\u2019s only one keyboard shortcut you should remember in Mac OS X it\u2019s this: Go To Folder. … Is there a keyboard shortcut that is more useful than \u201cGo To Folder\u201d? I don\u2019t think so.<\/p><\/blockquote>\n

I’m not sure about that, but it’s clear some people take this shortcut pretty seriously! And yes, a keyboard shortcut, but one that essentially opens a command line prompt that can do one thing.<\/p>\n

I guess that isn’t terribly surprising, considering the success of apps like Alfred<\/a>, which perhaps it’s fair to say is a command line for finding, opening and doing things.<\/p>\n

\"\"<\/figure>\n

The Finder also has Spotlight (since OS X 10.4 Tiger anyway, 2005) which is largely a thing for search (especially these days, as it returns results the web as well).<\/p>\n

\"\"<\/figure>\n

Spotlight has a keyboard command (Command-Space) and then you just type to do stuff, so it’s very much a command prompt. Just one that’s pretty decked out in user-friendliness.<\/p>\n

And while we’re on this bend, we can’t forget about Quicksilver<\/a>. Interestingly, both Alfred and Quicksilver postdate<\/em> Spotlight. I guess that speaks to Spotlight kind of sucking in the early days, and leaving people wanting more.<\/p>\n

Code Editors<\/h3>\n

Most developers, I’m sure, are quite aware of the literal command line. Almost all the big development tools are command line based tools. Everything from Git to Gulp, image optimizers to package managers, Capistrano to webpack… they are all tools you use from the command line. If you have a GUI for any of them, it’s probably a light abstraction over command line methods.<\/p>\n

But, aside from the most hardcore of all Vim users who do all their code editing from a terminal window, we don’t actually write code on the command line, but in an editor with a GUI. <\/p>\n

Code Editors are a perfect breeding ground for ideas that combine the best of GUI’s and command lines.<\/p>\n

Let’s look at Sublime Text. When creating a new folder, I might want to do that with the GUI. There I can see the existing folder structure and see exactly what I’m doing.<\/p>\n

\"\"<\/figure>\n

But say I want to jump to a file I know exists. Say it’s buried a number of directories deep, and I’m glad that it is because it adheres to the structure of the current project. I might have to click – click – scroll – click – scroll – click to get there with a GUI, which isn’t the greatest interaction. <\/p>\n

Instead, I can fire up a command prompt in Sublime Text, in this case it’s iconic Goto Anything command<\/a>, type in something close to the file name, and find it.<\/p>\n

\"\"<\/figure>\n

Perhaps even more command-prompt-like is the literal Command Palette which is an extensible command-running menu triggered by a keyboard shortcut. Perhaps I want to run a specific Emmet command, correct syntax highlighting, or trigger an a find\/replace extension to do its thing.<\/p>\n

\"\"<\/figure>\n

These things are in a similar boat as finding a file-in-a-haystack. There could be hundreds or thousands of commands. Your brain and typing fingers can find them quicker than your hand on a mouse in a UI can.<\/p>\n

Sketch Runner<\/h3>\n

Sketch Runner<\/a> is a popular plugin for Sketch that adds a command prompt to Sketch. Here’s their product video:<\/p>\n