[{"data":1,"prerenderedAt":1493},["ShallowReactive",2],{"page-\u002Fproject-setup-dependency-management\u002Fci-cd-pipelines-for-python-clis\u002Fcaching-uv-dependencies-in-ci\u002F":3,"content-directory":945},{"id":4,"title":5,"body":6,"date":929,"description":930,"difficulty":931,"draft":932,"extension":933,"meta":934,"navigation":468,"path":935,"seo":936,"stem":937,"tags":938,"updated":929,"__hash__":944},"content\u002Fproject-setup-dependency-management\u002Fci-cd-pipelines-for-python-clis\u002Fcaching-uv-dependencies-in-ci\u002Findex.md","Caching uv Dependencies in CI for Python CLIs",{"type":7,"value":8,"toc":906},"minimark",[9,19,24,51,55,74,78,82,88,186,212,215,275,293,298,301,304,315,393,400,407,419,423,426,566,576,580,587,676,696,700,703,736,740,743,746,792,803,807,820,824,831,840,844,850,858,861,865,868,872,902],[10,11,12,13,18],"p",{},"Your CLI's test suite takes twenty seconds, but every CI job takes two minutes, because each one starts from an empty machine and downloads, unpacks and sometimes compiles every dependency before running a single test. Multiply by a nine-job matrix and a busy day of pull requests and the pipeline becomes the thing people wait on. uv is already fast at installing, but the fastest install is one that downloads nothing. This guide covers caching uv's package cache between CI runs so installs become near-instant — with the right cache key so it is never stale, pruning so it stays small, and equivalents for GitLab CI and Docker builds. It is part of the ",[14,15,17],"a",{"href":16},"\u002Fproject-setup-dependency-management\u002Fci-cd-pipelines-for-python-clis\u002F","CI\u002FCD pipelines topic",".",[20,21,23],"h2",{"id":22},"prerequisites","Prerequisites",[25,26,27,40],"ul",{},[28,29,30,31,35,36,18],"li",{},"A CLI project managed with uv, with ",[32,33,34],"code",{},"uv.lock"," committed. See ",[14,37,39],{"href":38},"\u002Fproject-setup-dependency-management\u002Fuv-for-python-cli-dependency-management\u002F","uv for Python CLI dependency management",[28,41,42,43,46,47,18],{},"A CI pipeline that installs with ",[32,44,45],{},"uv sync",", such as the matrix in ",[14,48,50],{"href":49},"\u002Fproject-setup-dependency-management\u002Fci-cd-pipelines-for-python-clis\u002Ftesting-a-cli-across-python-versions-with-github-actions\u002F","testing a CLI across Python versions with GitHub Actions",[20,52,54],{"id":53},"what-there-is-to-cache","What there is to cache",[10,56,57,58,62,63,66,67,70,71,73],{},"uv keeps a global ",[59,60,61],"strong",{},"cache directory"," (on Linux runners, ",[32,64,65],{},"~\u002F.cache\u002Fuv"," by default) holding downloaded wheels, unpacked archives, wheels it built from source distributions, and resolver metadata. A project's ",[32,68,69],{},".venv"," is then populated by linking or copying files out of that cache. Caching the virtual environment itself is tempting but brittle — it embeds absolute paths and interpreter details, and a stale one fails in confusing ways. Caching uv's cache directory is robust: on a hit, ",[32,72,45],{}," still builds a fresh environment, it just finds every file it needs locally.",[75,76],"inline-diagram",{"name":77},"ci-cache-flow",[20,79,81],{"id":80},"the-recipe-github-actions","The recipe: GitHub Actions",[10,83,84,87],{},[32,85,86],{},"astral-sh\u002Fsetup-uv"," has caching built in. For most projects, one flag is the whole setup:",[89,90,95],"pre",{"className":91,"code":92,"language":93,"meta":94,"style":94},"language-yaml shiki shiki-themes github-light github-dark","- uses: actions\u002Fcheckout@v4\n- uses: astral-sh\u002Fsetup-uv@v6\n  with:\n    enable-cache: true\n    python-version: ${{ matrix.python }}\n- run: uv sync --locked --group dev\n- run: uv run pytest -q\n","yaml","",[32,96,97,117,129,138,150,161,174],{"__ignoreMap":94},[98,99,102,106,110,113],"span",{"class":100,"line":101},"line",1,[98,103,105],{"class":104},"sVt8B","- ",[98,107,109],{"class":108},"s9eBZ","uses",[98,111,112],{"class":104},": ",[98,114,116],{"class":115},"sZZnC","actions\u002Fcheckout@v4\n",[98,118,120,122,124,126],{"class":100,"line":119},2,[98,121,105],{"class":104},[98,123,109],{"class":108},[98,125,112],{"class":104},[98,127,128],{"class":115},"astral-sh\u002Fsetup-uv@v6\n",[98,130,132,135],{"class":100,"line":131},3,[98,133,134],{"class":108},"  with",[98,136,137],{"class":104},":\n",[98,139,141,144,146],{"class":100,"line":140},4,[98,142,143],{"class":108},"    enable-cache",[98,145,112],{"class":104},[98,147,149],{"class":148},"sj4cs","true\n",[98,151,153,156,158],{"class":100,"line":152},5,[98,154,155],{"class":108},"    python-version",[98,157,112],{"class":104},[98,159,160],{"class":115},"${{ matrix.python }}\n",[98,162,164,166,169,171],{"class":100,"line":163},6,[98,165,105],{"class":104},[98,167,168],{"class":108},"run",[98,170,112],{"class":104},[98,172,173],{"class":115},"uv sync --locked --group dev\n",[98,175,177,179,181,183],{"class":100,"line":176},7,[98,178,105],{"class":104},[98,180,168],{"class":108},[98,182,112],{"class":104},[98,184,185],{"class":115},"uv run pytest -q\n",[10,187,188,189,192,193,195,196,199,200,203,204,207,208,211],{},"With ",[32,190,191],{},"enable-cache: true",", the action restores the cache at the start of the job and saves it at the end, using a key built from the runner OS, the architecture, the Python version and a hash of the dependency files — by default ",[32,194,34],{},", falling back to ",[32,197,198],{},"requirements*.txt"," and ",[32,201,202],{},"pyproject.toml"," patterns. At the end of the job it also runs ",[32,205,206],{},"uv cache prune --ci",", which removes pre-built wheels (fast to re-download) and keeps packages uv had to ",[59,209,210],{},"build from source"," (slow to rebuild). That keeps the cache small enough to save and restore in seconds.",[10,213,214],{},"Two settings are worth knowing:",[89,216,218],{"className":91,"code":217,"language":93,"meta":94,"style":94},"- uses: astral-sh\u002Fsetup-uv@v6\n  with:\n    enable-cache: true\n    cache-dependency-glob: |\n      uv.lock\n      packages\u002F*\u002Fpyproject.toml\n    cache-suffix: ${{ matrix.resolution }}\n",[32,219,220,230,236,244,255,260,265],{"__ignoreMap":94},[98,221,222,224,226,228],{"class":100,"line":101},[98,223,105],{"class":104},[98,225,109],{"class":108},[98,227,112],{"class":104},[98,229,128],{"class":115},[98,231,232,234],{"class":100,"line":119},[98,233,134],{"class":108},[98,235,137],{"class":104},[98,237,238,240,242],{"class":100,"line":131},[98,239,143],{"class":108},[98,241,112],{"class":104},[98,243,149],{"class":148},[98,245,246,249,251],{"class":100,"line":140},[98,247,248],{"class":108},"    cache-dependency-glob",[98,250,112],{"class":104},[98,252,254],{"class":253},"szBVR","|\n",[98,256,257],{"class":100,"line":152},[98,258,259],{"class":115},"      uv.lock\n",[98,261,262],{"class":100,"line":163},[98,263,264],{"class":115},"      packages\u002F*\u002Fpyproject.toml\n",[98,266,267,270,272],{"class":100,"line":176},[98,268,269],{"class":108},"    cache-suffix",[98,271,112],{"class":104},[98,273,274],{"class":115},"${{ matrix.resolution }}\n",[10,276,277,280,281,283,284,288,289,292],{},[32,278,279],{},"cache-dependency-glob"," changes which files feed the key — useful in a workspace with several ",[32,282,202],{}," files, as described in ",[14,285,287],{"href":286},"\u002Fproject-setup-dependency-management\u002Fuv-for-python-cli-dependency-management\u002Fuv-workspaces-for-multi-package-clis\u002F","uv workspaces for multi-package CLIs",". ",[32,290,291],{},"cache-suffix"," separates caches for jobs that install different dependency sets from the same lockfile, such as a lowest-versions job; otherwise two different sets would fight over one key.",[294,295,297],"h3",{"id":296},"choosing-the-key","Choosing the key",[10,299,300],{},"The key decides both hit rate and correctness. Keying on the lockfile hash is exact: the cache is reused until dependencies change, then rebuilt.",[75,302],{"name":303},"ci-cache-keys",[10,305,306,307,310,311,314],{},"Wheels are platform- and version-specific, so the OS and Python version must be in the key too (",[32,308,309],{},"setup-uv"," includes them). If you manage the cache yourself with ",[32,312,313],{},"actions\u002Fcache",", reproduce that shape:",[89,316,318],{"className":91,"code":317,"language":93,"meta":94,"style":94},"- uses: actions\u002Fcache@v4\n  with:\n    path: ~\u002F.cache\u002Fuv\n    key: uv-${{ runner.os }}-${{ runner.arch }}-py${{ matrix.python }}-${{ hashFiles('uv.lock') }}\n    restore-keys: |\n      uv-${{ runner.os }}-${{ runner.arch }}-py${{ matrix.python }}-\n- run: uv sync --locked --group dev\n- run: uv cache prune --ci\n",[32,319,320,331,337,347,357,366,371,381],{"__ignoreMap":94},[98,321,322,324,326,328],{"class":100,"line":101},[98,323,105],{"class":104},[98,325,109],{"class":108},[98,327,112],{"class":104},[98,329,330],{"class":115},"actions\u002Fcache@v4\n",[98,332,333,335],{"class":100,"line":119},[98,334,134],{"class":108},[98,336,137],{"class":104},[98,338,339,342,344],{"class":100,"line":131},[98,340,341],{"class":108},"    path",[98,343,112],{"class":104},[98,345,346],{"class":115},"~\u002F.cache\u002Fuv\n",[98,348,349,352,354],{"class":100,"line":140},[98,350,351],{"class":108},"    key",[98,353,112],{"class":104},[98,355,356],{"class":115},"uv-${{ runner.os }}-${{ runner.arch }}-py${{ matrix.python }}-${{ hashFiles('uv.lock') }}\n",[98,358,359,362,364],{"class":100,"line":152},[98,360,361],{"class":108},"    restore-keys",[98,363,112],{"class":104},[98,365,254],{"class":253},[98,367,368],{"class":100,"line":163},[98,369,370],{"class":115},"      uv-${{ runner.os }}-${{ runner.arch }}-py${{ matrix.python }}-\n",[98,372,373,375,377,379],{"class":100,"line":176},[98,374,105],{"class":104},[98,376,168],{"class":108},[98,378,112],{"class":104},[98,380,173],{"class":115},[98,382,384,386,388,390],{"class":100,"line":383},8,[98,385,105],{"class":104},[98,387,168],{"class":108},[98,389,112],{"class":104},[98,391,392],{"class":115},"uv cache prune --ci\n",[10,394,395,396,399],{},"The ",[32,397,398],{},"restore-keys"," fallback lets a job whose lockfile just changed start from the previous cache; most packages will still be there, and only the changed ones are downloaded.",[294,401,403,406],{"id":402},"locked-fast-and-correct",[32,404,405],{},"--locked",": fast and correct",[10,408,409,412,413,415,416,418],{},[32,410,411],{},"uv sync --locked"," installs exactly what ",[32,414,34],{}," records and fails if the lockfile does not match ",[32,417,202],{},". That matters for caching because it makes the lockfile the single source of truth for both the key and the install — a job can never quietly re-resolve to different versions than the cache was built from. It also catches the \"edited dependencies, forgot to re-lock\" mistake in the first CI job.",[20,420,422],{"id":421},"other-ci-systems","Other CI systems",[10,424,425],{},"The same idea — cache uv's directory, keyed on the lockfile, prune before saving — carries over. In GitLab CI:",[89,427,429],{"className":91,"code":428,"language":93,"meta":94,"style":94},"# .gitlab-ci.yml\nvariables:\n  UV_CACHE_DIR: .uv-cache\n  UV_LINK_MODE: copy\n\ntest:\n  image: ghcr.io\u002Fastral-sh\u002Fuv:python3.13-bookworm-slim\n  cache:\n    key:\n      files: [uv.lock]\n    paths: [.uv-cache]\n  script:\n    - uv sync --locked --group dev\n    - uv run pytest -q\n  after_script:\n    - uv cache prune --ci\n",[32,430,431,437,444,454,464,470,477,487,494,501,515,528,536,544,551,559],{"__ignoreMap":94},[98,432,433],{"class":100,"line":101},[98,434,436],{"class":435},"sJ8bj","# .gitlab-ci.yml\n",[98,438,439,442],{"class":100,"line":119},[98,440,441],{"class":108},"variables",[98,443,137],{"class":104},[98,445,446,449,451],{"class":100,"line":131},[98,447,448],{"class":108},"  UV_CACHE_DIR",[98,450,112],{"class":104},[98,452,453],{"class":115},".uv-cache\n",[98,455,456,459,461],{"class":100,"line":140},[98,457,458],{"class":108},"  UV_LINK_MODE",[98,460,112],{"class":104},[98,462,463],{"class":115},"copy\n",[98,465,466],{"class":100,"line":152},[98,467,469],{"emptyLinePlaceholder":468},true,"\n",[98,471,472,475],{"class":100,"line":163},[98,473,474],{"class":108},"test",[98,476,137],{"class":104},[98,478,479,482,484],{"class":100,"line":176},[98,480,481],{"class":108},"  image",[98,483,112],{"class":104},[98,485,486],{"class":115},"ghcr.io\u002Fastral-sh\u002Fuv:python3.13-bookworm-slim\n",[98,488,489,492],{"class":100,"line":383},[98,490,491],{"class":108},"  cache",[98,493,137],{"class":104},[98,495,497,499],{"class":100,"line":496},9,[98,498,351],{"class":108},[98,500,137],{"class":104},[98,502,504,507,510,512],{"class":100,"line":503},10,[98,505,506],{"class":108},"      files",[98,508,509],{"class":104},": [",[98,511,34],{"class":115},[98,513,514],{"class":104},"]\n",[98,516,518,521,523,526],{"class":100,"line":517},11,[98,519,520],{"class":108},"    paths",[98,522,509],{"class":104},[98,524,525],{"class":115},".uv-cache",[98,527,514],{"class":104},[98,529,531,534],{"class":100,"line":530},12,[98,532,533],{"class":108},"  script",[98,535,137],{"class":104},[98,537,539,542],{"class":100,"line":538},13,[98,540,541],{"class":104},"    - ",[98,543,173],{"class":115},[98,545,547,549],{"class":100,"line":546},14,[98,548,541],{"class":104},[98,550,185],{"class":115},[98,552,554,557],{"class":100,"line":553},15,[98,555,556],{"class":108},"  after_script",[98,558,137],{"class":104},[98,560,562,564],{"class":100,"line":561},16,[98,563,541],{"class":104},[98,565,392],{"class":115},[10,567,568,569,288,572,575],{},"GitLab only caches paths inside the project directory, hence ",[32,570,571],{},"UV_CACHE_DIR",[32,573,574],{},"UV_LINK_MODE=copy"," avoids a warning (and a fallback) when the cache and the virtual environment sit on different filesystems, which is common in containerised runners where hard links are not possible.",[20,577,579],{"id":578},"docker-builds","Docker builds",[10,581,582,583,586],{},"If your CLI ships as a container image, the Docker build is often the slowest step of all. BuildKit ",[59,584,585],{},"cache mounts"," give uv a persistent cache directory across builds without putting it in the image:",[89,588,592],{"className":589,"code":590,"language":591,"meta":94,"style":94},"language-dockerfile shiki shiki-themes github-light github-dark","# syntax=docker\u002Fdockerfile:1\nFROM python:3.13-slim\nCOPY --from=ghcr.io\u002Fastral-sh\u002Fuv:latest \u002Fuv \u002Fusr\u002Flocal\u002Fbin\u002Fuv\nENV UV_LINK_MODE=copy UV_COMPILE_BYTECODE=1\nWORKDIR \u002Fapp\n\n# Dependencies first: this layer is reused until uv.lock changes.\nCOPY pyproject.toml uv.lock .\u002F\nRUN --mount=type=cache,target=\u002Froot\u002F.cache\u002Fuv \\\n    uv sync --locked --no-install-project --no-dev\n\n# Then the project itself.\nCOPY src .\u002Fsrc\nRUN --mount=type=cache,target=\u002Froot\u002F.cache\u002Fuv \\\n    uv sync --locked --no-dev\n\nENTRYPOINT [\"\u002Fapp\u002F.venv\u002Fbin\u002Fmytool\"]\n","dockerfile",[32,593,594,599,604,609,614,619,623,628,633,638,643,647,652,657,661,666,670],{"__ignoreMap":94},[98,595,596],{"class":100,"line":101},[98,597,598],{},"# syntax=docker\u002Fdockerfile:1\n",[98,600,601],{"class":100,"line":119},[98,602,603],{},"FROM python:3.13-slim\n",[98,605,606],{"class":100,"line":131},[98,607,608],{},"COPY --from=ghcr.io\u002Fastral-sh\u002Fuv:latest \u002Fuv \u002Fusr\u002Flocal\u002Fbin\u002Fuv\n",[98,610,611],{"class":100,"line":140},[98,612,613],{},"ENV UV_LINK_MODE=copy UV_COMPILE_BYTECODE=1\n",[98,615,616],{"class":100,"line":152},[98,617,618],{},"WORKDIR \u002Fapp\n",[98,620,621],{"class":100,"line":163},[98,622,469],{"emptyLinePlaceholder":468},[98,624,625],{"class":100,"line":176},[98,626,627],{},"# Dependencies first: this layer is reused until uv.lock changes.\n",[98,629,630],{"class":100,"line":383},[98,631,632],{},"COPY pyproject.toml uv.lock .\u002F\n",[98,634,635],{"class":100,"line":496},[98,636,637],{},"RUN --mount=type=cache,target=\u002Froot\u002F.cache\u002Fuv \\\n",[98,639,640],{"class":100,"line":503},[98,641,642],{},"    uv sync --locked --no-install-project --no-dev\n",[98,644,645],{"class":100,"line":517},[98,646,469],{"emptyLinePlaceholder":468},[98,648,649],{"class":100,"line":530},[98,650,651],{},"# Then the project itself.\n",[98,653,654],{"class":100,"line":538},[98,655,656],{},"COPY src .\u002Fsrc\n",[98,658,659],{"class":100,"line":546},[98,660,637],{},[98,662,663],{"class":100,"line":553},[98,664,665],{},"    uv sync --locked --no-dev\n",[98,667,668],{"class":100,"line":561},[98,669,469],{"emptyLinePlaceholder":468},[98,671,673],{"class":100,"line":672},17,[98,674,675],{},"ENTRYPOINT [\"\u002Fapp\u002F.venv\u002Fbin\u002Fmytool\"]\n",[10,677,678,679,199,681,683,684,687,688,691,692,695],{},"Installing dependencies in a layer that only depends on ",[32,680,202],{},[32,682,34],{}," means editing your source code does not invalidate it. ",[32,685,686],{},"--no-install-project"," installs everything except your own package, which comes in the next layer. In CI, pair this with BuildKit's registry or GitHub Actions cache backends (",[32,689,690],{},"docker\u002Fbuild-push-action"," with ",[32,693,694],{},"cache-from: type=gha",") so layers survive between runs.",[20,697,699],{"id":698},"ux-considerations","UX considerations",[10,701,702],{},"For the people waiting on the pipeline, caching is only half the story:",[25,704,705,714,720,726],{},[28,706,707,710,711,713],{},[59,708,709],{},"Show what the cache did."," ",[32,712,309],{}," logs whether it restored a cache and the key it used; keep that visible when debugging slow runs rather than hiding it behind a quiet flag.",[28,715,716,719],{},[59,717,718],{},"Prefer pre-built wheels."," If one dependency always builds from source because it has no wheel for your Python version, that is often the slowest step even with a cache. Pinning a version that has wheels, or bumping the matrix's Python only when wheels exist, can save more than any cache tuning.",[28,721,722,725],{},[59,723,724],{},"Do not cache across trust boundaries."," Caches written by pull-request workflows from forks can be read by later runs in some configurations. GitHub scopes caches by branch, with the default branch's caches readable by all; avoid saving caches from untrusted workflows into scopes that release jobs use.",[28,727,728,731,732,18],{},[59,729,730],{},"Keep release builds honest."," Caching speeds up installs but never replaces building the artefact from a clean checkout. The build job in a release pipeline should still start from source, as in ",[14,733,735],{"href":734},"\u002Fproject-setup-dependency-management\u002Fci-cd-pipelines-for-python-clis\u002Fsmoke-testing-the-built-wheel-in-ci\u002F","smoke-testing the built wheel in CI",[20,737,739],{"id":738},"testing-the-behaviour","Testing the behaviour",[10,741,742],{},"Verify caching the same way you would verify any optimisation: measure before and after, and make sure correctness did not change.",[75,744],{"name":745},"ci-prune-terminal",[25,747,748,757,766,780],{},[28,749,750,753,754,756],{},[59,751,752],{},"Compare install step durations"," on two consecutive runs of the same commit. The second should show a cache hit in the ",[32,755,309],{}," log and an install step measured in seconds.",[28,758,759,762,763,765],{},[59,760,761],{},"Change a dependency and push."," The key changes, the cache misses (or partially restores from ",[32,764,398],{},"), and the new cache is saved at the end. The following run should hit again.",[28,767,768,771,772,775,776,779],{},[59,769,770],{},"Delete the cache"," from the repository's ",[59,773,774],{},"Actions → Caches"," page (or with ",[32,777,778],{},"gh cache delete",") when you suspect it is corrupt; a correct setup recovers on the next run with no other changes.",[28,781,782,710,785,788,789,791],{},[59,783,784],{},"Check the size.",[32,786,787],{},"du -sh ~\u002F.cache\u002Fuv"," before and after ",[32,790,206],{}," in a debug step shows whether pruning is working. Caches of a few tens of megabytes restore in a couple of seconds; multi-gigabyte caches cost more time than they save.",[10,793,794,795,798,799,802],{},"Locally, ",[32,796,797],{},"uv cache dir"," shows where uv keeps its cache and ",[32,800,801],{},"uv cache clean"," resets it — useful when reproducing a CI install from scratch.",[20,804,806],{"id":805},"conclusion","Conclusion",[10,808,809,810,812,813,816,817,819],{},"Cache uv's package cache, not the virtual environment; key it on the lockfile plus OS and Python version; install with ",[32,811,411],{}," so the lockfile governs everything; and prune with ",[32,814,815],{},"--ci"," so only source-built packages are kept. On GitHub Actions that is one ",[32,818,191],{},"; on GitLab and in Docker it is a cache path and a mount. The result is CI installs that take seconds, with no risk of testing against a stale dependency set.",[20,821,823],{"id":822},"frequently-asked-questions","Frequently asked questions",[294,825,827,828,830],{"id":826},"should-i-also-cache-the-venv-directory","Should I also cache the ",[32,829,69],{}," directory?",[10,832,833,834,836,837,839],{},"Usually not. With a warm uv cache, creating the environment takes a second or two, and a cached ",[32,835,69],{}," can break subtly when the runner image's Python changes. If you do cache it, include the exact interpreter version in the key and still run ",[32,838,411],{}," afterwards.",[294,841,843],{"id":842},"why-is-my-cache-never-hit","Why is my cache never hit?",[10,845,846,847,849],{},"Check the key in the logs of two consecutive runs. Common causes: the lockfile is regenerated during the job (use ",[32,848,405],{},"), the key includes something that changes every run such as a timestamp, or the cache is saved from a different branch scope than the one reading it.",[294,851,853,854,857],{"id":852},"does-caching-work-with-uv-tool-install-in-smoke-tests","Does caching work with ",[32,855,856],{},"uv tool install"," in smoke tests?",[10,859,860],{},"Yes — tool installs use the same cache directory. The benefit is smaller there, because a smoke test installs your wheel plus its runtime dependencies only once per job.",[294,862,864],{"id":863},"how-much-time-does-this-really-save","How much time does this really save?",[10,866,867],{},"It depends on your dependency tree. Projects whose dependencies all ship wheels see modest savings, since uv downloads quickly; projects with source-built dependencies or large packages see the largest gains. Measure on your own pipeline before and after.",[20,869,871],{"id":870},"related","Related",[25,873,874,880,885,891,896],{},[28,875,876,877],{},"Up: ",[14,878,879],{"href":16},"CI\u002FCD pipelines for Python CLIs",[28,881,882],{},[14,883,884],{"href":49},"Testing a CLI across Python versions with GitHub Actions",[28,886,887],{},[14,888,890],{"href":889},"\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",[28,892,893],{},[14,894,895],{"href":286},"Uv workspaces for multi-package CLIs",[28,897,898],{},[14,899,901],{"href":900},"\u002Fmodern-python-cli-frameworks-architecture\u002Fcli-startup-performance-and-lazy-loading\u002Freducing-cli-dependency-weight\u002F","Reducing CLI dependency weight",[903,904,905],"style",{},"html pre.shiki code .sVt8B, html code.shiki .sVt8B{--shiki-default:#24292E;--shiki-dark:#E1E4E8}html pre.shiki code .s9eBZ, html code.shiki .s9eBZ{--shiki-default:#22863A;--shiki-dark:#85E89D}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 .szBVR, html code.shiki .szBVR{--shiki-default:#D73A49;--shiki-dark:#F97583}html pre.shiki code .sJ8bj, html code.shiki .sJ8bj{--shiki-default:#6A737D;--shiki-dark:#6A737D}",{"title":94,"searchDepth":119,"depth":119,"links":907},[908,909,910,915,916,917,918,919,920,928],{"id":22,"depth":119,"text":23},{"id":53,"depth":119,"text":54},{"id":80,"depth":119,"text":81,"children":911},[912,913],{"id":296,"depth":131,"text":297},{"id":402,"depth":131,"text":914},"--locked: fast and correct",{"id":421,"depth":119,"text":422},{"id":578,"depth":119,"text":579},{"id":698,"depth":119,"text":699},{"id":738,"depth":119,"text":739},{"id":805,"depth":119,"text":806},{"id":822,"depth":119,"text":823,"children":921},[922,924,925,927],{"id":826,"depth":131,"text":923},"Should I also cache the .venv directory?",{"id":842,"depth":131,"text":843},{"id":852,"depth":131,"text":926},"Does caching work with uv tool install in smoke tests?",{"id":863,"depth":131,"text":864},{"id":870,"depth":119,"text":871},"2026-09-18","Make Python CLI pipelines fast with uv caching: setup-uv cache keys, uv sync --locked, pruning with --ci, GitLab CI, Docker cache mounts and checking hit rates.","intermediate",false,"md",{},"\u002Fproject-setup-dependency-management\u002Fci-cd-pipelines-for-python-clis\u002Fcaching-uv-dependencies-in-ci",{"title":5,"description":930},"project-setup-dependency-management\u002Fci-cd-pipelines-for-python-clis\u002Fcaching-uv-dependencies-in-ci\u002Findex",[939,940,941,942,943],"uv","ci","caching","github-actions","docker","aknOvE0Wc8hxHkZxR1UcdsRWsbgvgDZnxzzP-zyUFNw",[946,949,952,955,958,961,964,967,970,973,976,979,982,985,988,991,994,997,1000,1003,1006,1009,1012,1015,1018,1021,1024,1027,1030,1033,1036,1039,1042,1045,1048,1051,1054,1057,1060,1063,1066,1069,1072,1075,1078,1081,1084,1087,1090,1093,1096,1099,1102,1105,1108,1111,1114,1117,1120,1123,1126,1129,1132,1135,1138,1141,1144,1147,1150,1153,1156,1159,1162,1165,1168,1171,1174,1177,1180,1183,1186,1189,1192,1195,1198,1201,1204,1207,1210,1213,1216,1219,1222,1225,1228,1231,1234,1237,1240,1243,1246,1249,1252,1255,1258,1261,1264,1267,1270,1273,1276,1279,1282,1285,1288,1291,1294,1297,1300,1303,1306,1309,1312,1315,1318,1321,1324,1327,1330,1333,1336,1339,1342,1345,1348,1351,1352,1355,1358,1361,1364,1367,1370,1373,1376,1379,1382,1385,1388,1391,1394,1397,1400,1403,1406,1409,1412,1415,1418,1421,1424,1427,1430,1433,1436,1439,1442,1445,1448,1451,1454,1457,1460,1463,1466,1469,1472,1475,1478,1481,1484,1487,1490],{"path":947,"title":948},"\u002Fabout","About Python CLI Toolcraft",{"path":950,"title":951},"\u002Fadvanced-input-parsing-user-experience\u002Fadvanced-argument-validation-strategies","Advanced Argument Validation Strategies",{"path":953,"title":954},"\u002Fadvanced-input-parsing-user-experience\u002Fadvanced-argument-validation-strategies\u002Fparsing-nested-json-arguments-in-python-clis","Parsing Nested JSON Args in Python CLIs",{"path":956,"title":957},"\u002Fadvanced-input-parsing-user-experience\u002Fadvanced-argument-validation-strategies\u002Fvalidating-dependent-and-conflicting-options","Validating Dependent and Conflicting CLI Options",{"path":959,"title":960},"\u002Fadvanced-input-parsing-user-experience\u002Fadvanced-argument-validation-strategies\u002Fvalidating-file-and-directory-paths-in-clis","Validating File and Directory Paths in CLIs",{"path":962,"title":963},"\u002Fadvanced-input-parsing-user-experience\u002Fadvanced-argument-validation-strategies\u002Fwriting-custom-click-parameter-types","Writing Custom Click Parameter Types",{"path":965,"title":966},"\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":968,"title":969},"\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":971,"title":972},"\u002Fadvanced-input-parsing-user-experience\u002Fbuilding-terminal-uis-with-textual","Building Terminal UIs with Textual for Python CLIs",{"path":974,"title":975},"\u002Fadvanced-input-parsing-user-experience\u002Fbuilding-terminal-uis-with-textual\u002Ftesting-textual-apps-with-pilot","Testing Textual Apps with Pilot",{"path":977,"title":978},"\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":980,"title":981},"\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":983,"title":984},"\u002Fadvanced-input-parsing-user-experience\u002Fcli-help-output-and-documentation","CLI Help Output and Documentation",{"path":986,"title":987},"\u002Fadvanced-input-parsing-user-experience\u002Fcli-help-output-and-documentation\u002Fversioning-and-deprecating-cli-flags","Versioning and Deprecating CLI Flags",{"path":989,"title":990},"\u002Fadvanced-input-parsing-user-experience\u002Fcli-help-output-and-documentation\u002Fwriting-help-text-users-actually-read","Writing Help Text Users Actually Read",{"path":992,"title":993},"\u002Fadvanced-input-parsing-user-experience\u002Fcross-platform-terminal-compatibility\u002Fadapting-output-to-terminal-width","Adapting Python CLI Output to Terminal Width",{"path":995,"title":996},"\u002Fadvanced-input-parsing-user-experience\u002Fcross-platform-terminal-compatibility\u002Fdetecting-ci-environments-and-non-interactive-shells","Detecting CI Environments and Non-Interactive Shells",{"path":998,"title":999},"\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":1001,"title":1002},"\u002Fadvanced-input-parsing-user-experience\u002Fcross-platform-terminal-compatibility","Cross-Platform Terminal Compatibility for Python CLIs",{"path":1004,"title":1005},"\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":1007,"title":1008},"\u002Fadvanced-input-parsing-user-experience\u002Ferror-handling-and-exit-codes\u002Fchoosing-exit-codes-for-cli-tools","Choosing Exit Codes for CLI Tools",{"path":1010,"title":1011},"\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":1013,"title":1014},"\u002Fadvanced-input-parsing-user-experience\u002Ferror-handling-and-exit-codes\u002Ffriendly-error-messages-and-tracebacks","Friendly Error Messages and Tracebacks",{"path":1016,"title":1017},"\u002Fadvanced-input-parsing-user-experience\u002Ferror-handling-and-exit-codes\u002Fhandling-keyboard-interrupt-cleanly","Handling Keyboard Interrupt Cleanly",{"path":1019,"title":1020},"\u002Fadvanced-input-parsing-user-experience\u002Ferror-handling-and-exit-codes","Error Handling and Exit Codes for CLIs",{"path":1022,"title":1023},"\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":1025,"title":1026},"\u002Fadvanced-input-parsing-user-experience\u002Fhandling-configuration-files-env-vars\u002Fconfig-precedence-flags-env-files-defaults","Config Precedence: Flags, Env, Files, Defaults",{"path":1028,"title":1029},"\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":1031,"title":1032},"\u002Fadvanced-input-parsing-user-experience\u002Fhandling-configuration-files-env-vars","Handling Config Files and Env Vars in CLIs",{"path":1034,"title":1035},"\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":1037,"title":1038},"\u002Fadvanced-input-parsing-user-experience\u002Fhandling-configuration-files-env-vars\u002Freading-toml-config-with-tomllib","Reading TOML Config with tomllib in Python CLIs",{"path":1040,"title":1041},"\u002Fadvanced-input-parsing-user-experience\u002Fhandling-configuration-files-env-vars\u002Ftyped-settings-with-pydantic-settings","Typed Settings with pydantic-settings in Python CLIs",{"path":1043,"title":1044},"\u002Fadvanced-input-parsing-user-experience","Advanced Input Parsing for Python CLIs",{"path":1046,"title":1047},"\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":1049,"title":1050},"\u002Fadvanced-input-parsing-user-experience\u002Finteractive-terminal-ui-with-rich\u002Fbuilding-interactive-prompts-and-menus","Building Interactive Prompts and Menus in Python CLIs",{"path":1052,"title":1053},"\u002Fadvanced-input-parsing-user-experience\u002Finteractive-terminal-ui-with-rich","Interactive Terminal UI with Rich",{"path":1055,"title":1056},"\u002Fadvanced-input-parsing-user-experience\u002Finteractive-terminal-ui-with-rich\u002Flive-dashboards-with-rich-live","Live Dashboards with Rich Live in Python CLIs",{"path":1058,"title":1059},"\u002Fadvanced-input-parsing-user-experience\u002Finteractive-terminal-ui-with-rich\u002Frendering-tables-and-json-with-rich","Rendering Tables and JSON with Rich",{"path":1061,"title":1062},"\u002Fadvanced-input-parsing-user-experience\u002Finteractive-terminal-ui-with-rich\u002Ftheming-rich-output-consistently","Theming Rich Output Consistently in Python CLIs",{"path":1064,"title":1065},"\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":1067,"title":1068},"\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":1070,"title":1071},"\u002Fadvanced-input-parsing-user-experience\u002Fshell-completion-for-python-clis","Shell Completion for Python CLIs",{"path":1073,"title":1074},"\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":1076,"title":1077},"\u002Fadvanced-input-parsing-user-experience\u002Fshell-completion-for-python-clis\u002Ftesting-shell-completion-in-python-clis","Testing Shell Completion in Python CLIs",{"path":1079,"title":1080},"\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":1082,"title":1083},"\u002Fadvanced-input-parsing-user-experience\u002Fstructured-logging-for-cli-apps\u002Fadding-verbose-and-quiet-logging-flags","Adding Verbose and Quiet Logging Flags",{"path":1085,"title":1086},"\u002Fadvanced-input-parsing-user-experience\u002Fstructured-logging-for-cli-apps","Structured Logging for CLI Apps",{"path":1088,"title":1089},"\u002Fadvanced-input-parsing-user-experience\u002Fstructured-logging-for-cli-apps\u002Fstructured-json-logging-in-python-clis","Structured JSON Logging in Python CLIs",{"path":1091,"title":1092},"\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":1094,"title":1095},"\u002Fadvanced-input-parsing-user-experience\u002Fworking-with-stdin-stdout-and-pipes\u002Fdetecting-tty-and-adapting-output","Detecting a TTY and Adapting Output",{"path":1097,"title":1098},"\u002Fadvanced-input-parsing-user-experience\u002Fworking-with-stdin-stdout-and-pipes\u002Femitting-json-output-for-scripting","Emitting JSON Output for Scripting",{"path":1100,"title":1101},"\u002Fadvanced-input-parsing-user-experience\u002Fworking-with-stdin-stdout-and-pipes\u002Fhandling-broken-pipe-and-sigpipe","Handling Broken Pipe and SIGPIPE",{"path":1103,"title":1104},"\u002Fadvanced-input-parsing-user-experience\u002Fworking-with-stdin-stdout-and-pipes","Working with stdin, stdout and Pipes",{"path":1106,"title":1107},"\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":1109,"title":1110},"\u002Fadvanced-input-parsing-user-experience\u002Fworking-with-stdin-stdout-and-pipes\u002Freading-piped-input-in-python-clis","Reading Piped Input in Python CLIs",{"path":1112,"title":1113},"\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":1115,"title":1116},"\u002Fcli-runtime-systems-integration\u002Fcalling-http-apis-from-python-clis\u002Fdownloading-files-with-progress-in-python","Downloading Files with Progress in Python CLIs",{"path":1118,"title":1119},"\u002Fcli-runtime-systems-integration\u002Fcalling-http-apis-from-python-clis","Calling HTTP APIs from Python CLIs",{"path":1121,"title":1122},"\u002Fcli-runtime-systems-integration\u002Fcalling-http-apis-from-python-clis\u002Foauth-device-flow-login-for-clis","OAuth Device Flow Login for Python CLIs",{"path":1124,"title":1125},"\u002Fcli-runtime-systems-integration\u002Fcalling-http-apis-from-python-clis\u002Fpaginating-api-results-in-a-cli","Paginating API Results in a Python CLI",{"path":1127,"title":1128},"\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":1130,"title":1131},"\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":1133,"title":1134},"\u002Fcli-runtime-systems-integration\u002Fconcurrency-and-async-in-python-clis","Concurrency and Async in Python CLIs",{"path":1136,"title":1137},"\u002Fcli-runtime-systems-integration\u002Fconcurrency-and-async-in-python-clis\u002Fmultiprocessing-for-cpu-bound-cli-tasks","Multiprocessing for CPU-Bound CLI Tasks",{"path":1139,"title":1140},"\u002Fcli-runtime-systems-integration\u002Fconcurrency-and-async-in-python-clis\u002Fparallelising-cli-work-with-thread-pools","Parallelising CLI Work with Thread Pools",{"path":1142,"title":1143},"\u002Fcli-runtime-systems-integration\u002Fconcurrency-and-async-in-python-clis\u002Frate-limiting-concurrent-requests-in-clis","Rate-Limiting Concurrent Requests in Python CLIs",{"path":1145,"title":1146},"\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":1148,"title":1149},"\u002Fcli-runtime-systems-integration\u002Ffilesystem-paths-and-atomic-writes\u002Fcross-platform-paths-with-pathlib","Cross-Platform Paths with pathlib in CLIs",{"path":1151,"title":1152},"\u002Fcli-runtime-systems-integration\u002Ffilesystem-paths-and-atomic-writes\u002Ffile-locking-for-concurrent-cli-runs","File Locking for Concurrent CLI Runs in Python",{"path":1154,"title":1155},"\u002Fcli-runtime-systems-integration\u002Ffilesystem-paths-and-atomic-writes","Filesystem Paths and Atomic Writes for CLIs",{"path":1157,"title":1158},"\u002Fcli-runtime-systems-integration\u002Ffilesystem-paths-and-atomic-writes\u002Fsafe-temporary-files-and-directories","Safe Temporary Files and Directories in CLIs",{"path":1160,"title":1161},"\u002Fcli-runtime-systems-integration\u002Ffilesystem-paths-and-atomic-writes\u002Fstoring-app-data-with-platformdirs","Storing CLI App Data with platformdirs",{"path":1163,"title":1164},"\u002Fcli-runtime-systems-integration\u002Ffilesystem-paths-and-atomic-writes\u002Fwriting-files-atomically-in-python-clis","Writing Files Atomically in Python CLIs",{"path":1166,"title":1167},"\u002Fcli-runtime-systems-integration","CLI Runtime & Systems Integration for Python",{"path":1169,"title":1170},"\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":1172,"title":1173},"\u002Fcli-runtime-systems-integration\u002Flong-running-and-watch-mode-clis\u002Fhandling-sigterm-and-graceful-shutdown","Handling SIGTERM and Graceful Shutdown in CLIs",{"path":1175,"title":1176},"\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":1178,"title":1179},"\u002Fcli-runtime-systems-integration\u002Flong-running-and-watch-mode-clis","Long-Running and Watch-Mode Python CLIs",{"path":1181,"title":1182},"\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":1184,"title":1185},"\u002Fcli-runtime-systems-integration\u002Frunning-subprocesses-from-python-clis\u002Favoiding-shell-injection-in-python-clis","Avoiding Shell Injection in Python CLIs",{"path":1187,"title":1188},"\u002Fcli-runtime-systems-integration\u002Frunning-subprocesses-from-python-clis\u002Fcalling-external-commands-safely-with-subprocess","Calling External Commands Safely with subprocess",{"path":1190,"title":1191},"\u002Fcli-runtime-systems-integration\u002Frunning-subprocesses-from-python-clis\u002Fhandling-subprocess-timeouts-and-exit-codes","Handling Subprocess Timeouts and Exit Codes",{"path":1193,"title":1194},"\u002Fcli-runtime-systems-integration\u002Frunning-subprocesses-from-python-clis","Running Subprocesses from Python CLIs",{"path":1196,"title":1197},"\u002Fcli-runtime-systems-integration\u002Frunning-subprocesses-from-python-clis\u002Fstreaming-subprocess-output-in-real-time","Streaming Subprocess Output in Real Time",{"path":1199,"title":1200},"\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":1202,"title":1203},"\u002Fcli-runtime-systems-integration\u002Fsecrets-and-credentials-in-python-clis","Secrets and Credentials in Python CLIs",{"path":1205,"title":1206},"\u002Fcli-runtime-systems-integration\u002Fsecrets-and-credentials-in-python-clis\u002Fprompting-for-passwords-securely","Prompting for Passwords Securely in Python CLIs",{"path":1208,"title":1209},"\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":1211,"title":1212},"\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":1214,"title":1215},"\u002Fcli-runtime-systems-integration\u002Fsecrets-and-credentials-in-python-clis\u002Fstoring-tokens-with-keyring","Storing CLI Tokens Securely with keyring",{"path":1217,"title":1218},"\u002Fcli-runtime-systems-integration\u002Fsecrets-and-credentials-in-python-clis\u002Fsupporting-multiple-profiles-and-accounts","Supporting Multiple Profiles and Accounts in CLIs",{"path":1220,"title":1221},"\u002F","Python CLI Toolcraft",{"path":1223,"title":1224},"\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":1226,"title":1227},"\u002Fmodern-python-cli-frameworks-architecture\u002Fcli-startup-performance-and-lazy-loading","CLI Startup Performance and Lazy Loading",{"path":1229,"title":1230},"\u002Fmodern-python-cli-frameworks-architecture\u002Fcli-startup-performance-and-lazy-loading\u002Flazy-loading-subcommands-for-faster-startup","Lazy Loading Subcommands for Faster Startup",{"path":1232,"title":1233},"\u002Fmodern-python-cli-frameworks-architecture\u002Fcli-startup-performance-and-lazy-loading\u002Fprofiling-python-cli-startup-time","Profiling Python CLI Startup Time",{"path":1235,"title":1236},"\u002Fmodern-python-cli-frameworks-architecture\u002Fcli-startup-performance-and-lazy-loading\u002Freducing-cli-dependency-weight","Reducing CLI Dependency Weight",{"path":1238,"title":1239},"\u002Fmodern-python-cli-frameworks-architecture\u002Fcommand-line-parsing-with-argparse\u002Fargparse-subparsers-for-subcommands","argparse Subparsers for Subcommands",{"path":1241,"title":1242},"\u002Fmodern-python-cli-frameworks-architecture\u002Fcommand-line-parsing-with-argparse\u002Fargparse-vs-click-vs-typer-comparison","argparse vs Click vs Typer Compared",{"path":1244,"title":1245},"\u002Fmodern-python-cli-frameworks-architecture\u002Fcommand-line-parsing-with-argparse","Command-Line Parsing with argparse",{"path":1247,"title":1248},"\u002Fmodern-python-cli-frameworks-architecture\u002Fcommand-line-parsing-with-argparse\u002Fmigrating-from-argparse-to-typer","Migrating from argparse to Typer",{"path":1250,"title":1251},"\u002Fmodern-python-cli-frameworks-architecture\u002Fcommand-line-parsing-with-argparse\u002Fmutually-exclusive-options-in-argparse","Mutually Exclusive Options in argparse",{"path":1253,"title":1254},"\u002Fmodern-python-cli-frameworks-architecture\u002Fcommand-line-parsing-with-argparse\u002Fwriting-custom-argparse-actions","Writing Custom argparse Actions in Python",{"path":1256,"title":1257},"\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":1259,"title":1260},"\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":1262,"title":1263},"\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":1265,"title":1266},"\u002Fmodern-python-cli-frameworks-architecture\u002Fdesigning-cli-interfaces-and-conventions","Designing CLI Interfaces and Conventions in Python",{"path":1268,"title":1269},"\u002Fmodern-python-cli-frameworks-architecture\u002Fdesigning-cli-interfaces-and-conventions\u002Fnaming-commands-and-flags-consistently","Naming Commands and Flags Consistently in Python CLIs",{"path":1271,"title":1272},"\u002Fmodern-python-cli-frameworks-architecture","Python CLI Frameworks and Architecture",{"path":1274,"title":1275},"\u002Fmodern-python-cli-frameworks-architecture\u002Fplugin-architectures-for-extensible-clis\u002Fdiscovering-plugins-with-entry-points","Discovering Plugins with Entry Points in Python CLIs",{"path":1277,"title":1278},"\u002Fmodern-python-cli-frameworks-architecture\u002Fplugin-architectures-for-extensible-clis\u002Fhook-based-plugins-with-pluggy","Hook-Based Plugins for Python CLIs with pluggy",{"path":1280,"title":1281},"\u002Fmodern-python-cli-frameworks-architecture\u002Fplugin-architectures-for-extensible-clis","Plugin Architectures for Extensible CLIs",{"path":1283,"title":1284},"\u002Fmodern-python-cli-frameworks-architecture\u002Fplugin-architectures-for-extensible-clis\u002Fversioning-a-plugin-api","Versioning a Plugin API for a Python CLI",{"path":1286,"title":1287},"\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":1289,"title":1290},"\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":1292,"title":1293},"\u002Fmodern-python-cli-frameworks-architecture\u002Fstructuring-multi-command-python-clis\u002Fdependency-injection-patterns-for-cli-commands","Dependency Injection Patterns for CLI Commands",{"path":1295,"title":1296},"\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":1298,"title":1299},"\u002Fmodern-python-cli-frameworks-architecture\u002Fstructuring-multi-command-python-clis","Structuring Multi-Command Python CLIs",{"path":1301,"title":1302},"\u002Fmodern-python-cli-frameworks-architecture\u002Fstructuring-multi-command-python-clis\u002Fsharing-common-options-across-commands","Sharing Common Options Across Python CLI Commands",{"path":1304,"title":1305},"\u002Fmodern-python-cli-frameworks-architecture\u002Fstructuring-multi-command-python-clis\u002Fsharing-state-with-click-context-objects","Sharing State with Click Context Objects",{"path":1307,"title":1308},"\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":1310,"title":1311},"\u002Fmodern-python-cli-frameworks-architecture\u002Ftesting-python-cli-applications","Testing Python CLI Applications",{"path":1313,"title":1314},"\u002Fmodern-python-cli-frameworks-architecture\u002Ftesting-python-cli-applications\u002Fmeasuring-cli-test-coverage","Measuring CLI Test Coverage",{"path":1316,"title":1317},"\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":1319,"title":1320},"\u002Fmodern-python-cli-frameworks-architecture\u002Ftesting-python-cli-applications\u002Fproperty-based-testing-cli-arguments-with-hypothesis","Property-Based Testing CLI Arguments with Hypothesis",{"path":1322,"title":1323},"\u002Fmodern-python-cli-frameworks-architecture\u002Ftesting-python-cli-applications\u002Fsnapshot-testing-cli-output","Snapshot Testing CLI Output",{"path":1325,"title":1326},"\u002Fmodern-python-cli-frameworks-architecture\u002Ftesting-python-cli-applications\u002Ftesting-click-commands-with-clirunner","Testing Click Commands with CliRunner",{"path":1328,"title":1329},"\u002Fmodern-python-cli-frameworks-architecture\u002Ftesting-python-cli-applications\u002Ftesting-interactive-prompts-and-stdin","Testing Interactive Prompts and stdin",{"path":1331,"title":1332},"\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":1334,"title":1335},"\u002Fmodern-python-cli-frameworks-architecture\u002Ftyper-vs-click-when-to-use-each\u002Fbuilding-dynamic-commands-in-click","Building Dynamic Commands in Click",{"path":1337,"title":1338},"\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":1340,"title":1341},"\u002Fmodern-python-cli-frameworks-architecture\u002Ftyper-vs-click-when-to-use-each","Typer vs Click: When to Use Each",{"path":1343,"title":1344},"\u002Fmodern-python-cli-frameworks-architecture\u002Ftyper-vs-click-when-to-use-each\u002Ftyper-callback-functions-explained","Typer callback functions explained",{"path":1346,"title":1347},"\u002Fmodern-python-cli-frameworks-architecture\u002Ftyper-vs-click-when-to-use-each\u002Fusing-annotated-options-in-typer","Using Annotated Options in Typer",{"path":1349,"title":1350},"\u002Fproject-setup-dependency-management\u002Fci-cd-pipelines-for-python-clis\u002Fautomating-releases-from-git-tags","Automating Python CLI Releases from Git Tags",{"path":935,"title":5},{"path":1353,"title":1354},"\u002Fproject-setup-dependency-management\u002Fci-cd-pipelines-for-python-clis","CI\u002FCD Pipelines for Python CLIs",{"path":1356,"title":1357},"\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":1359,"title":1360},"\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":1362,"title":1363},"\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":1365,"title":1366},"\u002Fproject-setup-dependency-management\u002Fcli-project-scaffolding-with-cookiecutter\u002Fbuilding-a-cookiecutter-template-for-typer-clis","Building a Cookiecutter Template for Typer CLIs",{"path":1368,"title":1369},"\u002Fproject-setup-dependency-management\u002Fcli-project-scaffolding-with-cookiecutter\u002Fcopier-vs-cookiecutter-for-cli-templates","Copier vs Cookiecutter for CLI Templates",{"path":1371,"title":1372},"\u002Fproject-setup-dependency-management\u002Fcli-project-scaffolding-with-cookiecutter","CLI Project Scaffolding with Cookiecutter",{"path":1374,"title":1375},"\u002Fproject-setup-dependency-management\u002Fcli-project-scaffolding-with-cookiecutter\u002Fpost-generation-hooks-in-cli-templates","Post-Generation Hooks in Python CLI Templates",{"path":1377,"title":1378},"\u002Fproject-setup-dependency-management\u002Fdistributing-clis-as-standalone-binaries\u002Fbuilding-cross-platform-release-binaries-in-ci","Building Cross-Platform Release Binaries in CI",{"path":1380,"title":1381},"\u002Fproject-setup-dependency-management\u002Fdistributing-clis-as-standalone-binaries\u002Fbundling-a-python-cli-with-pyinstaller","Bundling a Python CLI with PyInstaller",{"path":1383,"title":1384},"\u002Fproject-setup-dependency-management\u002Fdistributing-clis-as-standalone-binaries\u002Fhomebrew-and-scoop-packaging-for-python-clis","Homebrew and Scoop Packaging for Python CLIs",{"path":1386,"title":1387},"\u002Fproject-setup-dependency-management\u002Fdistributing-clis-as-standalone-binaries","Distributing CLIs as Standalone Binaries",{"path":1389,"title":1390},"\u002Fproject-setup-dependency-management\u002Fdistributing-clis-as-standalone-binaries\u002Fnuitka-vs-pyinstaller-for-python-clis","Nuitka vs PyInstaller for Python CLI Binaries",{"path":1392,"title":1393},"\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":1395,"title":1396},"\u002Fproject-setup-dependency-management","Project Setup & Dependency Management",{"path":1398,"title":1399},"\u002Fproject-setup-dependency-management\u002Flinting-and-type-checking-cli-code\u002Fconfiguring-ruff-for-a-cli-project","Configuring Ruff for a Python CLI Project",{"path":1401,"title":1402},"\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":1404,"title":1405},"\u002Fproject-setup-dependency-management\u002Flinting-and-type-checking-cli-code","Linting and Type-Checking Python CLI Code",{"path":1407,"title":1408},"\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":1410,"title":1411},"\u002Fproject-setup-dependency-management\u002Fmanaging-cli-versioning-changelogs\u002Fautomating-changelogs-with-conventional-commits","Automating Changelogs with Conventional Commits",{"path":1413,"title":1414},"\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":1416,"title":1417},"\u002Fproject-setup-dependency-management\u002Fmanaging-cli-versioning-changelogs\u002Fexposing-version-info-and-build-metadata","Exposing Version Info and Build Metadata",{"path":1419,"title":1420},"\u002Fproject-setup-dependency-management\u002Fmanaging-cli-versioning-changelogs","Managing CLI Versioning & Changelogs",{"path":1422,"title":1423},"\u002Fproject-setup-dependency-management\u002Fmanaging-cli-versioning-changelogs\u002Fsemantic-versioning-policy-for-cli-tools","A Semantic Versioning Policy for CLI Tools",{"path":1425,"title":1426},"\u002Fproject-setup-dependency-management\u002Fpackaging-python-clis-for-distribution\u002Fbuilding-wheels-and-sdists-for-python-clis","Building Wheels and sdists for Python CLIs",{"path":1428,"title":1429},"\u002Fproject-setup-dependency-management\u002Fpackaging-python-clis-for-distribution\u002Fbundling-data-files-with-importlib-resources","Bundling Data Files with importlib.resources in CLIs",{"path":1431,"title":1432},"\u002Fproject-setup-dependency-management\u002Fpackaging-python-clis-for-distribution","Packaging Python CLIs for Distribution",{"path":1434,"title":1435},"\u002Fproject-setup-dependency-management\u002Fpackaging-python-clis-for-distribution\u002Finstalling-and-distributing-clis-with-pipx","Installing and Distributing CLIs with pipx",{"path":1437,"title":1438},"\u002Fproject-setup-dependency-management\u002Fpackaging-python-clis-for-distribution\u002Fpublishing-a-python-cli-to-pypi","Publishing a Python CLI to PyPI",{"path":1440,"title":1441},"\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":1443,"title":1444},"\u002Fproject-setup-dependency-management\u002Fpoetry-workflows-for-cli-development","Poetry Workflows for CLI Development",{"path":1446,"title":1447},"\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":1449,"title":1450},"\u002Fproject-setup-dependency-management\u002Fpoetry-workflows-for-cli-development\u002Fpoetry-dependency-groups-for-cli-tooling","Poetry Dependency Groups for CLI Tooling",{"path":1452,"title":1453},"\u002Fproject-setup-dependency-management\u002Fpoetry-workflows-for-cli-development\u002Fpoetry-entry-points-and-scripts-for-clis","Poetry Entry Points and Scripts for CLIs",{"path":1455,"title":1456},"\u002Fproject-setup-dependency-management\u002Fpre-commit-hooks-for-cli-projects","Pre-commit Hooks for CLI Projects",{"path":1458,"title":1459},"\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":1461,"title":1462},"\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":1464,"title":1465},"\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":1467,"title":1468},"\u002Fproject-setup-dependency-management\u002Fuv-for-python-cli-dependency-management","uv for Python CLI Dependency Management",{"path":1470,"title":1471},"\u002Fproject-setup-dependency-management\u002Fuv-for-python-cli-dependency-management\u002Frunning-one-off-cli-scripts-with-uv-run","Running One-Off CLI Scripts with uv run and PEP 723",{"path":1473,"title":1474},"\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":1476,"title":1477},"\u002Fproject-setup-dependency-management\u002Fuv-for-python-cli-dependency-management\u002Fuv-tool-install-vs-pipx-for-clis","uv tool install vs pipx for CLIs",{"path":1479,"title":1480},"\u002Fproject-setup-dependency-management\u002Fuv-for-python-cli-dependency-management\u002Fuv-workspaces-for-multi-package-clis","uv Workspaces for Multi-Package Python CLIs",{"path":1482,"title":1483},"\u002Fproject-setup-dependency-management\u002Fvirtual-environments-isolation-best-practices","Python CLI Env Isolation Best Practices",{"path":1485,"title":1486},"\u002Fproject-setup-dependency-management\u002Fvirtual-environments-isolation-best-practices\u002Fmanaging-virtual-environments-for-cross-platform-clis","Managing Python CLI Virtual Environments",{"path":1488,"title":1489},"\u002Fproject-setup-dependency-management\u002Fvirtual-environments-isolation-best-practices\u002Fpinning-the-python-version-for-a-cli","Pinning the Python Version for a CLI",{"path":1491,"title":1492},"\u002Fproject-setup-dependency-management\u002Fvirtual-environments-isolation-best-practices\u002Fsupporting-multiple-python-versions-with-nox","Supporting Multiple Python Versions with nox",1789736907467]