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
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Sebastián Ramírez
October 10, 2022
Technology
420
0
Share
CLI apps with Typer - Python type annotations and shell completion
Sebastián Ramírez
October 10, 2022
More Decks by Sebastián Ramírez
See All by Sebastián Ramírez
What's new in FastAPI for AI
tiangolo
0
710
2025-10 PyCon Brasil keynote - Behind the scenes of FastAPI and friends for developers and builders
tiangolo
0
30
PyCon Taiwan Keynote - Behind the scenes of FastAPI and friends for developers and builders
tiangolo
0
200
Modern Python through FastAPI and friends - PyCon Sweden
tiangolo
0
70
Await for it: mixing async and blocking code - PyCon MEA - Dubai
tiangolo
0
50
Intro to FastAPI: Tips and Tricks for ML
tiangolo
1
380
Modern Python through FastAPI and friends - PyCon MEA - Dubai
tiangolo
0
890
Software de Colombia para el mundo
tiangolo
1
1.8k
Modern Python through FastAPI and friends - PyCon Indonesia
tiangolo
0
510
Other Decks in Technology
See All in Technology
自分のハンドルは自分で握れ! ― 自分のケイパビリティを増やし、メンバーのケイパビリティ獲得を支援する ― / Take the wheel yourself
takaking22
1
890
え!?初参加で 300冊以上 も頒布!? これは大成功!そのはずなのに わいの財布は 赤字 の件
hellohazime
0
160
AWS DevOps Agentはチームメイトになれるのか?/ Can AWS DevOps Agent become a teammate
kinunori
6
710
Oracle AI Database@AWS:サービス概要のご紹介
oracle4engineer
PRO
4
2.3k
Eight Engineering Unit 紹介資料
sansan33
PRO
3
7.2k
AWS Agent Registry の基礎・概要を理解する/aws-agent-registry-intro
ren8k
3
360
ワールドカフェI /チューターを改良する / World Café I and Improving the Tutors
ks91
PRO
0
310
マルチエージェント × ハーネスエンジニアリング × GitLab Duo Agent Platformで実現する「AIエージェントに仕事をさせる時代へ。」 / 20260421 GitLab Duo Agent Platform
n11sh1
0
150
マルチプロダクトの信頼性を効率良く保っていくために
kworkdev
PRO
0
150
扱える不確実性を増やしていく - スタートアップEMが考える「任せ方」
kadoppe
0
290
LLM時代の検索アーキテクチャと技術的意思決定
shibuiwilliam
3
1.1k
サイボウズ 開発本部採用ピッチ / Cybozu Engineer Recruit
cybozuinsideout
PRO
10
78k
Featured
See All Featured
WCS-LA-2024
lcolladotor
0
540
How Fast Is Fast Enough? [PerfNow 2025]
tammyeverts
3
530
Documentation Writing (for coders)
carmenintech
77
5.3k
The Invisible Side of Design
smashingmag
302
52k
BBQ
matthewcrist
89
10k
How To Stay Up To Date on Web Technology
chriscoyier
790
250k
SEO Brein meetup: CTRL+C is not how to scale international SEO
lindahogenes
1
2.6k
Dominate Local Search Results - an insider guide to GBP, reviews, and Local SEO
greggifford
PRO
0
140
Marketing Yourself as an Engineer | Alaka | Gurzu
gurzu
0
180
Technical Leadership for Architectural Decision Making
baasie
3
330
Getting science done with accelerated Python computing platforms
jacobtomlinson
2
180
Everyday Curiosity
cassininazir
0
200
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