Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
CLI apps with Typer - Python type annotations a...
Search
Sebastián Ramírez
October 10, 2022
Technology
0
370
CLI apps with Typer - Python type annotations and shell completion
Sebastián Ramírez
October 10, 2022
Tweet
Share
More Decks by Sebastián Ramírez
See All by Sebastián Ramírez
PyCon Taiwan Keynote - Behind the scenes of FastAPI and friends for developers and builders
tiangolo
0
110
Modern Python through FastAPI and friends - PyCon Sweden
tiangolo
0
57
Await for it: mixing async and blocking code - PyCon MEA - Dubai
tiangolo
0
31
Intro to FastAPI: Tips and Tricks for ML
tiangolo
1
350
Modern Python through FastAPI and friends - PyCon MEA - Dubai
tiangolo
0
880
Software de Colombia para el mundo
tiangolo
1
1.7k
Modern Python through FastAPI and friends - PyCon Indonesia
tiangolo
0
510
Modern Python through FastAPI and friends - Dubai - AI Everything - Gitex
tiangolo
0
110
Modern Python through FastAPI and friends - PyCon India
tiangolo
1
340
Other Decks in Technology
See All in Technology
Green Tea Garbage Collector の今
zchee
PRO
2
380
#普通の文系サラリーマンチャレンジ 自分でアプリ開発と電子工作を続けたら人生が変わった
tatsuya1970
0
910
いまさら聞けない ABテスト入門
skmr2348
1
180
Geospatialの世界最前線を探る [2025年版]
dayjournal
3
460
Railsアプリケーション開発者のためのブックガイド
takahashim
13
5.9k
関係性が駆動するアジャイル──GPTに人格を与えたら、対話を通してふりかえりを習慣化できた話
mhlyc
0
130
Oracle Base Database Service 技術詳細
oracle4engineer
PRO
11
77k
20250929_QaaS_vol20
mura_shin
0
110
pprof vs runtime/trace (FlightRecorder)
task4233
0
140
PLaMoの事後学習を支える技術 / PFN LLMセミナー
pfn
PRO
9
3.6k
Optuna DashboardにおけるPLaMo2連携機能の紹介 / PFN LLM セミナー
pfn
PRO
1
810
それでも私はContextに値を詰めたい | Go Conference 2025 / go conference 2025 fill context
budougumi0617
4
1.1k
Featured
See All Featured
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
33
2.4k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
54
3k
Keith and Marios Guide to Fast Websites
keithpitt
411
22k
A better future with KSS
kneath
239
17k
StorybookのUI Testing Handbookを読んだ
zakiyama
31
6.2k
Rebuilding a faster, lazier Slack
samanthasiow
84
9.2k
Into the Great Unknown - MozCon
thekraken
40
2.1k
How To Stay Up To Date on Web Technology
chriscoyier
791
250k
GraphQLの誤解/rethinking-graphql
sonatard
72
11k
Docker and Python
trallard
46
3.6k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
48
9.7k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.5k
Transcript
CLI apps with type annotations and shell completion
Who am I? Sebastián Ramírez github.com/tiangolo linkedin.com/in/tiangolo twitter.com/tiangolo tiangolo.com Berlin,
Germany Senior Staff Software Engineer at I created: ➕ External Consultant for other teams
About Typer • 8K+ GitHub stars • FastAPI's little sibling
• Powered by Click @tiangolo
Command Line Interfaces (CLI) or Terminals @tiangolo • Text based
• You send program and parameters • Computer goes beep boop • Maybe output • Examples of CLI apps: git, ssh, pip
Simple function with type annotations @tiangolo
Simple function with type annotations @tiangolo
Why type annotations - error checks @tiangolo
Why type annotations - completion @tiangolo
Simple function with type annotations - recap @tiangolo
Simple scripts with Typer @tiangolo
Simple scripts - required arguments @tiangolo
Simple scripts with Typer - main block @tiangolo
Simple scripts - required arguments missing @tiangolo
Simple scripts with --help @tiangolo
Simple scripts - options @tiangolo
Simple scripts - invalid data @tiangolo
Simple scripts - more help @tiangolo
Simple scripts - more help in the terminal @tiangolo
Simple scripts - help for parameters @tiangolo
Simple scripts - help for parameters in the terminal @tiangolo
A Typer app @tiangolo
A Typer app - app object @tiangolo
A Typer app - decorator @tiangolo
A Typer app - call the app @tiangolo
A Typer app - supergreet @tiangolo
Install completion @tiangolo ✨ Works for everything: • Zsh •
Bash • Fish • PowerShell
Use completion @tiangolo
Use completion @tiangolo
Use completion @tiangolo
Use completion @tiangolo
Use completion @tiangolo
Completion @tiangolo 🧙 Works by default and can be used
for: • Deeply nested commands • CLI Options and CLI Arguments • Custom data (e.g. remote, from an API) • etc.
Commands @tiangolo
Commands - hi @tiangolo
Commands - bye @tiangolo
Help with commands @tiangolo
Commands - hi again @tiangolo
Commands --help for hi @tiangolo
Command hi in terminal @tiangolo
Commands - bye @tiangolo
Commands --help for bye @tiangolo
More Typer features @tiangolo • 🥅 Boolean flags • ❓
Prompts • 🔒 Ask passwords • 🚀 Launch apps (e.g. a browser) • ✅ Easy testing • ✨ More…
Thank you! Sebastián Ramírez tiangolo.com typer.tiangolo.com github.com/tiangolo linkedin.com/in/tiangolo twitter.com/tiangolo