"shelp"
- A package manager for
shell scripts -
@progrhyme
2020-06-26 Open Go Friday #7
Slide 2
Slide 2 text
About Me
● @progrhyme
● HP: progrhy.me
● Career
○ 〜2017 Oct. @DeNA
○ 〜2019 Dec. @M3
○ 〜Now @MonotaRO
● Revisited the tour of Go
recently
2
Slide 3
Slide 3 text
What is "shelp"?
● https://github.com/progrhyme/shelp
● Git-based package manager for shell scripts
● Install, update packages by `git` command
● Commandline tool
● Supports fish shell, Zsh, Bash and more
3
Slide 4
Slide 4 text
DEMO
4
Slide 5
Slide 5 text
Implementation
● spf13/pflag to parse command-line flags
● Directory layout:
○ github.com/progrhyme/shelp ... CLI package
■ internal/ ... All internal packages
○ Don't suppose to be used as library for now
5
Slide 6
Slide 6 text
What I struggled with the most
● A number of "types" to define to implement similar
but various "command" and "option" objects
○ 34 types in "internal/cli" package
○ There may be better ways
● Felt like making boilerplates ...
● `gorename` helped me a lot to refine their naming
(about 30 times or so)
6
Slide 7
Slide 7 text
Coming up Next
● "shelp"
○ Command completion
● More Go CLIs
7
Slide 8
Slide 8 text
Conclusion
● Go is convenient to make cross-platform
application like CLI
● Try "shelp" if you like
8
Slide 9
Slide 9 text
Thank you
9
Slide 10
Slide 10 text
Related Links
10
● https://go-shelp.netlify.app/
○ "shelp" Documentation
● シェルスクリプトのパッケージ管理ツール「shelp」をGo言
語で作った - progrhyme's tech blog