SlideShare a Scribd company logo
Building Command
Line Tools
with Golang
Takaaki Mizuno
Innovatube TechTalk #3
Who Am I
Takaaki Mizuno
CEO of Innovatube Solutions
19 years experience as software developer
34 years experience in coding
Still coding
Based in Singapore
Japanese born in Japan
Published 20+ technical books in Japan
Golang Use Cases
Golang at Innovatube
We selected 2 primary languages for web/mobile-app back-end
development.
PHP
Golang
Golang is used for non-HTML-Heavy Web development
API Server for Mobile Apps
Use React on Frontend and backend system only returns
structured data such as JSON
Golang Use Cases
Web Services
Mobile Applications ( Android [ver 1.4~] / iOS [ver 1.5~])
Game Backend
Daemon / Service
Command Line Tools
Golang and Command
Line Tools
Which Language Are You Using
For Writing Command Line Tools ?
Node.js
Java
Python
Ruby
C++
Golang
Which language should we
use for command line tools?
It depends on the use case of the tool.
If the tool is dedicated for specific languages/framework, use that languages.
Ruby for rubygems
PHP for composer
Node.js for front-end task runners ( gulp / grunt )
It the tool is a part of a project, you should use same language
Java for Java project
Python for Python project
Other cases
Use Golang
Benefit for Command Line
Tools
Single Binary
Cross Platform ( Can support Windows easily )
No run-time dependencies
Concurrency
Many famous “command line”
tools are written in Golang
docker
Terraform ( By Hashicorp)
hub ( by GitHub )
Write command line
tools in Golang
Many Libraries You Can Use
Standard CLI
Libraries for building standard or basic Command Line applications
cli - A feature-rich and easy to use command-line package based on golang tag
cli-init - The easy way to start building Golang command line application.
climax - An alternative CLI with "human face", in spirit of Go command
cobra - A Commander for modern Go CLI interactions
codegangsta/cli - A small package for building command line apps in Go.
docopt.go - A command-line arguments parser that will make you smile.
go-flags - go command line option parser
kingpin - A command line and flag parser supporting sub commands.
liner - A Go readline-like library for command-line interfaces.
mitchellh/cli - A Go library for implementing command-line interfaces.
mow.cli - A Go library for building CLI applications with sophisticated flag and argument parsing and validation.
From: Awesome-go ( https://github.com/avelino/awesome-go#command-line )
You can use “gcli”
It generates a skeleton (codes and its directory
structure) you need to start building Command Line
Interface (CLI) tool
https://github.com/tcnksm/gcli
Easy To Use
gcli new -command=init -command=get -owner=takaaki-mizuno awesomecommand
% awesomecommand init
DEMO
Support 4 CLI libraries
+-----------------+---------+-----------------------------------------------------+
| NAME | COMMAND | URL |
+-----------------+---------+-----------------------------------------------------+
| mitchellh_cli | * | https://github.com/mitchellh/cli |
| codegangsta_cli | * | https://github.com/codegangsta/cli |
| go_cmd | * | https://github.com/golang/go/tree/master/src/cmd/go |
| flag | | https://golang.org/pkg/flag/ |
+-----------------+---------+-----------------------------------------------------+
% gcli list
Some Tips For Golang
( command line tools )
Text Colorize
mgutz/ansi & mattn/go-colorable
mgutz/ansi is a library to create ANSI colored strings
and codes
mattn/go-colorable is an io.Writer wrapper to support
Windows DOS prompt colorize
Building Dashboard
gizak/termui
Can build Text Base Dashboard with GUI Building-
Like APIs
Happy Coding!
We are Hiring!
You want to write Golang ?
Join us !
http://innovatube.com/
Q & A

More Related Content

PDF
[INNOVATUBE] Tech Talk #3: Golang - Takaaki Mizuno
PPTX
Developing Cross Platform Applications with Golang
PPTX
Golang Channels use cases
PDF
[INNOVATUBE] Tech Talk #3: Golang - Vũ Nguyễn
PDF
Golang from Scala developer’s perspective
PDF
GoLang Introduction
PPTX
Optimizing and Profiling Golang Rest Api
[INNOVATUBE] Tech Talk #3: Golang - Takaaki Mizuno
Developing Cross Platform Applications with Golang
Golang Channels use cases
[INNOVATUBE] Tech Talk #3: Golang - Vũ Nguyễn
Golang from Scala developer’s perspective
GoLang Introduction
Optimizing and Profiling Golang Rest Api

What's hot (20)

PPT
Come With Golang
PPTX
Wonders of Golang
PDF
welcome to gopherlabs - why go (golang)?
PDF
Golang online course
PDF
Golang for PHP programmers: A practical introduction
PPTX
Golang - Overview of Go (golang) Language
PPTX
Golang start and tips
PDF
Why you should care about Go (Golang)
PDF
Dependency management in golang
PDF
Getting started with Go - Florin Patan - Codemotion Rome 2017
PPTX
PPT
A First Look at Google's Go Programming Language
PDF
13 practical tips for writing secure golang applications
PDF
Go from PHP engineer's perspective
PDF
PPT
Introduction to Go-Lang
PDF
The Go programming language - Intro by MyLittleAdventure
PPTX
Introduction to go lang
PDF
(Live) build and run golang web server on android.avi
PDF
Coding with golang
Come With Golang
Wonders of Golang
welcome to gopherlabs - why go (golang)?
Golang online course
Golang for PHP programmers: A practical introduction
Golang - Overview of Go (golang) Language
Golang start and tips
Why you should care about Go (Golang)
Dependency management in golang
Getting started with Go - Florin Patan - Codemotion Rome 2017
A First Look at Google's Go Programming Language
13 practical tips for writing secure golang applications
Go from PHP engineer's perspective
Introduction to Go-Lang
The Go programming language - Intro by MyLittleAdventure
Introduction to go lang
(Live) build and run golang web server on android.avi
Coding with golang
Ad

Viewers also liked (16)

PDF
Golang concurrency design
PDF
Concurrency in Golang
PDF
High productivity web development workflow - JavaScript Meetup Saigon 2014
PDF
Going All-In With Go For CLI Apps
PDF
Golang vs Ruby
PDF
Golang #5: To Go or not to Go
PPTX
Example Of Experience
PPTX
hacking with node.JS
PDF
Go debugging and troubleshooting tips - from real life lessons at SignalFx
PDF
Important Comment used in AutoCAD 2D Khmer Guide
PDF
Most Essential AutoCAD Commands
PPT
Staadpresentation1 159
PPSX
PDF
Tutorial Staad-Pro
PPTX
DESIGN AND ANALAYSIS OF MULTI STOREY BUILDING USING STAAD PRO
PPTX
Final ppt on staad pro
Golang concurrency design
Concurrency in Golang
High productivity web development workflow - JavaScript Meetup Saigon 2014
Going All-In With Go For CLI Apps
Golang vs Ruby
Golang #5: To Go or not to Go
Example Of Experience
hacking with node.JS
Go debugging and troubleshooting tips - from real life lessons at SignalFx
Important Comment used in AutoCAD 2D Khmer Guide
Most Essential AutoCAD Commands
Staadpresentation1 159
Tutorial Staad-Pro
DESIGN AND ANALAYSIS OF MULTI STOREY BUILDING USING STAAD PRO
Final ppt on staad pro
Ad

Similar to Building Command Line Tools with Golang (20)

PPTX
Building CLI Applications with Golang
PDF
Building Awesome CLI apps in Go
PDF
How to build and distribute CLI tool in 15 minutes with Golang
PDF
Getting Started with Go
PDF
Introduction to Go
PPTX
Ready, set, go! An introduction to the Go programming language
PDF
Writing Rust Command Line Applications
PDF
Happy Go Programming Part 1
PDF
A gentle intro to Golang and the Go-universe
PDF
Golang workshop
PDF
Docker and Go: why did we decide to write Docker in Go?
PDF
Golang_Perl_Doc
PPTX
The GO Language : From Beginners to Gophers
PDF
Go for SysAdmins - LISA 2015
PDF
Building robust and friendly command line applications in go
PDF
Import golang; struct microservice
PPTX
Ndc2017
PDF
OSCON2014 : Quick Introduction to System Tools Programming with Go
PDF
Java to Golang: An intro by Ryan Dawson Seldon.io
PDF
The Go features I can't live without, 2nd round
Building CLI Applications with Golang
Building Awesome CLI apps in Go
How to build and distribute CLI tool in 15 minutes with Golang
Getting Started with Go
Introduction to Go
Ready, set, go! An introduction to the Go programming language
Writing Rust Command Line Applications
Happy Go Programming Part 1
A gentle intro to Golang and the Go-universe
Golang workshop
Docker and Go: why did we decide to write Docker in Go?
Golang_Perl_Doc
The GO Language : From Beginners to Gophers
Go for SysAdmins - LISA 2015
Building robust and friendly command line applications in go
Import golang; struct microservice
Ndc2017
OSCON2014 : Quick Introduction to System Tools Programming with Go
Java to Golang: An intro by Ryan Dawson Seldon.io
The Go features I can't live without, 2nd round

Recently uploaded (20)

PDF
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
PDF
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
PDF
Adobe Premiere Pro 2025 (v24.5.0.057) Crack free
PPTX
L1 - Introduction to python Backend.pptx
PDF
How to Migrate SBCGlobal Email to Yahoo Easily
PPTX
Online Work Permit System for Fast Permit Processing
PPTX
Introduction to Artificial Intelligence
PDF
Complete React Javascript Course Syllabus.pdf
PDF
AI in Product Development-omnex systems
PDF
Design an Analysis of Algorithms II-SECS-1021-03
PPT
JAVA ppt tutorial basics to learn java programming
PDF
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
PDF
How to Choose the Right IT Partner for Your Business in Malaysia
PPTX
CHAPTER 12 - CYBER SECURITY AND FUTURE SKILLS (1) (1).pptx
PDF
Design an Analysis of Algorithms I-SECS-1021-03
PPTX
history of c programming in notes for students .pptx
PPTX
ISO 45001 Occupational Health and Safety Management System
PPTX
VVF-Customer-Presentation2025-Ver1.9.pptx
PDF
PTS Company Brochure 2025 (1).pdf.......
PDF
Digital Strategies for Manufacturing Companies
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
Adobe Premiere Pro 2025 (v24.5.0.057) Crack free
L1 - Introduction to python Backend.pptx
How to Migrate SBCGlobal Email to Yahoo Easily
Online Work Permit System for Fast Permit Processing
Introduction to Artificial Intelligence
Complete React Javascript Course Syllabus.pdf
AI in Product Development-omnex systems
Design an Analysis of Algorithms II-SECS-1021-03
JAVA ppt tutorial basics to learn java programming
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
How to Choose the Right IT Partner for Your Business in Malaysia
CHAPTER 12 - CYBER SECURITY AND FUTURE SKILLS (1) (1).pptx
Design an Analysis of Algorithms I-SECS-1021-03
history of c programming in notes for students .pptx
ISO 45001 Occupational Health and Safety Management System
VVF-Customer-Presentation2025-Ver1.9.pptx
PTS Company Brochure 2025 (1).pdf.......
Digital Strategies for Manufacturing Companies

Building Command Line Tools with Golang

  • 1. Building Command Line Tools with Golang Takaaki Mizuno Innovatube TechTalk #3
  • 2. Who Am I Takaaki Mizuno CEO of Innovatube Solutions 19 years experience as software developer 34 years experience in coding Still coding Based in Singapore Japanese born in Japan Published 20+ technical books in Japan
  • 4. Golang at Innovatube We selected 2 primary languages for web/mobile-app back-end development. PHP Golang Golang is used for non-HTML-Heavy Web development API Server for Mobile Apps Use React on Frontend and backend system only returns structured data such as JSON
  • 5. Golang Use Cases Web Services Mobile Applications ( Android [ver 1.4~] / iOS [ver 1.5~]) Game Backend Daemon / Service Command Line Tools
  • 7. Which Language Are You Using For Writing Command Line Tools ? Node.js Java Python Ruby C++ Golang
  • 8. Which language should we use for command line tools? It depends on the use case of the tool. If the tool is dedicated for specific languages/framework, use that languages. Ruby for rubygems PHP for composer Node.js for front-end task runners ( gulp / grunt ) It the tool is a part of a project, you should use same language Java for Java project Python for Python project Other cases Use Golang
  • 9. Benefit for Command Line Tools Single Binary Cross Platform ( Can support Windows easily ) No run-time dependencies Concurrency
  • 10. Many famous “command line” tools are written in Golang docker Terraform ( By Hashicorp) hub ( by GitHub )
  • 12. Many Libraries You Can Use Standard CLI Libraries for building standard or basic Command Line applications cli - A feature-rich and easy to use command-line package based on golang tag cli-init - The easy way to start building Golang command line application. climax - An alternative CLI with "human face", in spirit of Go command cobra - A Commander for modern Go CLI interactions codegangsta/cli - A small package for building command line apps in Go. docopt.go - A command-line arguments parser that will make you smile. go-flags - go command line option parser kingpin - A command line and flag parser supporting sub commands. liner - A Go readline-like library for command-line interfaces. mitchellh/cli - A Go library for implementing command-line interfaces. mow.cli - A Go library for building CLI applications with sophisticated flag and argument parsing and validation. From: Awesome-go ( https://github.com/avelino/awesome-go#command-line )
  • 13. You can use “gcli” It generates a skeleton (codes and its directory structure) you need to start building Command Line Interface (CLI) tool https://github.com/tcnksm/gcli
  • 14. Easy To Use gcli new -command=init -command=get -owner=takaaki-mizuno awesomecommand % awesomecommand init
  • 15. DEMO
  • 16. Support 4 CLI libraries +-----------------+---------+-----------------------------------------------------+ | NAME | COMMAND | URL | +-----------------+---------+-----------------------------------------------------+ | mitchellh_cli | * | https://github.com/mitchellh/cli | | codegangsta_cli | * | https://github.com/codegangsta/cli | | go_cmd | * | https://github.com/golang/go/tree/master/src/cmd/go | | flag | | https://golang.org/pkg/flag/ | +-----------------+---------+-----------------------------------------------------+ % gcli list
  • 17. Some Tips For Golang ( command line tools )
  • 18. Text Colorize mgutz/ansi & mattn/go-colorable mgutz/ansi is a library to create ANSI colored strings and codes mattn/go-colorable is an io.Writer wrapper to support Windows DOS prompt colorize
  • 19. Building Dashboard gizak/termui Can build Text Base Dashboard with GUI Building- Like APIs
  • 21. We are Hiring! You want to write Golang ? Join us ! http://innovatube.com/
  • 22. Q & A