~/talk

A Hands-On Guide to Building Interactive Command-Line Apps with cmd2

Talkat PyOhio 2019 · 2019-07-27..07-28· [devops-and-delivery, security]
links:none on file
links:none on file
slides:none on file

cmd2 is a drop-in extension of Python’s cmd module that demos a working, feature-rich interactive shell: GitHub-hosted with CI on Windows/Mac/Linux, >97% code coverage and ~28 contributors. It shows live examples of built-in help, top-notch tab completion (including dynamic choices and negative-number handling), shell execution with piping/redirect, persistent history, aliases/macros, argparse decorators for automatic completions, embedded IPython and Python scripting, an async alert API, a regression-test framework, and broad Python 3.5+ compatibility.

AI-written summary · about

  1. 0:00Intro
  2. 1:22Overview
  3. 2:46Why build a CLI?
  4. 3:47Why use cmd2 to build your CLI?
  5. 4:21cmd2 Main Features
  6. 4:38Create a cmd2 application
  7. 6:07Add a cmd2 command
  8. 9:15Add help for a cmd2 command
  9. 9:40Tab completion for a cmd2 command
  10. 10:09Searchable command history
  11. 11:55Built-in editor
  12. 12:27Settable environment parameters
  13. 14:02Shell commands
  14. 14:57Output redirection or pipe
  15. 16:40Commands at invocation
  16. 17:56Text File Scripts
  17. 21:49Macros
  18. 25:47Tab completion using argparse decorators
  19. 34:51Embedded Python interpreter
  20. 35:24Embedded IPython interpreter (opt-in)
  21. 42:11Asynchronous Alerting
  22. 44:00Full Unicode support
  23. 44:25Compatibility
  24. 44:43Built-in regression testing framework
  25. 44:58Application Lifecycle Hooks
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.