[{"data":1,"prerenderedAt":2248},["ShallowReactive",2],{"page-\u002Fproject-setup-dependency-management\u002Fuv-for-python-cli-dependency-management\u002Frunning-one-off-cli-scripts-with-uv-run\u002F":3,"content-directory":1702},{"id":4,"title":5,"body":6,"date":1688,"description":1689,"difficulty":1690,"draft":1691,"extension":1692,"meta":1693,"navigation":247,"path":1694,"seo":1695,"stem":1696,"tags":1697,"updated":1688,"__hash__":1701},"content\u002Fproject-setup-dependency-management\u002Fuv-for-python-cli-dependency-management\u002Frunning-one-off-cli-scripts-with-uv-run\u002Findex.md","Running One-Off CLI Scripts with uv run and PEP 723",{"type":7,"value":8,"toc":1668},"minimark",[9,43,48,58,62,66,88,92,95,151,154,1023,1026,1061,1067,1072,1098,1102,1105,1124,1137,1141,1148,1202,1205,1209,1212,1232,1236,1286,1289,1293,1300,1518,1545,1560,1564,1574,1578,1582,1589,1593,1600,1604,1618,1622,1628,1632,1664],[10,11,12,13,17,18,21,22,21,25,28,29,32,33,36,37,42],"p",{},"Not every command-line tool deserves a project. A script that syncs labels between two issue trackers, one that audits S3 bucket policies once a quarter, a migration helper you will run three times — these start as a single ",[14,15,16],"code",{},".py"," file, and they immediately hit the same problem: they need ",[14,19,20],{},"httpx"," or ",[14,23,24],{},"rich",[14,26,27],{},"boto3",", and the person running them does not have those installed in the right environment. The traditional answers — a README saying \"pip install these first\", a ",[14,30,31],{},"requirements.txt"," next to the script, a virtual environment someone has to create — all fail as soon as the script is shared. PEP 723 lets a script declare its own Python version and dependencies in a comment block at the top, and ",[14,34,35],{},"uv run"," reads that block, provisions a cached environment and runs the script. This guide shows how to write such scripts as proper little CLIs, lock them for reproducibility, make them directly executable, and recognise when one should graduate to a real project. It belongs to the ",[38,39,41],"a",{"href":40},"\u002Fproject-setup-dependency-management\u002Fuv-for-python-cli-dependency-management\u002F","uv for Python CLI dependency management topic",".",[44,45,47],"h2",{"id":46},"prerequisites","Prerequisites",[49,50,51,55],"ul",{},[52,53,54],"li",{},"uv installed. Nothing else: uv downloads a suitable Python if the machine lacks one.",[52,56,57],{},"A task small enough for one file.",[44,59,61],{"id":60},"anatomy-of-a-self-describing-script","Anatomy of a self-describing script",[63,64],"inline-diagram",{"name":65},"pep723-anatomy",[10,67,68,69,72,73,76,77,72,80,83,84,87],{},"A PEP 723 block is a TOML document inside comments, between ",[14,70,71],{},"# \u002F\u002F\u002F script"," and ",[14,74,75],{},"# \u002F\u002F\u002F",". It supports two keys: ",[14,78,79],{},"requires-python",[14,81,82],{},"dependencies",", with the same syntax as ",[14,85,86],{},"pyproject.toml",". Tools that understand the standard — uv, pipx, Hatch, PDM — read it; to Python itself it is just a comment, so the script still runs normally in an environment that already has the dependencies.",[44,89,91],{"id":90},"the-recipe","The recipe",[10,93,94],{},"Create the skeleton and add dependencies with uv, which edits the block for you:",[96,97,102],"pre",{"className":98,"code":99,"language":100,"meta":101,"style":101},"language-bash shiki shiki-themes github-light github-dark","uv init --script sync_labels.py --python 3.11\nuv add --script sync_labels.py httpx typer rich\n","bash","",[14,103,104,130],{"__ignoreMap":101},[105,106,109,113,117,121,124,127],"span",{"class":107,"line":108},"line",1,[105,110,112],{"class":111},"sScJk","uv",[105,114,116],{"class":115},"sZZnC"," init",[105,118,120],{"class":119},"sj4cs"," --script",[105,122,123],{"class":115}," sync_labels.py",[105,125,126],{"class":119}," --python",[105,128,129],{"class":119}," 3.11\n",[105,131,133,135,138,140,142,145,148],{"class":107,"line":132},2,[105,134,112],{"class":111},[105,136,137],{"class":115}," add",[105,139,120],{"class":119},[105,141,123],{"class":115},[105,143,144],{"class":115}," httpx",[105,146,147],{"class":115}," typer",[105,149,150],{"class":115}," rich\n",[10,152,153],{},"Then write the script as a real CLI, with arguments, help text and exit codes — one-off scripts have a way of being run again next year by someone else:",[96,155,159],{"className":156,"code":157,"language":158,"meta":101,"style":101},"language-python shiki shiki-themes github-light github-dark","#!\u002Fusr\u002Fbin\u002Fenv -S uv run --script\n# \u002F\u002F\u002F script\n# requires-python = \">=3.11\"\n# dependencies = [\n#     \"httpx>=0.28\",\n#     \"rich>=13.7\",\n#     \"typer>=0.12\",\n# ]\n# \u002F\u002F\u002F\n\"\"\"Copy issue labels from one GitHub repository to another.\"\"\"\nfrom __future__ import annotations\n\nimport os\n\nimport httpx\nimport typer\nfrom rich.console import Console\n\napp = typer.Typer(add_completion=False)\nerr = Console(stderr=True)\n\n\ndef client() -> httpx.Client:\n    token = os.environ.get(\"GITHUB_TOKEN\")\n    if not token:\n        err.print(\"[red]error:[\u002Fred] set GITHUB_TOKEN\")\n        raise typer.Exit(2)\n    return httpx.Client(base_url=\"https:\u002F\u002Fapi.github.com\", timeout=20.0,\n                        headers={\"Authorization\": f\"Bearer {token}\",\n                                 \"Accept\": \"application\u002Fvnd.github+json\"})\n\n\n@app.command()\ndef main(\n    source: str = typer.Argument(..., help=\"owner\u002Frepo to copy labels from\"),\n    target: str = typer.Argument(..., help=\"owner\u002Frepo to copy labels to\"),\n    dry_run: bool = typer.Option(False, \"--dry-run\", \"-n\", help=\"Show what would change.\"),\n) -> None:\n    \"\"\"Copy labels from SOURCE to TARGET, creating any that are missing.\"\"\"\n    with client() as gh:\n        wanted = {l[\"name\"]: l for l in gh.get(f\"\u002Frepos\u002F{source}\u002Flabels\", params={\"per_page\": 100}).json()}\n        existing = {l[\"name\"] for l in gh.get(f\"\u002Frepos\u002F{target}\u002Flabels\", params={\"per_page\": 100}).json()}\n        missing = sorted(set(wanted) - existing)\n        for name in missing:\n            label = wanted[name]\n            err.print(f\"{'would create' if dry_run else 'creating'} [bold]{name}[\u002Fbold]\")\n            if not dry_run:\n                gh.post(f\"\u002Frepos\u002F{target}\u002Flabels\", json={\n                    \"name\": name, \"color\": label[\"color\"], \"description\": label.get(\"description\") or \"\",\n                }).raise_for_status()\n    err.print(f\"{len(missing)} label(s) {'to create' if dry_run else 'created'}\")\n\n\nif __name__ == \"__main__\":\n    app()\n","python",[14,160,161,167,175,181,187,193,199,205,211,219,225,242,249,258,263,271,279,292,297,321,342,347,352,364,380,392,403,417,448,484,498,503,508,517,528,559,584,621,633,639,654,718,770,796,810,821,865,876,904,943,949,990,995,1000,1017],{"__ignoreMap":101},[105,162,163],{"class":107,"line":108},[105,164,166],{"class":165},"sJ8bj","#!\u002Fusr\u002Fbin\u002Fenv -S uv run --script\n",[105,168,169,172],{"class":107,"line":132},[105,170,171],{"class":165},"#",[105,173,174],{"class":165}," \u002F\u002F\u002F script\n",[105,176,178],{"class":107,"line":177},3,[105,179,180],{"class":165},"# requires-python = \">=3.11\"\n",[105,182,184],{"class":107,"line":183},4,[105,185,186],{"class":165},"# dependencies = [\n",[105,188,190],{"class":107,"line":189},5,[105,191,192],{"class":165},"#     \"httpx>=0.28\",\n",[105,194,196],{"class":107,"line":195},6,[105,197,198],{"class":165},"#     \"rich>=13.7\",\n",[105,200,202],{"class":107,"line":201},7,[105,203,204],{"class":165},"#     \"typer>=0.12\",\n",[105,206,208],{"class":107,"line":207},8,[105,209,210],{"class":165},"# ]\n",[105,212,214,216],{"class":107,"line":213},9,[105,215,171],{"class":165},[105,217,218],{"class":165}," \u002F\u002F\u002F\n",[105,220,222],{"class":107,"line":221},10,[105,223,224],{"class":115},"\"\"\"Copy issue labels from one GitHub repository to another.\"\"\"\n",[105,226,228,232,235,238],{"class":107,"line":227},11,[105,229,231],{"class":230},"szBVR","from",[105,233,234],{"class":119}," __future__",[105,236,237],{"class":230}," import",[105,239,241],{"class":240},"sVt8B"," annotations\n",[105,243,245],{"class":107,"line":244},12,[105,246,248],{"emptyLinePlaceholder":247},true,"\n",[105,250,252,255],{"class":107,"line":251},13,[105,253,254],{"class":230},"import",[105,256,257],{"class":240}," os\n",[105,259,261],{"class":107,"line":260},14,[105,262,248],{"emptyLinePlaceholder":247},[105,264,266,268],{"class":107,"line":265},15,[105,267,254],{"class":230},[105,269,270],{"class":240}," httpx\n",[105,272,274,276],{"class":107,"line":273},16,[105,275,254],{"class":230},[105,277,278],{"class":240}," typer\n",[105,280,282,284,287,289],{"class":107,"line":281},17,[105,283,231],{"class":230},[105,285,286],{"class":240}," rich.console ",[105,288,254],{"class":230},[105,290,291],{"class":240}," Console\n",[105,293,295],{"class":107,"line":294},18,[105,296,248],{"emptyLinePlaceholder":247},[105,298,300,303,306,309,313,315,318],{"class":107,"line":299},19,[105,301,302],{"class":240},"app ",[105,304,305],{"class":230},"=",[105,307,308],{"class":240}," typer.Typer(",[105,310,312],{"class":311},"s4XuR","add_completion",[105,314,305],{"class":230},[105,316,317],{"class":119},"False",[105,319,320],{"class":240},")\n",[105,322,324,327,329,332,335,337,340],{"class":107,"line":323},20,[105,325,326],{"class":240},"err ",[105,328,305],{"class":230},[105,330,331],{"class":240}," Console(",[105,333,334],{"class":311},"stderr",[105,336,305],{"class":230},[105,338,339],{"class":119},"True",[105,341,320],{"class":240},[105,343,345],{"class":107,"line":344},21,[105,346,248],{"emptyLinePlaceholder":247},[105,348,350],{"class":107,"line":349},22,[105,351,248],{"emptyLinePlaceholder":247},[105,353,355,358,361],{"class":107,"line":354},23,[105,356,357],{"class":230},"def",[105,359,360],{"class":111}," client",[105,362,363],{"class":240},"() -> httpx.Client:\n",[105,365,367,370,372,375,378],{"class":107,"line":366},24,[105,368,369],{"class":240},"    token ",[105,371,305],{"class":230},[105,373,374],{"class":240}," os.environ.get(",[105,376,377],{"class":115},"\"GITHUB_TOKEN\"",[105,379,320],{"class":240},[105,381,383,386,389],{"class":107,"line":382},25,[105,384,385],{"class":230},"    if",[105,387,388],{"class":230}," not",[105,390,391],{"class":240}," token:\n",[105,393,395,398,401],{"class":107,"line":394},26,[105,396,397],{"class":240},"        err.print(",[105,399,400],{"class":115},"\"[red]error:[\u002Fred] set GITHUB_TOKEN\"",[105,402,320],{"class":240},[105,404,406,409,412,415],{"class":107,"line":405},27,[105,407,408],{"class":230},"        raise",[105,410,411],{"class":240}," typer.Exit(",[105,413,414],{"class":119},"2",[105,416,320],{"class":240},[105,418,420,423,426,429,431,434,437,440,442,445],{"class":107,"line":419},28,[105,421,422],{"class":230},"    return",[105,424,425],{"class":240}," httpx.Client(",[105,427,428],{"class":311},"base_url",[105,430,305],{"class":230},[105,432,433],{"class":115},"\"https:\u002F\u002Fapi.github.com\"",[105,435,436],{"class":240},", ",[105,438,439],{"class":311},"timeout",[105,441,305],{"class":230},[105,443,444],{"class":119},"20.0",[105,446,447],{"class":240},",\n",[105,449,451,454,456,459,462,465,468,471,473,476,479,482],{"class":107,"line":450},29,[105,452,453],{"class":311},"                        headers",[105,455,305],{"class":230},[105,457,458],{"class":240},"{",[105,460,461],{"class":115},"\"Authorization\"",[105,463,464],{"class":240},": ",[105,466,467],{"class":230},"f",[105,469,470],{"class":115},"\"Bearer ",[105,472,458],{"class":119},[105,474,475],{"class":240},"token",[105,477,478],{"class":119},"}",[105,480,481],{"class":115},"\"",[105,483,447],{"class":240},[105,485,487,490,492,495],{"class":107,"line":486},30,[105,488,489],{"class":115},"                                 \"Accept\"",[105,491,464],{"class":240},[105,493,494],{"class":115},"\"application\u002Fvnd.github+json\"",[105,496,497],{"class":240},"})\n",[105,499,501],{"class":107,"line":500},31,[105,502,248],{"emptyLinePlaceholder":247},[105,504,506],{"class":107,"line":505},32,[105,507,248],{"emptyLinePlaceholder":247},[105,509,511,514],{"class":107,"line":510},33,[105,512,513],{"class":111},"@app.command",[105,515,516],{"class":240},"()\n",[105,518,520,522,525],{"class":107,"line":519},34,[105,521,357],{"class":230},[105,523,524],{"class":111}," main",[105,526,527],{"class":240},"(\n",[105,529,531,534,537,540,543,546,548,551,553,556],{"class":107,"line":530},35,[105,532,533],{"class":240},"    source: ",[105,535,536],{"class":119},"str",[105,538,539],{"class":230}," =",[105,541,542],{"class":240}," typer.Argument(",[105,544,545],{"class":119},"...",[105,547,436],{"class":240},[105,549,550],{"class":311},"help",[105,552,305],{"class":230},[105,554,555],{"class":115},"\"owner\u002Frepo to copy labels from\"",[105,557,558],{"class":240},"),\n",[105,560,562,565,567,569,571,573,575,577,579,582],{"class":107,"line":561},36,[105,563,564],{"class":240},"    target: ",[105,566,536],{"class":119},[105,568,539],{"class":230},[105,570,542],{"class":240},[105,572,545],{"class":119},[105,574,436],{"class":240},[105,576,550],{"class":311},[105,578,305],{"class":230},[105,580,581],{"class":115},"\"owner\u002Frepo to copy labels to\"",[105,583,558],{"class":240},[105,585,587,590,593,595,598,600,602,605,607,610,612,614,616,619],{"class":107,"line":586},37,[105,588,589],{"class":240},"    dry_run: ",[105,591,592],{"class":119},"bool",[105,594,539],{"class":230},[105,596,597],{"class":240}," typer.Option(",[105,599,317],{"class":119},[105,601,436],{"class":240},[105,603,604],{"class":115},"\"--dry-run\"",[105,606,436],{"class":240},[105,608,609],{"class":115},"\"-n\"",[105,611,436],{"class":240},[105,613,550],{"class":311},[105,615,305],{"class":230},[105,617,618],{"class":115},"\"Show what would change.\"",[105,620,558],{"class":240},[105,622,624,627,630],{"class":107,"line":623},38,[105,625,626],{"class":240},") -> ",[105,628,629],{"class":119},"None",[105,631,632],{"class":240},":\n",[105,634,636],{"class":107,"line":635},39,[105,637,638],{"class":115},"    \"\"\"Copy labels from SOURCE to TARGET, creating any that are missing.\"\"\"\n",[105,640,642,645,648,651],{"class":107,"line":641},40,[105,643,644],{"class":230},"    with",[105,646,647],{"class":240}," client() ",[105,649,650],{"class":230},"as",[105,652,653],{"class":240}," gh:\n",[105,655,657,660,662,665,668,671,674,677,680,683,685,688,690,693,695,698,700,703,705,707,710,712,715],{"class":107,"line":656},41,[105,658,659],{"class":240},"        wanted ",[105,661,305],{"class":230},[105,663,664],{"class":240}," {l[",[105,666,667],{"class":115},"\"name\"",[105,669,670],{"class":240},"]: l ",[105,672,673],{"class":230},"for",[105,675,676],{"class":240}," l ",[105,678,679],{"class":230},"in",[105,681,682],{"class":240}," gh.get(",[105,684,467],{"class":230},[105,686,687],{"class":115},"\"\u002Frepos\u002F",[105,689,458],{"class":119},[105,691,692],{"class":240},"source",[105,694,478],{"class":119},[105,696,697],{"class":115},"\u002Flabels\"",[105,699,436],{"class":240},[105,701,702],{"class":311},"params",[105,704,305],{"class":230},[105,706,458],{"class":240},[105,708,709],{"class":115},"\"per_page\"",[105,711,464],{"class":240},[105,713,714],{"class":119},"100",[105,716,717],{"class":240},"}).json()}\n",[105,719,721,724,726,728,730,733,735,737,739,741,743,745,747,750,752,754,756,758,760,762,764,766,768],{"class":107,"line":720},42,[105,722,723],{"class":240},"        existing ",[105,725,305],{"class":230},[105,727,664],{"class":240},[105,729,667],{"class":115},[105,731,732],{"class":240},"] ",[105,734,673],{"class":230},[105,736,676],{"class":240},[105,738,679],{"class":230},[105,740,682],{"class":240},[105,742,467],{"class":230},[105,744,687],{"class":115},[105,746,458],{"class":119},[105,748,749],{"class":240},"target",[105,751,478],{"class":119},[105,753,697],{"class":115},[105,755,436],{"class":240},[105,757,702],{"class":311},[105,759,305],{"class":230},[105,761,458],{"class":240},[105,763,709],{"class":115},[105,765,464],{"class":240},[105,767,714],{"class":119},[105,769,717],{"class":240},[105,771,773,776,778,781,784,787,790,793],{"class":107,"line":772},43,[105,774,775],{"class":240},"        missing ",[105,777,305],{"class":230},[105,779,780],{"class":119}," sorted",[105,782,783],{"class":240},"(",[105,785,786],{"class":119},"set",[105,788,789],{"class":240},"(wanted) ",[105,791,792],{"class":230},"-",[105,794,795],{"class":240}," existing)\n",[105,797,799,802,805,807],{"class":107,"line":798},44,[105,800,801],{"class":230},"        for",[105,803,804],{"class":240}," name ",[105,806,679],{"class":230},[105,808,809],{"class":240}," missing:\n",[105,811,813,816,818],{"class":107,"line":812},45,[105,814,815],{"class":240},"            label ",[105,817,305],{"class":230},[105,819,820],{"class":240}," wanted[name]\n",[105,822,824,827,829,831,833,836,839,842,845,848,850,853,855,858,860,863],{"class":107,"line":823},46,[105,825,826],{"class":240},"            err.print(",[105,828,467],{"class":230},[105,830,481],{"class":115},[105,832,458],{"class":119},[105,834,835],{"class":115},"'would create'",[105,837,838],{"class":230}," if",[105,840,841],{"class":240}," dry_run ",[105,843,844],{"class":230},"else",[105,846,847],{"class":115}," 'creating'",[105,849,478],{"class":119},[105,851,852],{"class":115}," [bold]",[105,854,458],{"class":119},[105,856,857],{"class":240},"name",[105,859,478],{"class":119},[105,861,862],{"class":115},"[\u002Fbold]\"",[105,864,320],{"class":240},[105,866,868,871,873],{"class":107,"line":867},47,[105,869,870],{"class":230},"            if",[105,872,388],{"class":230},[105,874,875],{"class":240}," dry_run:\n",[105,877,879,882,884,886,888,890,892,894,896,899,901],{"class":107,"line":878},48,[105,880,881],{"class":240},"                gh.post(",[105,883,467],{"class":230},[105,885,687],{"class":115},[105,887,458],{"class":119},[105,889,749],{"class":240},[105,891,478],{"class":119},[105,893,697],{"class":115},[105,895,436],{"class":240},[105,897,898],{"class":311},"json",[105,900,305],{"class":230},[105,902,903],{"class":240},"{\n",[105,905,907,910,913,916,919,921,924,927,930,932,935,938,941],{"class":107,"line":906},49,[105,908,909],{"class":115},"                    \"name\"",[105,911,912],{"class":240},": name, ",[105,914,915],{"class":115},"\"color\"",[105,917,918],{"class":240},": label[",[105,920,915],{"class":115},[105,922,923],{"class":240},"], ",[105,925,926],{"class":115},"\"description\"",[105,928,929],{"class":240},": label.get(",[105,931,926],{"class":115},[105,933,934],{"class":240},") ",[105,936,937],{"class":230},"or",[105,939,940],{"class":115}," \"\"",[105,942,447],{"class":240},[105,944,946],{"class":107,"line":945},50,[105,947,948],{"class":240},"                }).raise_for_status()\n",[105,950,952,955,957,959,962,965,967,970,972,975,977,979,981,984,986,988],{"class":107,"line":951},51,[105,953,954],{"class":240},"    err.print(",[105,956,467],{"class":230},[105,958,481],{"class":115},[105,960,961],{"class":119},"{len",[105,963,964],{"class":240},"(missing)",[105,966,478],{"class":119},[105,968,969],{"class":115}," label(s) ",[105,971,458],{"class":119},[105,973,974],{"class":115},"'to create'",[105,976,838],{"class":230},[105,978,841],{"class":240},[105,980,844],{"class":230},[105,982,983],{"class":115}," 'created'",[105,985,478],{"class":119},[105,987,481],{"class":115},[105,989,320],{"class":240},[105,991,993],{"class":107,"line":992},52,[105,994,248],{"emptyLinePlaceholder":247},[105,996,998],{"class":107,"line":997},53,[105,999,248],{"emptyLinePlaceholder":247},[105,1001,1003,1006,1009,1012,1015],{"class":107,"line":1002},54,[105,1004,1005],{"class":230},"if",[105,1007,1008],{"class":119}," __name__",[105,1010,1011],{"class":230}," ==",[105,1013,1014],{"class":115}," \"__main__\"",[105,1016,632],{"class":240},[105,1018,1020],{"class":107,"line":1019},55,[105,1021,1022],{"class":240},"    app()\n",[10,1024,1025],{},"Run it:",[96,1027,1029],{"className":98,"code":1028,"language":100,"meta":101,"style":101},"uv run sync_labels.py acme\u002Fapi acme\u002Fweb --dry-run\n.\u002Fsync_labels.py acme\u002Fapi acme\u002Fweb          # after chmod +x, thanks to the shebang\n",[14,1030,1031,1049],{"__ignoreMap":101},[105,1032,1033,1035,1038,1040,1043,1046],{"class":107,"line":108},[105,1034,112],{"class":111},[105,1036,1037],{"class":115}," run",[105,1039,123],{"class":115},[105,1041,1042],{"class":115}," acme\u002Fapi",[105,1044,1045],{"class":115}," acme\u002Fweb",[105,1047,1048],{"class":119}," --dry-run\n",[105,1050,1051,1054,1056,1058],{"class":107,"line":132},[105,1052,1053],{"class":111},".\u002Fsync_labels.py",[105,1055,1042],{"class":115},[105,1057,1045],{"class":115},[105,1059,1060],{"class":165},"          # after chmod +x, thanks to the shebang\n",[10,1062,1063,1064,42],{},"The first run creates an environment with the declared dependencies in uv's cache; later runs reuse it and start almost instantly. Nothing is installed into the user's global Python or any project's ",[14,1065,1066],{},".venv",[1068,1069,1071],"h3",{"id":1070},"the-shebang","The shebang",[10,1073,1074,1077,1078,1081,1082,1085,1086,1089,1090,1093,1094,1097],{},[14,1075,1076],{},"#!\u002Fusr\u002Fbin\u002Fenv -S uv run --script"," makes the file directly executable on Linux and macOS: the ",[14,1079,1080],{},"-S"," flag lets ",[14,1083,1084],{},"env"," pass multiple arguments, so the kernel runs ",[14,1087,1088],{},"uv run --script .\u002Fsync_labels.py ...",". Colleagues can put the script on their ",[14,1091,1092],{},"PATH"," and use it like any other command, and uv handles the environment invisibly. On Windows, ",[14,1095,1096],{},"uv run sync_labels.py"," works; the shebang is simply ignored.",[1068,1099,1101],{"id":1100},"locking-for-reproducibility","Locking for reproducibility",[10,1103,1104],{},"The dependency block holds ranges, so two runs months apart may resolve different versions. When that matters — a script in a runbook, or one run in CI — lock it:",[96,1106,1108],{"className":98,"code":1107,"language":100,"meta":101,"style":101},"uv lock --script sync_labels.py      # writes sync_labels.py.lock next to the script\n",[14,1109,1110],{"__ignoreMap":101},[105,1111,1112,1114,1117,1119,1121],{"class":107,"line":108},[105,1113,112],{"class":111},[105,1115,1116],{"class":115}," lock",[105,1118,120],{"class":119},[105,1120,123],{"class":115},[105,1122,1123],{"class":165},"      # writes sync_labels.py.lock next to the script\n",[10,1125,1126,1128,1129,1132,1133,1136],{},[14,1127,35],{}," then uses the locked versions whenever the lockfile is present and consistent with the block. Commit the lockfile alongside the script. An alternative that keeps everything in one file is ",[14,1130,1131],{},"exclude-newer"," in a ",[14,1134,1135],{},"[tool.uv]"," table inside the block, which restricts resolution to packages published before a date — handy for scripts that must behave the same in a year's time.",[1068,1138,1140],{"id":1139},"sharing-scripts-across-a-team","Sharing scripts across a team",[10,1142,1143,1144,1147],{},"Self-describing scripts change how a team can share small tools. Instead of a wiki page of \"setup steps\", a repository of scripts — ",[14,1145,1146],{},"ops-scripts\u002F"," with one file per task — becomes a toolbox anyone can use with nothing but uv installed. A few conventions keep such a collection healthy:",[49,1149,1150,1167,1181,1190,1196],{},[52,1151,1152,1156,1157,436,1160,436,1163,1166],{},[1153,1154,1155],"strong",{},"One task per file, named for the verb."," ",[14,1158,1159],{},"rotate_keys.py",[14,1161,1162],{},"audit_buckets.py",[14,1164,1165],{},"sync_labels.py",". The file name is the command name.",[52,1168,1169,1176,1177,1180],{},[1153,1170,1171,1172,1175],{},"A docstring and ",[14,1173,1174],{},"--help"," in every script."," A short ",[14,1178,1179],{},"README"," that lists each script with its one-line purpose is then easy to generate from the docstrings.",[52,1182,1183,1186,1187,1189],{},[1153,1184,1185],{},"Lock scripts that touch production."," A lockfile beside ",[14,1188,1159],{}," means the script run during an incident behaves exactly as it did when it was reviewed.",[52,1191,1192,1195],{},[1153,1193,1194],{},"Review them like code."," Scripts that act on real systems deserve the same pull-request review as the services they touch; the single-file format makes that review easy.",[52,1197,1198,1201],{},[1153,1199,1200],{},"Retire them."," A script nobody has run in a year is a liability. Delete it, or promote it into a maintained CLI if it turns out to matter.",[10,1203,1204],{},"When several scripts start sharing helper code, that is the clearest signal they want to become one CLI with subcommands.",[44,1206,1208],{"id":1207},"script-or-project","Script or project?",[63,1210],{"name":1211},"pep723-decision",[10,1213,1214,1215,1218,1219,1222,1223,1226,1227,1231],{},"PEP 723 scripts are ideal for tools that are one file, one job, run by a handful of people. Signs a script should become a project: it has grown past a few hundred lines or wants a second module; it needs tests you run in CI; other people want to install it as a command; or it needs data files. Graduating is straightforward: ",[14,1216,1217],{},"uv init --package",", move the code into ",[14,1220,1221],{},"src\u002F",", and copy the dependency list into ",[14,1224,1225],{},"[project] dependencies"," — the syntax is the same. ",[38,1228,1230],{"href":1229},"\u002Fproject-setup-dependency-management\u002Fuv-for-python-cli-dependency-management\u002Fuv-init-vs-poetry-init-for-cli-tools\u002F","uv init vs Poetry init for CLI tools"," covers the project side.",[44,1233,1235],{"id":1234},"ux-considerations","UX considerations",[49,1237,1238,1249,1263,1277],{},[52,1239,1240,1156,1243,436,1245,1248],{},[1153,1241,1242],{},"Treat it as a real CLI.",[14,1244,1174],{},[14,1246,1247],{},"--dry-run",", clear errors and exit codes cost a few lines with Typer and save the next person from reading the source.",[52,1250,1251,1254,1255,1258,1259,42],{},[1153,1252,1253],{},"Put narration on stderr."," Even a one-off script might be piped into ",[14,1256,1257],{},"jq"," one day; keep stdout for results. The reasoning is in ",[38,1260,1262],{"href":1261},"\u002Fadvanced-input-parsing-user-experience\u002Fworking-with-stdin-stdout-and-pipes\u002F","working with stdin, stdout and pipes",[52,1264,1265,1268,1269,1272,1273,42],{},[1153,1266,1267],{},"Read secrets from the environment."," Never hard-code tokens in shared scripts; ",[14,1270,1271],{},"GITHUB_TOKEN"," from the environment is shown above, and the broader patterns are in ",[38,1274,1276],{"href":1275},"\u002Fcli-runtime-systems-integration\u002Fsecrets-and-credentials-in-python-clis\u002Freading-secrets-from-env-and-files\u002F","reading secrets from env and files",[52,1278,1279,1156,1282,1285],{},[1153,1280,1281],{},"Disable what you do not need.",[14,1283,1284],{},"add_completion=False"," hides Typer's completion options, which make little sense for a script not installed as a command.",[63,1287],{"name":1288},"pep723-terminal",[44,1290,1292],{"id":1291},"testing-the-behaviour","Testing the behaviour",[10,1294,1295,1296,1299],{},"Scripts that matter deserve a test or two. Because a PEP 723 script is importable Python, pytest can load it as a module, and ",[14,1297,1298],{},"uv run --with"," provides test dependencies without adding them to the script's own block:",[96,1301,1303],{"className":156,"code":1302,"language":158,"meta":101,"style":101},"# test_sync_labels.py\nimport importlib.util\nfrom pathlib import Path\n\nfrom typer.testing import CliRunner\n\nspec = importlib.util.spec_from_file_location(\"sync_labels\", Path(__file__).with_name(\"sync_labels.py\"))\nsync_labels = importlib.util.module_from_spec(spec)\nspec.loader.exec_module(sync_labels)\n\n\ndef test_missing_token_is_a_usage_error(monkeypatch):\n    monkeypatch.delenv(\"GITHUB_TOKEN\", raising=False)\n    result = CliRunner().invoke(sync_labels.app, [\"a\u002Fb\", \"c\u002Fd\"])\n    assert result.exit_code == 2\n    assert \"GITHUB_TOKEN\" in result.output\n\n\ndef test_help_mentions_dry_run():\n    result = CliRunner().invoke(sync_labels.app, [\"--help\"])\n    assert \"--dry-run\" in result.output\n",[14,1304,1305,1310,1317,1329,1333,1345,1349,1377,1387,1392,1396,1400,1410,1428,1449,1463,1476,1480,1484,1494,1507],{"__ignoreMap":101},[105,1306,1307],{"class":107,"line":108},[105,1308,1309],{"class":165},"# test_sync_labels.py\n",[105,1311,1312,1314],{"class":107,"line":132},[105,1313,254],{"class":230},[105,1315,1316],{"class":240}," importlib.util\n",[105,1318,1319,1321,1324,1326],{"class":107,"line":177},[105,1320,231],{"class":230},[105,1322,1323],{"class":240}," pathlib ",[105,1325,254],{"class":230},[105,1327,1328],{"class":240}," Path\n",[105,1330,1331],{"class":107,"line":183},[105,1332,248],{"emptyLinePlaceholder":247},[105,1334,1335,1337,1340,1342],{"class":107,"line":189},[105,1336,231],{"class":230},[105,1338,1339],{"class":240}," typer.testing ",[105,1341,254],{"class":230},[105,1343,1344],{"class":240}," CliRunner\n",[105,1346,1347],{"class":107,"line":195},[105,1348,248],{"emptyLinePlaceholder":247},[105,1350,1351,1354,1356,1359,1362,1365,1368,1371,1374],{"class":107,"line":201},[105,1352,1353],{"class":240},"spec ",[105,1355,305],{"class":230},[105,1357,1358],{"class":240}," importlib.util.spec_from_file_location(",[105,1360,1361],{"class":115},"\"sync_labels\"",[105,1363,1364],{"class":240},", Path(",[105,1366,1367],{"class":119},"__file__",[105,1369,1370],{"class":240},").with_name(",[105,1372,1373],{"class":115},"\"sync_labels.py\"",[105,1375,1376],{"class":240},"))\n",[105,1378,1379,1382,1384],{"class":107,"line":207},[105,1380,1381],{"class":240},"sync_labels ",[105,1383,305],{"class":230},[105,1385,1386],{"class":240}," importlib.util.module_from_spec(spec)\n",[105,1388,1389],{"class":107,"line":213},[105,1390,1391],{"class":240},"spec.loader.exec_module(sync_labels)\n",[105,1393,1394],{"class":107,"line":221},[105,1395,248],{"emptyLinePlaceholder":247},[105,1397,1398],{"class":107,"line":227},[105,1399,248],{"emptyLinePlaceholder":247},[105,1401,1402,1404,1407],{"class":107,"line":244},[105,1403,357],{"class":230},[105,1405,1406],{"class":111}," test_missing_token_is_a_usage_error",[105,1408,1409],{"class":240},"(monkeypatch):\n",[105,1411,1412,1415,1417,1419,1422,1424,1426],{"class":107,"line":251},[105,1413,1414],{"class":240},"    monkeypatch.delenv(",[105,1416,377],{"class":115},[105,1418,436],{"class":240},[105,1420,1421],{"class":311},"raising",[105,1423,305],{"class":230},[105,1425,317],{"class":119},[105,1427,320],{"class":240},[105,1429,1430,1433,1435,1438,1441,1443,1446],{"class":107,"line":260},[105,1431,1432],{"class":240},"    result ",[105,1434,305],{"class":230},[105,1436,1437],{"class":240}," CliRunner().invoke(sync_labels.app, [",[105,1439,1440],{"class":115},"\"a\u002Fb\"",[105,1442,436],{"class":240},[105,1444,1445],{"class":115},"\"c\u002Fd\"",[105,1447,1448],{"class":240},"])\n",[105,1450,1451,1454,1457,1460],{"class":107,"line":265},[105,1452,1453],{"class":230},"    assert",[105,1455,1456],{"class":240}," result.exit_code ",[105,1458,1459],{"class":230},"==",[105,1461,1462],{"class":119}," 2\n",[105,1464,1465,1467,1470,1473],{"class":107,"line":273},[105,1466,1453],{"class":230},[105,1468,1469],{"class":115}," \"GITHUB_TOKEN\"",[105,1471,1472],{"class":230}," in",[105,1474,1475],{"class":240}," result.output\n",[105,1477,1478],{"class":107,"line":281},[105,1479,248],{"emptyLinePlaceholder":247},[105,1481,1482],{"class":107,"line":294},[105,1483,248],{"emptyLinePlaceholder":247},[105,1485,1486,1488,1491],{"class":107,"line":299},[105,1487,357],{"class":230},[105,1489,1490],{"class":111}," test_help_mentions_dry_run",[105,1492,1493],{"class":240},"():\n",[105,1495,1496,1498,1500,1502,1505],{"class":107,"line":323},[105,1497,1432],{"class":240},[105,1499,305],{"class":230},[105,1501,1437],{"class":240},[105,1503,1504],{"class":115},"\"--help\"",[105,1506,1448],{"class":240},[105,1508,1509,1511,1514,1516],{"class":107,"line":344},[105,1510,1453],{"class":230},[105,1512,1513],{"class":115}," \"--dry-run\"",[105,1515,1472],{"class":230},[105,1517,1475],{"class":240},[96,1519,1521],{"className":98,"code":1520,"language":100,"meta":101,"style":101},"uv run --with pytest --with-requirements sync_labels.py pytest test_sync_labels.py\n",[14,1522,1523],{"__ignoreMap":101},[105,1524,1525,1527,1529,1532,1535,1538,1540,1542],{"class":107,"line":108},[105,1526,112],{"class":111},[105,1528,1037],{"class":115},[105,1530,1531],{"class":119}," --with",[105,1533,1534],{"class":115}," pytest",[105,1536,1537],{"class":119}," --with-requirements",[105,1539,123],{"class":115},[105,1541,1534],{"class":115},[105,1543,1544],{"class":115}," test_sync_labels.py\n",[10,1546,1547,1550,1551,1554,1555,1559],{},[14,1548,1549],{},"--with-requirements sync_labels.py"," installs the script's own declared dependencies into the test environment, so the test runs against exactly what the script declares. For HTTP calls, the ",[14,1552,1553],{},"MockTransport"," techniques in ",[38,1556,1558],{"href":1557},"\u002Fcli-runtime-systems-integration\u002Fcalling-http-apis-from-python-clis\u002Fbuilding-an-api-client-cli-with-httpx\u002F","building an API client CLI with httpx"," apply unchanged.",[44,1561,1563],{"id":1562},"conclusion","Conclusion",[10,1565,1566,1567,1569,1570,1573],{},"PEP 723 turns a one-off Python script into a self-contained, shareable tool: declare the Python version and dependencies in a comment block, run it with ",[14,1568,35],{},", add a ",[14,1571,1572],{},"uv run --script"," shebang to make it executable, and lock it when reproducibility matters. Write it as a small real CLI from the start, and when it outgrows one file, graduating to a project is a copy-and-paste of the dependency list.",[44,1575,1577],{"id":1576},"frequently-asked-questions","Frequently asked questions",[1068,1579,1581],{"id":1580},"does-pipx-support-pep-723-scripts-too","Does pipx support PEP 723 scripts too?",[10,1583,1584,1585,1588],{},"Yes — ",[14,1586,1587],{},"pipx run script.py"," reads the same block. uv is faster and adds locking and script editing commands, but the file itself is portable between tools.",[1068,1590,1592],{"id":1591},"where-does-uv-keep-the-script-environments","Where does uv keep the script environments?",[10,1594,1595,1596,1599],{},"In its cache directory, keyed by the script's dependencies. ",[14,1597,1598],{},"uv cache clean"," removes them; they are recreated on the next run.",[1068,1601,1603],{"id":1602},"can-a-script-depend-on-a-private-package-index","Can a script depend on a private package index?",[10,1605,1606,1607,1609,1610,1613,1614,1617],{},"Yes, via a ",[14,1608,1135],{}," table inside the block (for example ",[14,1611,1612],{},"index-url","), or through environment variables such as ",[14,1615,1616],{},"UV_INDEX_URL",". Credentials should come from the environment or keyring, never the script.",[1068,1619,1621],{"id":1620},"can-i-run-a-script-straight-from-a-url","Can I run a script straight from a URL?",[10,1623,1624,1627],{},[14,1625,1626],{},"uv run https:\u002F\u002Fexample.com\u002Fscript.py"," works, and the inline metadata is honoured. Only do this for sources you trust — it runs arbitrary code with your permissions.",[44,1629,1631],{"id":1630},"related","Related",[49,1633,1634,1640,1646,1652,1658],{},[52,1635,1636,1637],{},"Up: ",[38,1638,1639],{"href":40},"uv for Python CLI dependency management",[52,1641,1642],{},[38,1643,1645],{"href":1644},"\u002Fproject-setup-dependency-management\u002Fuv-for-python-cli-dependency-management\u002Fuv-workspaces-for-multi-package-clis\u002F","uv workspaces for multi-package CLIs",[52,1647,1648],{},[38,1649,1651],{"href":1650},"\u002Fproject-setup-dependency-management\u002Fuv-for-python-cli-dependency-management\u002Fuv-tool-install-vs-pipx-for-clis\u002F","uv tool install vs pipx for CLIs",[52,1653,1654],{},[38,1655,1657],{"href":1656},"\u002Fproject-setup-dependency-management\u002Fdistributing-clis-as-standalone-binaries\u002Fshipping-a-cli-as-a-zipapp-with-shiv\u002F","Shipping a CLI as a zipapp with shiv",[52,1659,1660],{},[38,1661,1663],{"href":1662},"\u002Fcli-runtime-systems-integration\u002Fcalling-http-apis-from-python-clis\u002F","Calling HTTP APIs from Python CLIs",[1665,1666,1667],"style",{},"html pre.shiki code .sScJk, html code.shiki .sScJk{--shiki-default:#6F42C1;--shiki-dark:#B392F0}html pre.shiki code .sZZnC, html code.shiki .sZZnC{--shiki-default:#032F62;--shiki-dark:#9ECBFF}html pre.shiki code .sj4cs, html code.shiki .sj4cs{--shiki-default:#005CC5;--shiki-dark:#79B8FF}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .sJ8bj, html code.shiki .sJ8bj{--shiki-default:#6A737D;--shiki-dark:#6A737D}html pre.shiki code .szBVR, html code.shiki .szBVR{--shiki-default:#D73A49;--shiki-dark:#F97583}html pre.shiki code .sVt8B, html code.shiki .sVt8B{--shiki-default:#24292E;--shiki-dark:#E1E4E8}html pre.shiki code .s4XuR, html code.shiki .s4XuR{--shiki-default:#E36209;--shiki-dark:#FFAB70}",{"title":101,"searchDepth":132,"depth":132,"links":1669},[1670,1671,1672,1677,1678,1679,1680,1681,1687],{"id":46,"depth":132,"text":47},{"id":60,"depth":132,"text":61},{"id":90,"depth":132,"text":91,"children":1673},[1674,1675,1676],{"id":1070,"depth":177,"text":1071},{"id":1100,"depth":177,"text":1101},{"id":1139,"depth":177,"text":1140},{"id":1207,"depth":132,"text":1208},{"id":1234,"depth":132,"text":1235},{"id":1291,"depth":132,"text":1292},{"id":1562,"depth":132,"text":1563},{"id":1576,"depth":132,"text":1577,"children":1682},[1683,1684,1685,1686],{"id":1580,"depth":177,"text":1581},{"id":1591,"depth":177,"text":1592},{"id":1602,"depth":177,"text":1603},{"id":1620,"depth":177,"text":1621},{"id":1630,"depth":132,"text":1631},"2026-09-18","Write single-file Python CLI scripts that declare their own dependencies with PEP 723 inline metadata, run anywhere with uv run, lock them, and graduate them later.","beginner",false,"md",{},"\u002Fproject-setup-dependency-management\u002Fuv-for-python-cli-dependency-management\u002Frunning-one-off-cli-scripts-with-uv-run",{"title":5,"description":1689},"project-setup-dependency-management\u002Fuv-for-python-cli-dependency-management\u002Frunning-one-off-cli-scripts-with-uv-run\u002Findex",[112,1698,1699,1700],"pep-723","scripts","automation","PtOqX-OPTV47ofbirhewZQirEwEXtZu0bbbtUEGdBAE",[1703,1706,1709,1712,1715,1718,1721,1724,1727,1730,1733,1736,1739,1742,1745,1748,1751,1754,1757,1760,1763,1766,1769,1772,1775,1778,1781,1784,1787,1790,1793,1796,1799,1802,1805,1808,1811,1814,1817,1820,1823,1826,1829,1832,1835,1838,1841,1844,1847,1850,1853,1856,1859,1862,1865,1868,1871,1874,1876,1879,1882,1885,1888,1891,1894,1897,1900,1903,1906,1909,1912,1915,1918,1921,1924,1927,1930,1933,1936,1939,1942,1945,1948,1951,1954,1957,1960,1963,1966,1969,1972,1975,1978,1981,1984,1987,1990,1993,1996,1999,2002,2005,2008,2011,2014,2017,2020,2023,2026,2029,2032,2035,2038,2041,2044,2047,2050,2053,2056,2059,2062,2065,2068,2071,2074,2077,2080,2083,2086,2089,2092,2095,2098,2101,2104,2107,2110,2113,2116,2119,2122,2125,2128,2131,2134,2137,2140,2143,2146,2149,2152,2155,2158,2161,2164,2167,2170,2173,2176,2179,2182,2185,2188,2191,2194,2197,2200,2203,2206,2209,2212,2215,2218,2221,2224,2227,2228,2231,2233,2236,2239,2242,2245],{"path":1704,"title":1705},"\u002Fabout","About Python CLI Toolcraft",{"path":1707,"title":1708},"\u002Fadvanced-input-parsing-user-experience\u002Fadvanced-argument-validation-strategies","Advanced Argument Validation Strategies",{"path":1710,"title":1711},"\u002Fadvanced-input-parsing-user-experience\u002Fadvanced-argument-validation-strategies\u002Fparsing-nested-json-arguments-in-python-clis","Parsing Nested JSON Args in Python CLIs",{"path":1713,"title":1714},"\u002Fadvanced-input-parsing-user-experience\u002Fadvanced-argument-validation-strategies\u002Fvalidating-dependent-and-conflicting-options","Validating Dependent and Conflicting CLI Options",{"path":1716,"title":1717},"\u002Fadvanced-input-parsing-user-experience\u002Fadvanced-argument-validation-strategies\u002Fvalidating-file-and-directory-paths-in-clis","Validating File and Directory Paths in CLIs",{"path":1719,"title":1720},"\u002Fadvanced-input-parsing-user-experience\u002Fadvanced-argument-validation-strategies\u002Fwriting-custom-click-parameter-types","Writing Custom Click Parameter Types",{"path":1722,"title":1723},"\u002Fadvanced-input-parsing-user-experience\u002Fbuilding-terminal-uis-with-textual\u002Fbuilding-your-first-textual-app","Building Your First Textual App for a Python CLI",{"path":1725,"title":1726},"\u002Fadvanced-input-parsing-user-experience\u002Fbuilding-terminal-uis-with-textual\u002Fchoosing-between-a-cli-a-prompt-flow-and-a-tui","Choosing Between a CLI, a Prompt Flow and a TUI",{"path":1728,"title":1729},"\u002Fadvanced-input-parsing-user-experience\u002Fbuilding-terminal-uis-with-textual","Building Terminal UIs with Textual for Python CLIs",{"path":1731,"title":1732},"\u002Fadvanced-input-parsing-user-experience\u002Fbuilding-terminal-uis-with-textual\u002Ftesting-textual-apps-with-pilot","Testing Textual Apps with Pilot",{"path":1734,"title":1735},"\u002Fadvanced-input-parsing-user-experience\u002Fcli-help-output-and-documentation\u002Fadding-examples-and-epilogs-to-help-output","Adding Examples and Epilogs to Help Output",{"path":1737,"title":1738},"\u002Fadvanced-input-parsing-user-experience\u002Fcli-help-output-and-documentation\u002Fgenerating-man-pages-and-docs-from-a-cli","Generating Man Pages and Docs from a CLI",{"path":1740,"title":1741},"\u002Fadvanced-input-parsing-user-experience\u002Fcli-help-output-and-documentation","CLI Help Output and Documentation",{"path":1743,"title":1744},"\u002Fadvanced-input-parsing-user-experience\u002Fcli-help-output-and-documentation\u002Fversioning-and-deprecating-cli-flags","Versioning and Deprecating CLI Flags",{"path":1746,"title":1747},"\u002Fadvanced-input-parsing-user-experience\u002Fcli-help-output-and-documentation\u002Fwriting-help-text-users-actually-read","Writing Help Text Users Actually Read",{"path":1749,"title":1750},"\u002Fadvanced-input-parsing-user-experience\u002Fcross-platform-terminal-compatibility\u002Fadapting-output-to-terminal-width","Adapting Python CLI Output to Terminal Width",{"path":1752,"title":1753},"\u002Fadvanced-input-parsing-user-experience\u002Fcross-platform-terminal-compatibility\u002Fdetecting-ci-environments-and-non-interactive-shells","Detecting CI Environments and Non-Interactive Shells",{"path":1755,"title":1756},"\u002Fadvanced-input-parsing-user-experience\u002Fcross-platform-terminal-compatibility\u002Ffixing-unicode-and-encoding-errors-on-windows","Fixing Unicode and Encoding Errors on Windows in Python CLIs",{"path":1758,"title":1759},"\u002Fadvanced-input-parsing-user-experience\u002Fcross-platform-terminal-compatibility","Cross-Platform Terminal Compatibility for Python CLIs",{"path":1761,"title":1762},"\u002Fadvanced-input-parsing-user-experience\u002Fcross-platform-terminal-compatibility\u002Frespecting-no-color-and-force-color","Respecting NO_COLOR and FORCE_COLOR in Python CLIs",{"path":1764,"title":1765},"\u002Fadvanced-input-parsing-user-experience\u002Ferror-handling-and-exit-codes\u002Fchoosing-exit-codes-for-cli-tools","Choosing Exit Codes for CLI Tools",{"path":1767,"title":1768},"\u002Fadvanced-input-parsing-user-experience\u002Ferror-handling-and-exit-codes\u002Fdesigning-an-exception-hierarchy-for-a-cli","Designing an Exception Hierarchy for a Python CLI",{"path":1770,"title":1771},"\u002Fadvanced-input-parsing-user-experience\u002Ferror-handling-and-exit-codes\u002Ffriendly-error-messages-and-tracebacks","Friendly Error Messages and Tracebacks",{"path":1773,"title":1774},"\u002Fadvanced-input-parsing-user-experience\u002Ferror-handling-and-exit-codes\u002Fhandling-keyboard-interrupt-cleanly","Handling Keyboard Interrupt Cleanly",{"path":1776,"title":1777},"\u002Fadvanced-input-parsing-user-experience\u002Ferror-handling-and-exit-codes","Error Handling and Exit Codes for CLIs",{"path":1779,"title":1780},"\u002Fadvanced-input-parsing-user-experience\u002Ferror-handling-and-exit-codes\u002Freporting-machine-readable-errors-in-json-mode","Reporting Machine-Readable Errors in JSON Mode",{"path":1782,"title":1783},"\u002Fadvanced-input-parsing-user-experience\u002Fhandling-configuration-files-env-vars\u002Fconfig-precedence-flags-env-files-defaults","Config Precedence: Flags, Env, Files, Defaults",{"path":1785,"title":1786},"\u002Fadvanced-input-parsing-user-experience\u002Fhandling-configuration-files-env-vars\u002Fdiscovering-project-config-files-by-walking-up-directories","Discovering Project Config Files by Walking Up Directories",{"path":1788,"title":1789},"\u002Fadvanced-input-parsing-user-experience\u002Fhandling-configuration-files-env-vars","Handling Config Files and Env Vars in CLIs",{"path":1791,"title":1792},"\u002Fadvanced-input-parsing-user-experience\u002Fhandling-configuration-files-env-vars\u002Floading-yaml-configs-safely-in-cli-apps","Loading YAML configs safely in CLI apps",{"path":1794,"title":1795},"\u002Fadvanced-input-parsing-user-experience\u002Fhandling-configuration-files-env-vars\u002Freading-toml-config-with-tomllib","Reading TOML Config with tomllib in Python CLIs",{"path":1797,"title":1798},"\u002Fadvanced-input-parsing-user-experience\u002Fhandling-configuration-files-env-vars\u002Ftyped-settings-with-pydantic-settings","Typed Settings with pydantic-settings in Python CLIs",{"path":1800,"title":1801},"\u002Fadvanced-input-parsing-user-experience","Advanced Input Parsing for Python CLIs",{"path":1803,"title":1804},"\u002Fadvanced-input-parsing-user-experience\u002Finteractive-terminal-ui-with-rich\u002Fadding-progress-bars-and-spinners-to-python-clis","Progress Bars and Spinners for Python CLIs",{"path":1806,"title":1807},"\u002Fadvanced-input-parsing-user-experience\u002Finteractive-terminal-ui-with-rich\u002Fbuilding-interactive-prompts-and-menus","Building Interactive Prompts and Menus in Python CLIs",{"path":1809,"title":1810},"\u002Fadvanced-input-parsing-user-experience\u002Finteractive-terminal-ui-with-rich","Interactive Terminal UI with Rich",{"path":1812,"title":1813},"\u002Fadvanced-input-parsing-user-experience\u002Finteractive-terminal-ui-with-rich\u002Flive-dashboards-with-rich-live","Live Dashboards with Rich Live in Python CLIs",{"path":1815,"title":1816},"\u002Fadvanced-input-parsing-user-experience\u002Finteractive-terminal-ui-with-rich\u002Frendering-tables-and-json-with-rich","Rendering Tables and JSON with Rich",{"path":1818,"title":1819},"\u002Fadvanced-input-parsing-user-experience\u002Finteractive-terminal-ui-with-rich\u002Ftheming-rich-output-consistently","Theming Rich Output Consistently in Python CLIs",{"path":1821,"title":1822},"\u002Fadvanced-input-parsing-user-experience\u002Fshell-completion-for-python-clis\u002Fdynamic-completion-values-from-apis-and-files","Dynamic Completion Values from APIs and Files",{"path":1824,"title":1825},"\u002Fadvanced-input-parsing-user-experience\u002Fshell-completion-for-python-clis\u002Fenabling-tab-completion-in-click-and-typer","Enabling Tab Completion in Click and Typer",{"path":1827,"title":1828},"\u002Fadvanced-input-parsing-user-experience\u002Fshell-completion-for-python-clis","Shell Completion for Python CLIs",{"path":1830,"title":1831},"\u002Fadvanced-input-parsing-user-experience\u002Fshell-completion-for-python-clis\u002Finstalling-shell-completion-for-bash-zsh-fish","Installing Shell Completion for bash, zsh, fish",{"path":1833,"title":1834},"\u002Fadvanced-input-parsing-user-experience\u002Fshell-completion-for-python-clis\u002Ftesting-shell-completion-in-python-clis","Testing Shell Completion in Python CLIs",{"path":1836,"title":1837},"\u002Fadvanced-input-parsing-user-experience\u002Fstructured-logging-for-cli-apps\u002Fadding-trace-ids-and-context-to-cli-logs","Adding Trace IDs and Context to Python CLI Logs",{"path":1839,"title":1840},"\u002Fadvanced-input-parsing-user-experience\u002Fstructured-logging-for-cli-apps\u002Fadding-verbose-and-quiet-logging-flags","Adding Verbose and Quiet Logging Flags",{"path":1842,"title":1843},"\u002Fadvanced-input-parsing-user-experience\u002Fstructured-logging-for-cli-apps","Structured Logging for CLI Apps",{"path":1845,"title":1846},"\u002Fadvanced-input-parsing-user-experience\u002Fstructured-logging-for-cli-apps\u002Fstructured-json-logging-in-python-clis","Structured JSON Logging in Python CLIs",{"path":1848,"title":1849},"\u002Fadvanced-input-parsing-user-experience\u002Fstructured-logging-for-cli-apps\u002Fwriting-rotating-log-files-from-a-cli","Writing Rotating Log Files from a Python CLI",{"path":1851,"title":1852},"\u002Fadvanced-input-parsing-user-experience\u002Fworking-with-stdin-stdout-and-pipes\u002Fdetecting-tty-and-adapting-output","Detecting a TTY and Adapting Output",{"path":1854,"title":1855},"\u002Fadvanced-input-parsing-user-experience\u002Fworking-with-stdin-stdout-and-pipes\u002Femitting-json-output-for-scripting","Emitting JSON Output for Scripting",{"path":1857,"title":1858},"\u002Fadvanced-input-parsing-user-experience\u002Fworking-with-stdin-stdout-and-pipes\u002Fhandling-broken-pipe-and-sigpipe","Handling Broken Pipe and SIGPIPE",{"path":1860,"title":1861},"\u002Fadvanced-input-parsing-user-experience\u002Fworking-with-stdin-stdout-and-pipes","Working with stdin, stdout and Pipes",{"path":1863,"title":1864},"\u002Fadvanced-input-parsing-user-experience\u002Fworking-with-stdin-stdout-and-pipes\u002Fprocessing-large-files-and-ndjson-streams","Processing Large Files and NDJSON Streams in Python CLIs",{"path":1866,"title":1867},"\u002Fadvanced-input-parsing-user-experience\u002Fworking-with-stdin-stdout-and-pipes\u002Freading-piped-input-in-python-clis","Reading Piped Input in Python CLIs",{"path":1869,"title":1870},"\u002Fcli-runtime-systems-integration\u002Fcalling-http-apis-from-python-clis\u002Fbuilding-an-api-client-cli-with-httpx","Building an API Client CLI with httpx",{"path":1872,"title":1873},"\u002Fcli-runtime-systems-integration\u002Fcalling-http-apis-from-python-clis\u002Fdownloading-files-with-progress-in-python","Downloading Files with Progress in Python CLIs",{"path":1875,"title":1663},"\u002Fcli-runtime-systems-integration\u002Fcalling-http-apis-from-python-clis",{"path":1877,"title":1878},"\u002Fcli-runtime-systems-integration\u002Fcalling-http-apis-from-python-clis\u002Foauth-device-flow-login-for-clis","OAuth Device Flow Login for Python CLIs",{"path":1880,"title":1881},"\u002Fcli-runtime-systems-integration\u002Fcalling-http-apis-from-python-clis\u002Fpaginating-api-results-in-a-cli","Paginating API Results in a Python CLI",{"path":1883,"title":1884},"\u002Fcli-runtime-systems-integration\u002Fcalling-http-apis-from-python-clis\u002Fretries-and-backoff-for-cli-http-calls","Retries and Backoff for CLI HTTP Calls",{"path":1886,"title":1887},"\u002Fcli-runtime-systems-integration\u002Fconcurrency-and-async-in-python-clis\u002Fcancelling-async-tasks-on-ctrl-c","Cancelling Async Tasks on Ctrl+C in Python CLIs",{"path":1889,"title":1890},"\u002Fcli-runtime-systems-integration\u002Fconcurrency-and-async-in-python-clis","Concurrency and Async in Python CLIs",{"path":1892,"title":1893},"\u002Fcli-runtime-systems-integration\u002Fconcurrency-and-async-in-python-clis\u002Fmultiprocessing-for-cpu-bound-cli-tasks","Multiprocessing for CPU-Bound CLI Tasks",{"path":1895,"title":1896},"\u002Fcli-runtime-systems-integration\u002Fconcurrency-and-async-in-python-clis\u002Fparallelising-cli-work-with-thread-pools","Parallelising CLI Work with Thread Pools",{"path":1898,"title":1899},"\u002Fcli-runtime-systems-integration\u002Fconcurrency-and-async-in-python-clis\u002Frate-limiting-concurrent-requests-in-clis","Rate-Limiting Concurrent Requests in Python CLIs",{"path":1901,"title":1902},"\u002Fcli-runtime-systems-integration\u002Fconcurrency-and-async-in-python-clis\u002Frunning-async-code-in-typer-and-click","Running Async Code in Typer and Click",{"path":1904,"title":1905},"\u002Fcli-runtime-systems-integration\u002Ffilesystem-paths-and-atomic-writes\u002Fcross-platform-paths-with-pathlib","Cross-Platform Paths with pathlib in CLIs",{"path":1907,"title":1908},"\u002Fcli-runtime-systems-integration\u002Ffilesystem-paths-and-atomic-writes\u002Ffile-locking-for-concurrent-cli-runs","File Locking for Concurrent CLI Runs in Python",{"path":1910,"title":1911},"\u002Fcli-runtime-systems-integration\u002Ffilesystem-paths-and-atomic-writes","Filesystem Paths and Atomic Writes for CLIs",{"path":1913,"title":1914},"\u002Fcli-runtime-systems-integration\u002Ffilesystem-paths-and-atomic-writes\u002Fsafe-temporary-files-and-directories","Safe Temporary Files and Directories in CLIs",{"path":1916,"title":1917},"\u002Fcli-runtime-systems-integration\u002Ffilesystem-paths-and-atomic-writes\u002Fstoring-app-data-with-platformdirs","Storing CLI App Data with platformdirs",{"path":1919,"title":1920},"\u002Fcli-runtime-systems-integration\u002Ffilesystem-paths-and-atomic-writes\u002Fwriting-files-atomically-in-python-clis","Writing Files Atomically in Python CLIs",{"path":1922,"title":1923},"\u002Fcli-runtime-systems-integration","CLI Runtime & Systems Integration for Python",{"path":1925,"title":1926},"\u002Fcli-runtime-systems-integration\u002Flong-running-and-watch-mode-clis\u002Fbuilding-a-watch-mode-with-watchfiles","Building a Watch Mode with watchfiles in Python",{"path":1928,"title":1929},"\u002Fcli-runtime-systems-integration\u002Flong-running-and-watch-mode-clis\u002Fhandling-sigterm-and-graceful-shutdown","Handling SIGTERM and Graceful Shutdown in CLIs",{"path":1931,"title":1932},"\u002Fcli-runtime-systems-integration\u002Flong-running-and-watch-mode-clis\u002Fhealth-checks-and-heartbeats-for-long-running-clis","Health Checks and Heartbeats for Long-Running CLIs",{"path":1934,"title":1935},"\u002Fcli-runtime-systems-integration\u002Flong-running-and-watch-mode-clis","Long-Running and Watch-Mode Python CLIs",{"path":1937,"title":1938},"\u002Fcli-runtime-systems-integration\u002Flong-running-and-watch-mode-clis\u002Frunning-a-cli-on-a-schedule-with-cron-and-systemd","Running a Python CLI on a Schedule with cron and systemd",{"path":1940,"title":1941},"\u002Fcli-runtime-systems-integration\u002Frunning-subprocesses-from-python-clis\u002Favoiding-shell-injection-in-python-clis","Avoiding Shell Injection in Python CLIs",{"path":1943,"title":1944},"\u002Fcli-runtime-systems-integration\u002Frunning-subprocesses-from-python-clis\u002Fcalling-external-commands-safely-with-subprocess","Calling External Commands Safely with subprocess",{"path":1946,"title":1947},"\u002Fcli-runtime-systems-integration\u002Frunning-subprocesses-from-python-clis\u002Fhandling-subprocess-timeouts-and-exit-codes","Handling Subprocess Timeouts and Exit Codes",{"path":1949,"title":1950},"\u002Fcli-runtime-systems-integration\u002Frunning-subprocesses-from-python-clis","Running Subprocesses from Python CLIs",{"path":1952,"title":1953},"\u002Fcli-runtime-systems-integration\u002Frunning-subprocesses-from-python-clis\u002Fstreaming-subprocess-output-in-real-time","Streaming Subprocess Output in Real Time",{"path":1955,"title":1956},"\u002Fcli-runtime-systems-integration\u002Frunning-subprocesses-from-python-clis\u002Fwrapping-git-and-other-tools-from-a-python-cli","Wrapping git and Other Tools from a Python CLI",{"path":1958,"title":1959},"\u002Fcli-runtime-systems-integration\u002Fsecrets-and-credentials-in-python-clis","Secrets and Credentials in Python CLIs",{"path":1961,"title":1962},"\u002Fcli-runtime-systems-integration\u002Fsecrets-and-credentials-in-python-clis\u002Fprompting-for-passwords-securely","Prompting for Passwords Securely in Python CLIs",{"path":1964,"title":1965},"\u002Fcli-runtime-systems-integration\u002Fsecrets-and-credentials-in-python-clis\u002Freading-secrets-from-env-and-files","Reading Secrets from Env Vars and Files in CLIs",{"path":1967,"title":1968},"\u002Fcli-runtime-systems-integration\u002Fsecrets-and-credentials-in-python-clis\u002Fredacting-secrets-from-cli-output-and-logs","Redacting Secrets from CLI Output and Logs",{"path":1970,"title":1971},"\u002Fcli-runtime-systems-integration\u002Fsecrets-and-credentials-in-python-clis\u002Fstoring-tokens-with-keyring","Storing CLI Tokens Securely with keyring",{"path":1973,"title":1974},"\u002Fcli-runtime-systems-integration\u002Fsecrets-and-credentials-in-python-clis\u002Fsupporting-multiple-profiles-and-accounts","Supporting Multiple Profiles and Accounts in CLIs",{"path":1976,"title":1977},"\u002F","Python CLI Toolcraft",{"path":1979,"title":1980},"\u002Fmodern-python-cli-frameworks-architecture\u002Fcli-startup-performance-and-lazy-loading\u002Fcaching-expensive-work-between-cli-runs","Caching Expensive Work Between Python CLI Runs",{"path":1982,"title":1983},"\u002Fmodern-python-cli-frameworks-architecture\u002Fcli-startup-performance-and-lazy-loading","CLI Startup Performance and Lazy Loading",{"path":1985,"title":1986},"\u002Fmodern-python-cli-frameworks-architecture\u002Fcli-startup-performance-and-lazy-loading\u002Flazy-loading-subcommands-for-faster-startup","Lazy Loading Subcommands for Faster Startup",{"path":1988,"title":1989},"\u002Fmodern-python-cli-frameworks-architecture\u002Fcli-startup-performance-and-lazy-loading\u002Fprofiling-python-cli-startup-time","Profiling Python CLI Startup Time",{"path":1991,"title":1992},"\u002Fmodern-python-cli-frameworks-architecture\u002Fcli-startup-performance-and-lazy-loading\u002Freducing-cli-dependency-weight","Reducing CLI Dependency Weight",{"path":1994,"title":1995},"\u002Fmodern-python-cli-frameworks-architecture\u002Fcommand-line-parsing-with-argparse\u002Fargparse-subparsers-for-subcommands","argparse Subparsers for Subcommands",{"path":1997,"title":1998},"\u002Fmodern-python-cli-frameworks-architecture\u002Fcommand-line-parsing-with-argparse\u002Fargparse-vs-click-vs-typer-comparison","argparse vs Click vs Typer Compared",{"path":2000,"title":2001},"\u002Fmodern-python-cli-frameworks-architecture\u002Fcommand-line-parsing-with-argparse","Command-Line Parsing with argparse",{"path":2003,"title":2004},"\u002Fmodern-python-cli-frameworks-architecture\u002Fcommand-line-parsing-with-argparse\u002Fmigrating-from-argparse-to-typer","Migrating from argparse to Typer",{"path":2006,"title":2007},"\u002Fmodern-python-cli-frameworks-architecture\u002Fcommand-line-parsing-with-argparse\u002Fmutually-exclusive-options-in-argparse","Mutually Exclusive Options in argparse",{"path":2009,"title":2010},"\u002Fmodern-python-cli-frameworks-architecture\u002Fcommand-line-parsing-with-argparse\u002Fwriting-custom-argparse-actions","Writing Custom argparse Actions in Python",{"path":2012,"title":2013},"\u002Fmodern-python-cli-frameworks-architecture\u002Fdesigning-cli-interfaces-and-conventions\u002Fadding-dry-run-and-confirmation-to-destructive-commands","Adding Dry-Run and Confirmation to Destructive Commands",{"path":2015,"title":2016},"\u002Fmodern-python-cli-frameworks-architecture\u002Fdesigning-cli-interfaces-and-conventions\u002Ffollowing-posix-and-gnu-argument-conventions","Following POSIX and GNU Argument Conventions in Python",{"path":2018,"title":2019},"\u002Fmodern-python-cli-frameworks-architecture\u002Fdesigning-cli-interfaces-and-conventions\u002Fglobal-options-vs-per-command-options","Global Options vs Per-Command Options in Python CLIs",{"path":2021,"title":2022},"\u002Fmodern-python-cli-frameworks-architecture\u002Fdesigning-cli-interfaces-and-conventions","Designing CLI Interfaces and Conventions in Python",{"path":2024,"title":2025},"\u002Fmodern-python-cli-frameworks-architecture\u002Fdesigning-cli-interfaces-and-conventions\u002Fnaming-commands-and-flags-consistently","Naming Commands and Flags Consistently in Python CLIs",{"path":2027,"title":2028},"\u002Fmodern-python-cli-frameworks-architecture","Python CLI Frameworks and Architecture",{"path":2030,"title":2031},"\u002Fmodern-python-cli-frameworks-architecture\u002Fplugin-architectures-for-extensible-clis\u002Fdiscovering-plugins-with-entry-points","Discovering Plugins with Entry Points in Python CLIs",{"path":2033,"title":2034},"\u002Fmodern-python-cli-frameworks-architecture\u002Fplugin-architectures-for-extensible-clis\u002Fhook-based-plugins-with-pluggy","Hook-Based Plugins for Python CLIs with pluggy",{"path":2036,"title":2037},"\u002Fmodern-python-cli-frameworks-architecture\u002Fplugin-architectures-for-extensible-clis","Plugin Architectures for Extensible CLIs",{"path":2039,"title":2040},"\u002Fmodern-python-cli-frameworks-architecture\u002Fplugin-architectures-for-extensible-clis\u002Fversioning-a-plugin-api","Versioning a Plugin API for a Python CLI",{"path":2042,"title":2043},"\u002Fmodern-python-cli-frameworks-architecture\u002Fplugin-architectures-for-extensible-clis\u002Fwriting-a-plugin-for-an-existing-cli","Writing a Plugin for an Existing CLI",{"path":2045,"title":2046},"\u002Fmodern-python-cli-frameworks-architecture\u002Fstructuring-multi-command-python-clis\u002Fbest-practices-for-python-cli-entry-points","Best practices for Python CLI entry points",{"path":2048,"title":2049},"\u002Fmodern-python-cli-frameworks-architecture\u002Fstructuring-multi-command-python-clis\u002Fdependency-injection-patterns-for-cli-commands","Dependency Injection Patterns for CLI Commands",{"path":2051,"title":2052},"\u002Fmodern-python-cli-frameworks-architecture\u002Fstructuring-multi-command-python-clis\u002Fhow-to-structure-a-large-python-cli-project","Structuring a Large Python CLI Project",{"path":2054,"title":2055},"\u002Fmodern-python-cli-frameworks-architecture\u002Fstructuring-multi-command-python-clis","Structuring Multi-Command Python CLIs",{"path":2057,"title":2058},"\u002Fmodern-python-cli-frameworks-architecture\u002Fstructuring-multi-command-python-clis\u002Fsharing-common-options-across-commands","Sharing Common Options Across Python CLI Commands",{"path":2060,"title":2061},"\u002Fmodern-python-cli-frameworks-architecture\u002Fstructuring-multi-command-python-clis\u002Fsharing-state-with-click-context-objects","Sharing State with Click Context Objects",{"path":2063,"title":2064},"\u002Fmodern-python-cli-frameworks-architecture\u002Ftesting-python-cli-applications\u002Fend-to-end-testing-an-installed-cli","End-to-End Testing an Installed Python CLI",{"path":2066,"title":2067},"\u002Fmodern-python-cli-frameworks-architecture\u002Ftesting-python-cli-applications","Testing Python CLI Applications",{"path":2069,"title":2070},"\u002Fmodern-python-cli-frameworks-architecture\u002Ftesting-python-cli-applications\u002Fmeasuring-cli-test-coverage","Measuring CLI Test Coverage",{"path":2072,"title":2073},"\u002Fmodern-python-cli-frameworks-architecture\u002Ftesting-python-cli-applications\u002Fmocking-filesystem-and-network-in-cli-tests","Mocking the Filesystem and Network in CLI Tests",{"path":2075,"title":2076},"\u002Fmodern-python-cli-frameworks-architecture\u002Ftesting-python-cli-applications\u002Fproperty-based-testing-cli-arguments-with-hypothesis","Property-Based Testing CLI Arguments with Hypothesis",{"path":2078,"title":2079},"\u002Fmodern-python-cli-frameworks-architecture\u002Ftesting-python-cli-applications\u002Fsnapshot-testing-cli-output","Snapshot Testing CLI Output",{"path":2081,"title":2082},"\u002Fmodern-python-cli-frameworks-architecture\u002Ftesting-python-cli-applications\u002Ftesting-click-commands-with-clirunner","Testing Click Commands with CliRunner",{"path":2084,"title":2085},"\u002Fmodern-python-cli-frameworks-architecture\u002Ftesting-python-cli-applications\u002Ftesting-interactive-prompts-and-stdin","Testing Interactive Prompts and stdin",{"path":2087,"title":2088},"\u002Fmodern-python-cli-frameworks-architecture\u002Ftyper-vs-click-when-to-use-each\u002Fbuilding-a-cli-with-subcommands-in-click","Building a CLI with subcommands in Click",{"path":2090,"title":2091},"\u002Fmodern-python-cli-frameworks-architecture\u002Ftyper-vs-click-when-to-use-each\u002Fbuilding-dynamic-commands-in-click","Building Dynamic Commands in Click",{"path":2093,"title":2094},"\u002Fmodern-python-cli-frameworks-architecture\u002Ftyper-vs-click-when-to-use-each\u002Fconverting-a-click-app-to-typer","Converting a Click App to Typer",{"path":2096,"title":2097},"\u002Fmodern-python-cli-frameworks-architecture\u002Ftyper-vs-click-when-to-use-each","Typer vs Click: When to Use Each",{"path":2099,"title":2100},"\u002Fmodern-python-cli-frameworks-architecture\u002Ftyper-vs-click-when-to-use-each\u002Ftyper-callback-functions-explained","Typer callback functions explained",{"path":2102,"title":2103},"\u002Fmodern-python-cli-frameworks-architecture\u002Ftyper-vs-click-when-to-use-each\u002Fusing-annotated-options-in-typer","Using Annotated Options in Typer",{"path":2105,"title":2106},"\u002Fproject-setup-dependency-management\u002Fci-cd-pipelines-for-python-clis\u002Fautomating-releases-from-git-tags","Automating Python CLI Releases from Git Tags",{"path":2108,"title":2109},"\u002Fproject-setup-dependency-management\u002Fci-cd-pipelines-for-python-clis\u002Fcaching-uv-dependencies-in-ci","Caching uv Dependencies in CI for Python CLIs",{"path":2111,"title":2112},"\u002Fproject-setup-dependency-management\u002Fci-cd-pipelines-for-python-clis","CI\u002FCD Pipelines for Python CLIs",{"path":2114,"title":2115},"\u002Fproject-setup-dependency-management\u002Fci-cd-pipelines-for-python-clis\u002Fpublishing-to-pypi-with-trusted-publishing","Publishing a CLI to PyPI with Trusted Publishing",{"path":2117,"title":2118},"\u002Fproject-setup-dependency-management\u002Fci-cd-pipelines-for-python-clis\u002Fsmoke-testing-the-built-wheel-in-ci","Smoke-Testing the Built Wheel of a Python CLI in CI",{"path":2120,"title":2121},"\u002Fproject-setup-dependency-management\u002Fci-cd-pipelines-for-python-clis\u002Ftesting-a-cli-across-python-versions-with-github-actions","Testing a CLI Across Python Versions in GitHub Actions",{"path":2123,"title":2124},"\u002Fproject-setup-dependency-management\u002Fcli-project-scaffolding-with-cookiecutter\u002Fbuilding-a-cookiecutter-template-for-typer-clis","Building a Cookiecutter Template for Typer CLIs",{"path":2126,"title":2127},"\u002Fproject-setup-dependency-management\u002Fcli-project-scaffolding-with-cookiecutter\u002Fcopier-vs-cookiecutter-for-cli-templates","Copier vs Cookiecutter for CLI Templates",{"path":2129,"title":2130},"\u002Fproject-setup-dependency-management\u002Fcli-project-scaffolding-with-cookiecutter","CLI Project Scaffolding with Cookiecutter",{"path":2132,"title":2133},"\u002Fproject-setup-dependency-management\u002Fcli-project-scaffolding-with-cookiecutter\u002Fpost-generation-hooks-in-cli-templates","Post-Generation Hooks in Python CLI Templates",{"path":2135,"title":2136},"\u002Fproject-setup-dependency-management\u002Fdistributing-clis-as-standalone-binaries\u002Fbuilding-cross-platform-release-binaries-in-ci","Building Cross-Platform Release Binaries in CI",{"path":2138,"title":2139},"\u002Fproject-setup-dependency-management\u002Fdistributing-clis-as-standalone-binaries\u002Fbundling-a-python-cli-with-pyinstaller","Bundling a Python CLI with PyInstaller",{"path":2141,"title":2142},"\u002Fproject-setup-dependency-management\u002Fdistributing-clis-as-standalone-binaries\u002Fhomebrew-and-scoop-packaging-for-python-clis","Homebrew and Scoop Packaging for Python CLIs",{"path":2144,"title":2145},"\u002Fproject-setup-dependency-management\u002Fdistributing-clis-as-standalone-binaries","Distributing CLIs as Standalone Binaries",{"path":2147,"title":2148},"\u002Fproject-setup-dependency-management\u002Fdistributing-clis-as-standalone-binaries\u002Fnuitka-vs-pyinstaller-for-python-clis","Nuitka vs PyInstaller for Python CLI Binaries",{"path":2150,"title":2151},"\u002Fproject-setup-dependency-management\u002Fdistributing-clis-as-standalone-binaries\u002Fshipping-a-cli-as-a-zipapp-with-shiv","Shipping a CLI as a Zipapp with shiv",{"path":2153,"title":2154},"\u002Fproject-setup-dependency-management","Project Setup & Dependency Management",{"path":2156,"title":2157},"\u002Fproject-setup-dependency-management\u002Flinting-and-type-checking-cli-code\u002Fconfiguring-ruff-for-a-cli-project","Configuring Ruff for a Python CLI Project",{"path":2159,"title":2160},"\u002Fproject-setup-dependency-management\u002Flinting-and-type-checking-cli-code\u002Fenforcing-import-boundaries-in-a-cli-codebase","Enforcing Import Boundaries in a Python CLI Codebase",{"path":2162,"title":2163},"\u002Fproject-setup-dependency-management\u002Flinting-and-type-checking-cli-code","Linting and Type-Checking Python CLI Code",{"path":2165,"title":2166},"\u002Fproject-setup-dependency-management\u002Flinting-and-type-checking-cli-code\u002Ftype-checking-click-and-typer-code-with-mypy","Type-Checking Click and Typer Code with mypy",{"path":2168,"title":2169},"\u002Fproject-setup-dependency-management\u002Fmanaging-cli-versioning-changelogs\u002Fautomating-changelogs-with-conventional-commits","Automating Changelogs with Conventional Commits",{"path":2171,"title":2172},"\u002Fproject-setup-dependency-management\u002Fmanaging-cli-versioning-changelogs\u002Fderiving-versions-from-git-tags-with-hatch-vcs","Deriving CLI Versions from Git Tags with hatch-vcs",{"path":2174,"title":2175},"\u002Fproject-setup-dependency-management\u002Fmanaging-cli-versioning-changelogs\u002Fexposing-version-info-and-build-metadata","Exposing Version Info and Build Metadata",{"path":2177,"title":2178},"\u002Fproject-setup-dependency-management\u002Fmanaging-cli-versioning-changelogs","Managing CLI Versioning & Changelogs",{"path":2180,"title":2181},"\u002Fproject-setup-dependency-management\u002Fmanaging-cli-versioning-changelogs\u002Fsemantic-versioning-policy-for-cli-tools","A Semantic Versioning Policy for CLI Tools",{"path":2183,"title":2184},"\u002Fproject-setup-dependency-management\u002Fpackaging-python-clis-for-distribution\u002Fbuilding-wheels-and-sdists-for-python-clis","Building Wheels and sdists for Python CLIs",{"path":2186,"title":2187},"\u002Fproject-setup-dependency-management\u002Fpackaging-python-clis-for-distribution\u002Fbundling-data-files-with-importlib-resources","Bundling Data Files with importlib.resources in CLIs",{"path":2189,"title":2190},"\u002Fproject-setup-dependency-management\u002Fpackaging-python-clis-for-distribution","Packaging Python CLIs for Distribution",{"path":2192,"title":2193},"\u002Fproject-setup-dependency-management\u002Fpackaging-python-clis-for-distribution\u002Finstalling-and-distributing-clis-with-pipx","Installing and Distributing CLIs with pipx",{"path":2195,"title":2196},"\u002Fproject-setup-dependency-management\u002Fpackaging-python-clis-for-distribution\u002Fpublishing-a-python-cli-to-pypi","Publishing a Python CLI to PyPI",{"path":2198,"title":2199},"\u002Fproject-setup-dependency-management\u002Fpackaging-python-clis-for-distribution\u002Fwriting-pyproject-toml-metadata-for-a-cli","Writing pyproject.toml Metadata for a Python CLI",{"path":2201,"title":2202},"\u002Fproject-setup-dependency-management\u002Fpoetry-workflows-for-cli-development","Poetry Workflows for CLI Development",{"path":2204,"title":2205},"\u002Fproject-setup-dependency-management\u002Fpoetry-workflows-for-cli-development\u002Fmigrating-a-cli-from-poetry-to-uv","Migrating a Python CLI from Poetry to uv",{"path":2207,"title":2208},"\u002Fproject-setup-dependency-management\u002Fpoetry-workflows-for-cli-development\u002Fpoetry-dependency-groups-for-cli-tooling","Poetry Dependency Groups for CLI Tooling",{"path":2210,"title":2211},"\u002Fproject-setup-dependency-management\u002Fpoetry-workflows-for-cli-development\u002Fpoetry-entry-points-and-scripts-for-clis","Poetry Entry Points and Scripts for CLIs",{"path":2213,"title":2214},"\u002Fproject-setup-dependency-management\u002Fpre-commit-hooks-for-cli-projects","Pre-commit Hooks for CLI Projects",{"path":2216,"title":2217},"\u002Fproject-setup-dependency-management\u002Fpre-commit-hooks-for-cli-projects\u002Fsetting-up-pre-commit-for-python-cli-repos","Setting up pre-commit for Python CLI repos",{"path":2219,"title":2220},"\u002Fproject-setup-dependency-management\u002Fpre-commit-hooks-for-cli-projects\u002Fshipping-your-cli-as-a-pre-commit-hook","Shipping Your Python CLI as a pre-commit Hook",{"path":2222,"title":2223},"\u002Fproject-setup-dependency-management\u002Fpre-commit-hooks-for-cli-projects\u002Fwriting-local-pre-commit-hooks-in-python","Writing Local pre-commit Hooks in Python",{"path":2225,"title":2226},"\u002Fproject-setup-dependency-management\u002Fuv-for-python-cli-dependency-management","uv for Python CLI Dependency Management",{"path":1694,"title":5},{"path":2229,"title":2230},"\u002Fproject-setup-dependency-management\u002Fuv-for-python-cli-dependency-management\u002Fuv-init-vs-poetry-init-for-cli-tools","uv init vs poetry init for CLI tools",{"path":2232,"title":1651},"\u002Fproject-setup-dependency-management\u002Fuv-for-python-cli-dependency-management\u002Fuv-tool-install-vs-pipx-for-clis",{"path":2234,"title":2235},"\u002Fproject-setup-dependency-management\u002Fuv-for-python-cli-dependency-management\u002Fuv-workspaces-for-multi-package-clis","uv Workspaces for Multi-Package Python CLIs",{"path":2237,"title":2238},"\u002Fproject-setup-dependency-management\u002Fvirtual-environments-isolation-best-practices","Python CLI Env Isolation Best Practices",{"path":2240,"title":2241},"\u002Fproject-setup-dependency-management\u002Fvirtual-environments-isolation-best-practices\u002Fmanaging-virtual-environments-for-cross-platform-clis","Managing Python CLI Virtual Environments",{"path":2243,"title":2244},"\u002Fproject-setup-dependency-management\u002Fvirtual-environments-isolation-best-practices\u002Fpinning-the-python-version-for-a-cli","Pinning the Python Version for a CLI",{"path":2246,"title":2247},"\u002Fproject-setup-dependency-management\u002Fvirtual-environments-isolation-best-practices\u002Fsupporting-multiple-python-versions-with-nox","Supporting Multiple Python Versions with nox",1789736907975]