Skip to content
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
90 lines (69 sloc) 2.27 KB


Syntax control for the command line.

syn uses OS X's natural language processing tools to tokenize and highlight text (from standard input) that matches specified tags.

(Animated demo)

Inspired by iA Writer.


syn requires OS X 10.7 or above.

$ curl -LOs \
  && chmod 755 syn \
  && mv syn /usr/local/bin

Or clone/download the repository and run make install (requires Xcode to be installed).



# find pesky adverbs
$ syn --adverbs < nanowrimo.txt
# highlight nouns and noun-likes
$ syn --nouns --pronouns --personal-names --place-names < nanowrimo.txt
# peruse the classics
$ curl -Ls | \
  syn -A | \
  less -r
# generate listicles
$ syn -a -ftable < moby-dick.txt | \
  cut -d ' ' -f4 | sort -f | uniq -ci | sort -nr | head -10 | tr a-z A-Z
 441 OLD
 430 OTHER
 305 SUCH
 290 GREAT
 275 LAST
 215 SAME
 199 OWN
 199 GOOD
 191 WHITE


usage: syn [tags] [-f <formatter=ansi>] [-vh]
    -n, --nouns                      Match nouns
    -V, --verbs                      Match verbs
    -a, --adjectives                 Match adjectives
    -A, --adverbs                    Match adverbs
    -N, --pronouns                   Match pronouns
    -d, --determiners                Match determiners
    -p, --particles                  Match particles
    -P, --prepositions               Match prepositions
    -1, --numbers                    Match numbers
    -c, --conjunctions               Match conjunctions
    -i, --interjections              Match interjections
    -C, --classifiers                Match classifiers
    -I, --idioms                     Match idioms
    -H, --personal-names             Match personal (human) names
    -l, --place-names                Match place names (locations)

    -f, --formatter                  One of 'ansi', 'table', or 'json'

    -v, --version                    Show version
    -h, --help                       Show this screen


syn is available under the MIT license. See the LICENSE file for more information.

You can’t perform that action at this time.