Mac Command Line for Web Devs
- mdn-search.
-
Quick tool for search in Mozilla Developer Network from command line, built with nodejs by Nicolás Arias (ezakto):
-
Usage:
-
mdn [options] [command] <query>
-
- Dash is an API Documentation Browser and Code Snippet Manager.
- Dash stores snippets of code and instantly searches offline documentation sets for 150+ APIs.
- You can even generate your own docsets or request docsets to be included.
- See Function below for a CLI function to work with Dash.
-
- Replace tag/element expansion with your customized one (Ex.: html).
- Add the following to your snippets file to replace functionality of html autocomplete to include viewport tag:
'.text.html, .atom/language-html':
'HTML':
'prefix': 'html'
'body': '<!DOCTYPE html>\n<html>\n\t<head>\n\t\t<meta charset="utf-8">\n\t\t<meta name="viewport" content="width=device-width, initial-scale=1">\n\t\t<title>$1</title>\n\t</head>\n\t<body>\n\t\t$2\n\t</body>\n</html>'
- Open current directory in MacOS Finder
open -a Finder ./
- Create a bash alias called “f”:
alias f='open -a Finder ./'
- Open Dash app from command line:
open -a Dash
- Open Dash app from command line and search for ‘flex’ in CSS documentation:
open dash://css:flex
- Open MDN in Chrome browser:
mdn open
- Open MDN in Chrome browser and search for ‘flex’ in CSS documentation:
mdn -o -t css flex
- Alias for ls -l command:
alias lsl=‘ls -l’
- A fancier ls -l command (try it!):
alias ll='ls -FGlAhp'
- Clear terminal display (without affecting history):
alias c='clear'
- Create a bash function called “dash” as a CLI for Dash macOS app:
function dash() {
open "dash://$*"
}