[{"data":1,"prerenderedAt":3127},["ShallowReactive",2],{"page-\u002Fcli-runtime-systems-integration\u002Frunning-subprocesses-from-python-clis\u002Flaunching-the-users-editor-from-a-cli\u002F":3,"content-directory":2283},{"id":4,"title":5,"body":6,"date":2267,"description":2268,"difficulty":2269,"draft":2270,"extension":2271,"meta":2272,"navigation":114,"path":2273,"seo":2274,"stem":2275,"tags":2276,"updated":2267,"__hash__":2282},"content\u002Fcli-runtime-systems-integration\u002Frunning-subprocesses-from-python-clis\u002Flaunching-the-users-editor-from-a-cli\u002Findex.md","Launching the User’s Editor from a Python CLI",{"type":7,"value":8,"toc":2245},"minimark",[9,39,44,58,62,66,69,73,856,1189,1194,1228,1257,1261,1290,1294,1303,1310,1313,1317,1347,1351,1401,1404,1408,1415,2106,2116,2120,2135,2139,2147,2152,2156,2168,2172,2182,2186,2196,2200,2207,2211,2241],[10,11,12,13,17,18,17,21,24,25,28,29,32,33,38],"p",{},"Some input is too long or too structured for a command-line option: a commit message, release notes, a ticket description, a YAML manifest to tweak before applying. ",[14,15,16],"code",{},"git commit",", ",[14,19,20],{},"crontab -e",[14,22,23],{},"kubectl edit"," and ",[14,26,27],{},"gh pr create"," all solve this the same way — they open the user’s own editor on a temporary file, wait for it to close, and read the result. Users get their familiar keybindings, syntax highlighting and spell checker; the CLI gets well-formed text. Doing it well takes more than ",[14,30,31],{},"subprocess.run([\"vim\", path])",": the editor must come from the right environment variables and may include arguments, the temporary file should have a suffix that triggers highlighting, instructions can live in comment lines that are stripped afterwards, an unchanged or empty buffer should abort rather than submit, and the whole thing must fail clearly when there is no terminal. This guide builds that helper and a command that uses it, and tests it without ever opening a real editor. It belongs to the ",[34,35,37],"a",{"href":36},"\u002Fcli-runtime-systems-integration\u002Frunning-subprocesses-from-python-clis\u002F","running subprocesses from Python CLIs topic",".",[40,41,43],"h2",{"id":42},"prerequisites","Prerequisites",[45,46,47,55],"ul",{},[48,49,50,51,38],"li",{},"Familiarity with ",[34,52,54],{"href":53},"\u002Fcli-runtime-systems-integration\u002Frunning-subprocesses-from-python-clis\u002Fcalling-external-commands-safely-with-subprocess\u002F","calling external commands safely with subprocess",[48,56,57],{},"Typer for the example command (examples checked with Typer 0.27 and Python 3.13).",[40,59,61],{"id":60},"the-editing-round-trip","The editing round trip",[63,64],"inline-diagram",{"name":65},"editor-roundtrip",[10,67,68],{},"The flow is the one users know from git: the command writes a template — usually empty space for the answer plus a few commented instructions — to a temporary file, hands control of the terminal to the editor, and blocks. When the editor exits, the command reads the file back, drops the comment lines and decides: real content continues, an unchanged or empty buffer aborts, a failed editor saves nothing.",[40,70,72],{"id":71},"the-recipe","The recipe",[74,75,80],"pre",{"className":76,"code":77,"language":78,"meta":79,"style":79},"language-python shiki shiki-themes github-light github-dark","# src\u002Fmytool\u002Feditor.py\nfrom __future__ import annotations\n\nimport os\nimport shlex\nimport shutil\nimport subprocess\nimport sys\nimport tempfile\nfrom pathlib import Path\n\n\nclass EditorError(Exception):\n    pass\n\n\ndef editor_command() -> list[str]:\n    \"\"\"$MYTOOL_EDITOR, then $VISUAL, then $EDITOR, then a platform default.\"\"\"\n    for var in (\"MYTOOL_EDITOR\", \"VISUAL\", \"EDITOR\"):\n        if value := os.environ.get(var, \"\").strip():\n            return shlex.split(value, posix=os.name != \"nt\")\n    for fallback in ([\"notepad\"] if os.name == \"nt\" else [\"nano\"], [\"vi\"]):\n        if shutil.which(fallback[0]):\n            return fallback\n    raise EditorError(\"no editor found; set $EDITOR (for example: export EDITOR=nano)\")\n\n\ndef edit_text(initial: str, *, suffix: str = \".txt\", comment: str = \"#\") -> str | None:\n    \"\"\"Open INITIAL in the user's editor and return the result without comment lines.\n\n    Returns None when the user saved nothing new (unchanged or empty), which callers treat as \"abort\".\n    \"\"\"\n    if not sys.stdin.isatty() and \"MYTOOL_EDITOR\" not in os.environ:\n        raise EditorError(\"cannot open an editor without a terminal; pass the text with --message\")\n    command = editor_command()\n    with tempfile.TemporaryDirectory(prefix=\"mytool-\") as tmp:\n        path = Path(tmp) \u002F f\"EDIT{suffix}\"                 # suffix gives the editor syntax highlighting\n        path.write_text(initial, encoding=\"utf-8\")\n        try:\n            result = subprocess.run([*command, str(path)])\n        except FileNotFoundError:\n            raise EditorError(f\"editor not found: {command[0]!r}\") from None\n        if result.returncode != 0:\n            raise EditorError(f\"editor exited with status {result.returncode}; nothing saved\")\n        edited = path.read_text(encoding=\"utf-8\")\n    if edited == initial:\n        return None\n    kept = [line for line in edited.splitlines() if not line.startswith(comment)]\n    text = \"\\n\".join(kept).strip()\n    return text + \"\\n\" if text else None\n","python","",[14,81,82,91,109,116,125,133,141,149,157,165,178,183,188,207,213,218,223,241,248,278,299,327,375,388,396,410,415,420,473,479,484,490,496,522,535,546,572,607,623,631,652,663,701,716,740,759,772,780,809,828],{"__ignoreMap":79},[83,84,87],"span",{"class":85,"line":86},"line",1,[83,88,90],{"class":89},"sJ8bj","# src\u002Fmytool\u002Feditor.py\n",[83,92,94,98,102,105],{"class":85,"line":93},2,[83,95,97],{"class":96},"szBVR","from",[83,99,101],{"class":100},"sj4cs"," __future__",[83,103,104],{"class":96}," import",[83,106,108],{"class":107},"sVt8B"," annotations\n",[83,110,112],{"class":85,"line":111},3,[83,113,115],{"emptyLinePlaceholder":114},true,"\n",[83,117,119,122],{"class":85,"line":118},4,[83,120,121],{"class":96},"import",[83,123,124],{"class":107}," os\n",[83,126,128,130],{"class":85,"line":127},5,[83,129,121],{"class":96},[83,131,132],{"class":107}," shlex\n",[83,134,136,138],{"class":85,"line":135},6,[83,137,121],{"class":96},[83,139,140],{"class":107}," shutil\n",[83,142,144,146],{"class":85,"line":143},7,[83,145,121],{"class":96},[83,147,148],{"class":107}," subprocess\n",[83,150,152,154],{"class":85,"line":151},8,[83,153,121],{"class":96},[83,155,156],{"class":107}," sys\n",[83,158,160,162],{"class":85,"line":159},9,[83,161,121],{"class":96},[83,163,164],{"class":107}," tempfile\n",[83,166,168,170,173,175],{"class":85,"line":167},10,[83,169,97],{"class":96},[83,171,172],{"class":107}," pathlib ",[83,174,121],{"class":96},[83,176,177],{"class":107}," Path\n",[83,179,181],{"class":85,"line":180},11,[83,182,115],{"emptyLinePlaceholder":114},[83,184,186],{"class":85,"line":185},12,[83,187,115],{"emptyLinePlaceholder":114},[83,189,191,194,198,201,204],{"class":85,"line":190},13,[83,192,193],{"class":96},"class",[83,195,197],{"class":196},"sScJk"," EditorError",[83,199,200],{"class":107},"(",[83,202,203],{"class":100},"Exception",[83,205,206],{"class":107},"):\n",[83,208,210],{"class":85,"line":209},14,[83,211,212],{"class":96},"    pass\n",[83,214,216],{"class":85,"line":215},15,[83,217,115],{"emptyLinePlaceholder":114},[83,219,221],{"class":85,"line":220},16,[83,222,115],{"emptyLinePlaceholder":114},[83,224,226,229,232,235,238],{"class":85,"line":225},17,[83,227,228],{"class":96},"def",[83,230,231],{"class":196}," editor_command",[83,233,234],{"class":107},"() -> list[",[83,236,237],{"class":100},"str",[83,239,240],{"class":107},"]:\n",[83,242,244],{"class":85,"line":243},18,[83,245,247],{"class":246},"sZZnC","    \"\"\"$MYTOOL_EDITOR, then $VISUAL, then $EDITOR, then a platform default.\"\"\"\n",[83,249,251,254,257,260,263,266,268,271,273,276],{"class":85,"line":250},19,[83,252,253],{"class":96},"    for",[83,255,256],{"class":107}," var ",[83,258,259],{"class":96},"in",[83,261,262],{"class":107}," (",[83,264,265],{"class":246},"\"MYTOOL_EDITOR\"",[83,267,17],{"class":107},[83,269,270],{"class":246},"\"VISUAL\"",[83,272,17],{"class":107},[83,274,275],{"class":246},"\"EDITOR\"",[83,277,206],{"class":107},[83,279,281,284,287,290,293,296],{"class":85,"line":280},20,[83,282,283],{"class":96},"        if",[83,285,286],{"class":107}," value ",[83,288,289],{"class":96},":=",[83,291,292],{"class":107}," os.environ.get(var, ",[83,294,295],{"class":246},"\"\"",[83,297,298],{"class":107},").strip():\n",[83,300,302,305,308,312,315,318,321,324],{"class":85,"line":301},21,[83,303,304],{"class":96},"            return",[83,306,307],{"class":107}," shlex.split(value, ",[83,309,311],{"class":310},"s4XuR","posix",[83,313,314],{"class":96},"=",[83,316,317],{"class":107},"os.name ",[83,319,320],{"class":96},"!=",[83,322,323],{"class":246}," \"nt\"",[83,325,326],{"class":107},")\n",[83,328,330,332,335,337,340,343,346,349,352,355,357,360,363,366,369,372],{"class":85,"line":329},22,[83,331,253],{"class":96},[83,333,334],{"class":107}," fallback ",[83,336,259],{"class":96},[83,338,339],{"class":107}," ([",[83,341,342],{"class":246},"\"notepad\"",[83,344,345],{"class":107},"] ",[83,347,348],{"class":96},"if",[83,350,351],{"class":107}," os.name ",[83,353,354],{"class":96},"==",[83,356,323],{"class":246},[83,358,359],{"class":96}," else",[83,361,362],{"class":107}," [",[83,364,365],{"class":246},"\"nano\"",[83,367,368],{"class":107},"], [",[83,370,371],{"class":246},"\"vi\"",[83,373,374],{"class":107},"]):\n",[83,376,378,380,383,386],{"class":85,"line":377},23,[83,379,283],{"class":96},[83,381,382],{"class":107}," shutil.which(fallback[",[83,384,385],{"class":100},"0",[83,387,374],{"class":107},[83,389,391,393],{"class":85,"line":390},24,[83,392,304],{"class":96},[83,394,395],{"class":107}," fallback\n",[83,397,399,402,405,408],{"class":85,"line":398},25,[83,400,401],{"class":96},"    raise",[83,403,404],{"class":107}," EditorError(",[83,406,407],{"class":246},"\"no editor found; set $EDITOR (for example: export EDITOR=nano)\"",[83,409,326],{"class":107},[83,411,413],{"class":85,"line":412},26,[83,414,115],{"emptyLinePlaceholder":114},[83,416,418],{"class":85,"line":417},27,[83,419,115],{"emptyLinePlaceholder":114},[83,421,423,425,428,431,433,435,438,441,443,446,449,452,454,456,459,462,464,467,470],{"class":85,"line":422},28,[83,424,228],{"class":96},[83,426,427],{"class":196}," edit_text",[83,429,430],{"class":107},"(initial: ",[83,432,237],{"class":100},[83,434,17],{"class":107},[83,436,437],{"class":96},"*",[83,439,440],{"class":107},", suffix: ",[83,442,237],{"class":100},[83,444,445],{"class":96}," =",[83,447,448],{"class":246}," \".txt\"",[83,450,451],{"class":107},", comment: ",[83,453,237],{"class":100},[83,455,445],{"class":96},[83,457,458],{"class":246}," \"#\"",[83,460,461],{"class":107},") -> ",[83,463,237],{"class":100},[83,465,466],{"class":96}," |",[83,468,469],{"class":100}," None",[83,471,472],{"class":107},":\n",[83,474,476],{"class":85,"line":475},29,[83,477,478],{"class":246},"    \"\"\"Open INITIAL in the user's editor and return the result without comment lines.\n",[83,480,482],{"class":85,"line":481},30,[83,483,115],{"emptyLinePlaceholder":114},[83,485,487],{"class":85,"line":486},31,[83,488,489],{"class":246},"    Returns None when the user saved nothing new (unchanged or empty), which callers treat as \"abort\".\n",[83,491,493],{"class":85,"line":492},32,[83,494,495],{"class":246},"    \"\"\"\n",[83,497,499,502,505,508,511,514,516,519],{"class":85,"line":498},33,[83,500,501],{"class":96},"    if",[83,503,504],{"class":96}," not",[83,506,507],{"class":107}," sys.stdin.isatty() ",[83,509,510],{"class":96},"and",[83,512,513],{"class":246}," \"MYTOOL_EDITOR\"",[83,515,504],{"class":96},[83,517,518],{"class":96}," in",[83,520,521],{"class":107}," os.environ:\n",[83,523,525,528,530,533],{"class":85,"line":524},34,[83,526,527],{"class":96},"        raise",[83,529,404],{"class":107},[83,531,532],{"class":246},"\"cannot open an editor without a terminal; pass the text with --message\"",[83,534,326],{"class":107},[83,536,538,541,543],{"class":85,"line":537},35,[83,539,540],{"class":107},"    command ",[83,542,314],{"class":96},[83,544,545],{"class":107}," editor_command()\n",[83,547,549,552,555,558,560,563,566,569],{"class":85,"line":548},36,[83,550,551],{"class":96},"    with",[83,553,554],{"class":107}," tempfile.TemporaryDirectory(",[83,556,557],{"class":310},"prefix",[83,559,314],{"class":96},[83,561,562],{"class":246},"\"mytool-\"",[83,564,565],{"class":107},") ",[83,567,568],{"class":96},"as",[83,570,571],{"class":107}," tmp:\n",[83,573,575,578,580,583,586,589,592,595,598,601,604],{"class":85,"line":574},37,[83,576,577],{"class":107},"        path ",[83,579,314],{"class":96},[83,581,582],{"class":107}," Path(tmp) ",[83,584,585],{"class":96},"\u002F",[83,587,588],{"class":96}," f",[83,590,591],{"class":246},"\"EDIT",[83,593,594],{"class":100},"{",[83,596,597],{"class":107},"suffix",[83,599,600],{"class":100},"}",[83,602,603],{"class":246},"\"",[83,605,606],{"class":89},"                 # suffix gives the editor syntax highlighting\n",[83,608,610,613,616,618,621],{"class":85,"line":609},38,[83,611,612],{"class":107},"        path.write_text(initial, ",[83,614,615],{"class":310},"encoding",[83,617,314],{"class":96},[83,619,620],{"class":246},"\"utf-8\"",[83,622,326],{"class":107},[83,624,626,629],{"class":85,"line":625},39,[83,627,628],{"class":96},"        try",[83,630,472],{"class":107},[83,632,634,637,639,642,644,647,649],{"class":85,"line":633},40,[83,635,636],{"class":107},"            result ",[83,638,314],{"class":96},[83,640,641],{"class":107}," subprocess.run([",[83,643,437],{"class":96},[83,645,646],{"class":107},"command, ",[83,648,237],{"class":100},[83,650,651],{"class":107},"(path)])\n",[83,653,655,658,661],{"class":85,"line":654},41,[83,656,657],{"class":96},"        except",[83,659,660],{"class":100}," FileNotFoundError",[83,662,472],{"class":107},[83,664,666,669,671,674,677,679,682,684,687,690,692,694,696,698],{"class":85,"line":665},42,[83,667,668],{"class":96},"            raise",[83,670,404],{"class":107},[83,672,673],{"class":96},"f",[83,675,676],{"class":246},"\"editor not found: ",[83,678,594],{"class":100},[83,680,681],{"class":107},"command[",[83,683,385],{"class":100},[83,685,686],{"class":107},"]",[83,688,689],{"class":96},"!r",[83,691,600],{"class":100},[83,693,603],{"class":246},[83,695,565],{"class":107},[83,697,97],{"class":96},[83,699,700],{"class":100}," None\n",[83,702,704,706,709,711,714],{"class":85,"line":703},43,[83,705,283],{"class":96},[83,707,708],{"class":107}," result.returncode ",[83,710,320],{"class":96},[83,712,713],{"class":100}," 0",[83,715,472],{"class":107},[83,717,719,721,723,725,728,730,733,735,738],{"class":85,"line":718},44,[83,720,668],{"class":96},[83,722,404],{"class":107},[83,724,673],{"class":96},[83,726,727],{"class":246},"\"editor exited with status ",[83,729,594],{"class":100},[83,731,732],{"class":107},"result.returncode",[83,734,600],{"class":100},[83,736,737],{"class":246},"; nothing saved\"",[83,739,326],{"class":107},[83,741,743,746,748,751,753,755,757],{"class":85,"line":742},45,[83,744,745],{"class":107},"        edited ",[83,747,314],{"class":96},[83,749,750],{"class":107}," path.read_text(",[83,752,615],{"class":310},[83,754,314],{"class":96},[83,756,620],{"class":246},[83,758,326],{"class":107},[83,760,762,764,767,769],{"class":85,"line":761},46,[83,763,501],{"class":96},[83,765,766],{"class":107}," edited ",[83,768,354],{"class":96},[83,770,771],{"class":107}," initial:\n",[83,773,775,778],{"class":85,"line":774},47,[83,776,777],{"class":96},"        return",[83,779,700],{"class":100},[83,781,783,786,788,791,794,797,799,802,804,806],{"class":85,"line":782},48,[83,784,785],{"class":107},"    kept ",[83,787,314],{"class":96},[83,789,790],{"class":107}," [line ",[83,792,793],{"class":96},"for",[83,795,796],{"class":107}," line ",[83,798,259],{"class":96},[83,800,801],{"class":107}," edited.splitlines() ",[83,803,348],{"class":96},[83,805,504],{"class":96},[83,807,808],{"class":107}," line.startswith(comment)]\n",[83,810,812,815,817,820,823,825],{"class":85,"line":811},49,[83,813,814],{"class":107},"    text ",[83,816,314],{"class":96},[83,818,819],{"class":246}," \"",[83,821,822],{"class":100},"\\n",[83,824,603],{"class":246},[83,826,827],{"class":107},".join(kept).strip()\n",[83,829,831,834,837,840,842,844,846,849,851,854],{"class":85,"line":830},50,[83,832,833],{"class":96},"    return",[83,835,836],{"class":107}," text ",[83,838,839],{"class":96},"+",[83,841,819],{"class":246},[83,843,822],{"class":100},[83,845,603],{"class":246},[83,847,848],{"class":96}," if",[83,850,836],{"class":107},[83,852,853],{"class":96},"else",[83,855,700],{"class":100},[74,857,859],{"className":76,"code":858,"language":78,"meta":79,"style":79},"# src\u002Fmytool\u002Fcli.py\nfrom typing import Annotated, Optional\n\nimport typer\n\nfrom mytool.editor import EditorError, edit_text\n\napp = typer.Typer()\n\nTEMPLATE = \"\"\"\\\n\n# Describe the release. Lines starting with '#' are ignored.\n# An empty message aborts.\n\"\"\"\n\n\n@app.callback()\ndef main() -> None:\n    \"\"\"Release tool.\"\"\"\n\n\n@app.command()\ndef note(message: Annotated[Optional[str], typer.Option(\"--message\", \"-m\")] = None) -> None:\n    \"\"\"Write a release note, in the editor unless --message is given.\"\"\"\n    if message is None:\n        try:\n            message = edit_text(TEMPLATE, suffix=\".md\")\n        except EditorError as exc:\n            typer.echo(f\"error: {exc}\", err=True)\n            raise typer.Exit(1)\n        if message is None:\n            typer.echo(\"aborted: empty message\", err=True)\n            raise typer.Exit(1)\n    typer.echo(message.rstrip())\n",[14,860,861,866,878,882,889,893,905,909,919,923,936,940,945,950,955,959,963,971,986,991,995,999,1006,1042,1047,1061,1067,1090,1102,1133,1145,1157,1174,1184],{"__ignoreMap":79},[83,862,863],{"class":85,"line":86},[83,864,865],{"class":89},"# src\u002Fmytool\u002Fcli.py\n",[83,867,868,870,873,875],{"class":85,"line":93},[83,869,97],{"class":96},[83,871,872],{"class":107}," typing ",[83,874,121],{"class":96},[83,876,877],{"class":107}," Annotated, Optional\n",[83,879,880],{"class":85,"line":111},[83,881,115],{"emptyLinePlaceholder":114},[83,883,884,886],{"class":85,"line":118},[83,885,121],{"class":96},[83,887,888],{"class":107}," typer\n",[83,890,891],{"class":85,"line":127},[83,892,115],{"emptyLinePlaceholder":114},[83,894,895,897,900,902],{"class":85,"line":135},[83,896,97],{"class":96},[83,898,899],{"class":107}," mytool.editor ",[83,901,121],{"class":96},[83,903,904],{"class":107}," EditorError, edit_text\n",[83,906,907],{"class":85,"line":143},[83,908,115],{"emptyLinePlaceholder":114},[83,910,911,914,916],{"class":85,"line":151},[83,912,913],{"class":107},"app ",[83,915,314],{"class":96},[83,917,918],{"class":107}," typer.Typer()\n",[83,920,921],{"class":85,"line":159},[83,922,115],{"emptyLinePlaceholder":114},[83,924,925,928,930,933],{"class":85,"line":167},[83,926,927],{"class":100},"TEMPLATE",[83,929,445],{"class":96},[83,931,932],{"class":246}," \"\"\"",[83,934,935],{"class":100},"\\\n",[83,937,938],{"class":85,"line":180},[83,939,115],{"emptyLinePlaceholder":114},[83,941,942],{"class":85,"line":185},[83,943,944],{"class":246},"# Describe the release. Lines starting with '#' are ignored.\n",[83,946,947],{"class":85,"line":190},[83,948,949],{"class":246},"# An empty message aborts.\n",[83,951,952],{"class":85,"line":209},[83,953,954],{"class":246},"\"\"\"\n",[83,956,957],{"class":85,"line":215},[83,958,115],{"emptyLinePlaceholder":114},[83,960,961],{"class":85,"line":220},[83,962,115],{"emptyLinePlaceholder":114},[83,964,965,968],{"class":85,"line":225},[83,966,967],{"class":196},"@app.callback",[83,969,970],{"class":107},"()\n",[83,972,973,975,978,981,984],{"class":85,"line":243},[83,974,228],{"class":96},[83,976,977],{"class":196}," main",[83,979,980],{"class":107},"() -> ",[83,982,983],{"class":100},"None",[83,985,472],{"class":107},[83,987,988],{"class":85,"line":250},[83,989,990],{"class":246},"    \"\"\"Release tool.\"\"\"\n",[83,992,993],{"class":85,"line":280},[83,994,115],{"emptyLinePlaceholder":114},[83,996,997],{"class":85,"line":301},[83,998,115],{"emptyLinePlaceholder":114},[83,1000,1001,1004],{"class":85,"line":329},[83,1002,1003],{"class":196},"@app.command",[83,1005,970],{"class":107},[83,1007,1008,1010,1013,1016,1018,1021,1024,1026,1029,1032,1034,1036,1038,1040],{"class":85,"line":377},[83,1009,228],{"class":96},[83,1011,1012],{"class":196}," note",[83,1014,1015],{"class":107},"(message: Annotated[Optional[",[83,1017,237],{"class":100},[83,1019,1020],{"class":107},"], typer.Option(",[83,1022,1023],{"class":246},"\"--message\"",[83,1025,17],{"class":107},[83,1027,1028],{"class":246},"\"-m\"",[83,1030,1031],{"class":107},")] ",[83,1033,314],{"class":96},[83,1035,469],{"class":100},[83,1037,461],{"class":107},[83,1039,983],{"class":100},[83,1041,472],{"class":107},[83,1043,1044],{"class":85,"line":390},[83,1045,1046],{"class":246},"    \"\"\"Write a release note, in the editor unless --message is given.\"\"\"\n",[83,1048,1049,1051,1054,1057,1059],{"class":85,"line":398},[83,1050,501],{"class":96},[83,1052,1053],{"class":107}," message ",[83,1055,1056],{"class":96},"is",[83,1058,469],{"class":100},[83,1060,472],{"class":107},[83,1062,1063,1065],{"class":85,"line":412},[83,1064,628],{"class":96},[83,1066,472],{"class":107},[83,1068,1069,1072,1074,1077,1079,1081,1083,1085,1088],{"class":85,"line":417},[83,1070,1071],{"class":107},"            message ",[83,1073,314],{"class":96},[83,1075,1076],{"class":107}," edit_text(",[83,1078,927],{"class":100},[83,1080,17],{"class":107},[83,1082,597],{"class":310},[83,1084,314],{"class":96},[83,1086,1087],{"class":246},"\".md\"",[83,1089,326],{"class":107},[83,1091,1092,1094,1097,1099],{"class":85,"line":422},[83,1093,657],{"class":96},[83,1095,1096],{"class":107}," EditorError ",[83,1098,568],{"class":96},[83,1100,1101],{"class":107}," exc:\n",[83,1103,1104,1107,1109,1112,1114,1117,1119,1121,1123,1126,1128,1131],{"class":85,"line":475},[83,1105,1106],{"class":107},"            typer.echo(",[83,1108,673],{"class":96},[83,1110,1111],{"class":246},"\"error: ",[83,1113,594],{"class":100},[83,1115,1116],{"class":107},"exc",[83,1118,600],{"class":100},[83,1120,603],{"class":246},[83,1122,17],{"class":107},[83,1124,1125],{"class":310},"err",[83,1127,314],{"class":96},[83,1129,1130],{"class":100},"True",[83,1132,326],{"class":107},[83,1134,1135,1137,1140,1143],{"class":85,"line":481},[83,1136,668],{"class":96},[83,1138,1139],{"class":107}," typer.Exit(",[83,1141,1142],{"class":100},"1",[83,1144,326],{"class":107},[83,1146,1147,1149,1151,1153,1155],{"class":85,"line":486},[83,1148,283],{"class":96},[83,1150,1053],{"class":107},[83,1152,1056],{"class":96},[83,1154,469],{"class":100},[83,1156,472],{"class":107},[83,1158,1159,1161,1164,1166,1168,1170,1172],{"class":85,"line":492},[83,1160,1106],{"class":107},[83,1162,1163],{"class":246},"\"aborted: empty message\"",[83,1165,17],{"class":107},[83,1167,1125],{"class":310},[83,1169,314],{"class":96},[83,1171,1130],{"class":100},[83,1173,326],{"class":107},[83,1175,1176,1178,1180,1182],{"class":85,"line":498},[83,1177,668],{"class":96},[83,1179,1139],{"class":107},[83,1181,1142],{"class":100},[83,1183,326],{"class":107},[83,1185,1186],{"class":85,"line":524},[83,1187,1188],{"class":107},"    typer.echo(message.rstrip())\n",[1190,1191,1193],"h3",{"id":1192},"finding-the-editor","Finding the editor",[10,1195,1196,1197,1200,1201,1204,1205,1207,1208,1211,1212,1215,1216,1219,1220,1223,1224,1227],{},"Unix convention distinguishes ",[14,1198,1199],{},"$VISUAL"," (a full-screen editor) from ",[14,1202,1203],{},"$EDITOR"," (historically a line editor for dumb terminals); in practice both name the same program, and tools check ",[14,1206,1199],{}," first. A tool-specific variable on top, like git’s ",[14,1209,1210],{},"GIT_EDITOR",", lets users choose a different editor for your tool alone, and makes testing easy. If nothing is set, fall back to something that exists — ",[14,1213,1214],{},"nano"," is friendlier for newcomers than ",[14,1217,1218],{},"vi",", which famously traps people who do not know ",[14,1221,1222],{},":q","; ",[14,1225,1226],{},"notepad"," on Windows.",[10,1229,1230,1231,17,1234,17,1237,1240,1241,1244,1245,1248,1249,1252,1253,1256],{},"Editor variables often contain arguments: ",[14,1232,1233],{},"code --wait",[14,1235,1236],{},"subl -n -w",[14,1238,1239],{},"emacsclient -t",". ",[14,1242,1243],{},"shlex.split"," turns them into an argument list the way a shell would, so quoting works (",[14,1246,1247],{},"\"\u002Fopt\u002FMy Editor\u002Fbin\u002Fedit\" --wait","). Running the result without ",[14,1250,1251],{},"shell=True"," keeps the file path from being interpreted by a shell, which matters because the path is not under the user’s full control. On Windows, ",[14,1254,1255],{},"posix=False"," keeps backslashes in paths intact.",[1190,1258,1260],{"id":1259},"the-temporary-file","The temporary file",[10,1262,1263,1264,1268,1269,1272,1273,1277,1278,1281,1282,1285,1286,1289],{},"A private temporary ",[1265,1266,1267],"em",{},"directory"," holds the file, so the name is predictable for the editor and nothing collides between concurrent runs; it disappears with everything in it when the ",[14,1270,1271],{},"with"," block ends — see ",[34,1274,1276],{"href":1275},"\u002Fcli-runtime-systems-integration\u002Ffilesystem-paths-and-atomic-writes\u002Fsafe-temporary-files-and-directories\u002F","safe temporary files and directories",". The suffix is chosen by the caller: ",[14,1279,1280],{},".md"," for notes, ",[14,1283,1284],{},".yaml"," for manifests, ",[14,1287,1288],{},".toml"," for configuration. Editors pick syntax highlighting, indentation rules and linters from it, which makes structured input noticeably less error-prone.",[1190,1291,1293],{"id":1292},"comments-empty-buffers-and-failures","Comments, empty buffers and failures",[10,1295,1296,1297,1299,1300,1302],{},"Comment lines carry instructions without becoming part of the answer. The helper strips lines starting with the comment marker, then trims whitespace. Two outcomes mean “the user changed their mind”: a buffer identical to the template (they quit without saving) and a buffer that is empty after stripping comments (they deleted everything). Both return ",[14,1298,983],{},", and the command aborts with a clear message and a non-zero exit code, exactly like ",[14,1301,16],{}," with an empty message.",[10,1304,1305,1306,1309],{},"A non-zero exit from the editor is different: in vim, ",[14,1307,1308],{},":cq"," exits with an error precisely to say “abort”. Treat it as an explicit cancel, and never use a partially written file.",[63,1311],{"name":1312},"editor-terminal",[40,1314,1316],{"id":1315},"graphical-editors-and-waiting","Graphical editors and waiting",[10,1318,1319,1320,1323,1324,1327,1328,1331,1332,17,1334,17,1337,17,1340,17,1343,1346],{},"Terminal editors block until the user quits, so ",[14,1321,1322],{},"subprocess.run"," returns at the right moment. Many graphical editors do not: ",[14,1325,1326],{},"code path"," opens a window in an already-running instance and returns immediately, and your CLI reads the unchanged template and aborts. The fix is the editor’s ",[1265,1329,1330],{},"wait"," flag — ",[14,1333,1233],{},[14,1335,1336],{},"subl -w",[14,1338,1339],{},"zed --wait",[14,1341,1342],{},"gedit -s",[14,1344,1345],{},"mate -w"," — set in the variable itself. Mention this in your documentation, and consider detecting the symptom: if the editor exits within a second and the file is unchanged, print a hint that the editor may need a wait flag.",[40,1348,1350],{"id":1349},"ux-considerations","UX considerations",[45,1352,1353,1369,1375,1389,1395],{},[48,1354,1355,1359,1360,17,1363,1366,1367,38],{},[1356,1357,1358],"strong",{},"Always offer a non-interactive path."," ",[14,1361,1362],{},"--message",[14,1364,1365],{},"--file"," or stdin must work without an editor, for scripts and CI. The helper refuses to start without a terminal and points at ",[14,1368,1362],{},[48,1370,1371,1374],{},[1356,1372,1373],{},"Keep the template short and actionable."," Two or three comment lines: what to write, what is ignored, how to abort.",[48,1376,1377,1380,1381,1384,1385,1388],{},[1356,1378,1379],{},"Preserve work on failure."," If the command fails ",[1265,1382,1383],{},"after"," editing (a network error while submitting), save the text somewhere and print the path, so the user does not have to type it again — git keeps ",[14,1386,1387],{},".git\u002FCOMMIT_EDITMSG"," for the same reason.",[48,1390,1391,1394],{},[1356,1392,1393],{},"Pre-fill sensibly."," When editing an existing object, put its current value in the buffer; when creating one, include useful defaults as comments.",[48,1396,1397,1400],{},[1356,1398,1399],{},"Do not hold locks or spinners while the editor runs."," The editor owns the terminal; stop Rich live displays and progress bars first.",[63,1402],{"name":1403},"editor-vars",[40,1405,1407],{"id":1406},"testing-the-behaviour","Testing the behaviour",[10,1409,1410,1411,1414],{},"A fake editor is a short Python script set as ",[14,1412,1413],{},"$MYTOOL_EDITOR",": it receives the path just like a real editor, edits the file and exits with a chosen status. That exercises the whole helper — command resolution, subprocess, reading back, comment stripping — with no terminal:",[74,1416,1418],{"className":76,"code":1417,"language":78,"meta":79,"style":79},"# tests\u002Ftest_editor.py\nimport sys\n\nimport pytest\nfrom typer.testing import CliRunner\n\nfrom mytool import editor\nfrom mytool.cli import app\nfrom mytool.editor import EditorError, editor_command\n\nrunner = CliRunner()\n\n\ndef fake_editor(tmp_path, monkeypatch, body: str, exit_code: int = 0) -> None:\n    script = tmp_path \u002F \"fake_editor.py\"\n    script.write_text(\n        \"import pathlib, sys\\n\"\n        \"p = pathlib.Path(sys.argv[1])\\n\"\n        f\"p.write_text({body!r} + p.read_text())\\n\"\n        f\"sys.exit({exit_code})\\n\")\n    monkeypatch.setenv(\"MYTOOL_EDITOR\", f\"{sys.executable} {script}\")\n\n\ndef test_editor_precedence(monkeypatch):\n    monkeypatch.delenv(\"MYTOOL_EDITOR\", raising=False)\n    monkeypatch.setenv(\"EDITOR\", \"nano\")\n    monkeypatch.setenv(\"VISUAL\", \"code --wait\")\n    assert editor_command() == [\"code\", \"--wait\"]\n\n\ndef test_message_from_editor_strips_comments(tmp_path, monkeypatch):\n    fake_editor(tmp_path, monkeypatch, \"Fixed the frobnicator.\\n\")\n    result = runner.invoke(app, [\"note\"])\n    assert result.exit_code == 0\n    assert result.stdout == \"Fixed the frobnicator.\\n\"\n\n\ndef test_unchanged_buffer_aborts(tmp_path, monkeypatch):\n    fake_editor(tmp_path, monkeypatch, \"\")\n    result = runner.invoke(app, [\"note\"])\n    assert result.exit_code == 1 and \"aborted\" in result.stderr\n\n\ndef test_failing_editor_saves_nothing(tmp_path, monkeypatch):\n    fake_editor(tmp_path, monkeypatch, \"half-written\", exit_code=1)\n    result = runner.invoke(app, [\"note\"])\n    assert result.exit_code == 1 and \"status 1\" in result.stderr\n\n\ndef test_missing_editor_is_reported(monkeypatch):\n    monkeypatch.setenv(\"MYTOOL_EDITOR\", \"no-such-editor-xyz\")\n    with pytest.raises(EditorError, match=\"not found\"):\n        editor.edit_text(\"x\")\n\n\ndef test_no_terminal_needs_message(monkeypatch):\n    monkeypatch.delenv(\"MYTOOL_EDITOR\", raising=False)\n    result = runner.invoke(app, [\"note\"])\n    assert result.exit_code == 1 and \"--message\" in result.stderr\n    assert runner.invoke(app, [\"note\", \"-m\", \"done\"]).stdout == \"done\\n\"\n",[14,1419,1420,1425,1431,1435,1442,1454,1458,1470,1482,1493,1497,1507,1511,1515,1543,1558,1563,1573,1582,1606,1629,1661,1665,1669,1679,1698,1710,1723,1746,1750,1754,1764,1778,1794,1806,1822,1826,1830,1839,1847,1859,1881,1885,1889,1898,1915,1927,1946,1950,1954,1963,1977,1995,2006,2011,2016,2026,2043,2056,2076],{"__ignoreMap":79},[83,1421,1422],{"class":85,"line":86},[83,1423,1424],{"class":89},"# tests\u002Ftest_editor.py\n",[83,1426,1427,1429],{"class":85,"line":93},[83,1428,121],{"class":96},[83,1430,156],{"class":107},[83,1432,1433],{"class":85,"line":111},[83,1434,115],{"emptyLinePlaceholder":114},[83,1436,1437,1439],{"class":85,"line":118},[83,1438,121],{"class":96},[83,1440,1441],{"class":107}," pytest\n",[83,1443,1444,1446,1449,1451],{"class":85,"line":127},[83,1445,97],{"class":96},[83,1447,1448],{"class":107}," typer.testing ",[83,1450,121],{"class":96},[83,1452,1453],{"class":107}," CliRunner\n",[83,1455,1456],{"class":85,"line":135},[83,1457,115],{"emptyLinePlaceholder":114},[83,1459,1460,1462,1465,1467],{"class":85,"line":143},[83,1461,97],{"class":96},[83,1463,1464],{"class":107}," mytool ",[83,1466,121],{"class":96},[83,1468,1469],{"class":107}," editor\n",[83,1471,1472,1474,1477,1479],{"class":85,"line":151},[83,1473,97],{"class":96},[83,1475,1476],{"class":107}," mytool.cli ",[83,1478,121],{"class":96},[83,1480,1481],{"class":107}," app\n",[83,1483,1484,1486,1488,1490],{"class":85,"line":159},[83,1485,97],{"class":96},[83,1487,899],{"class":107},[83,1489,121],{"class":96},[83,1491,1492],{"class":107}," EditorError, editor_command\n",[83,1494,1495],{"class":85,"line":167},[83,1496,115],{"emptyLinePlaceholder":114},[83,1498,1499,1502,1504],{"class":85,"line":180},[83,1500,1501],{"class":107},"runner ",[83,1503,314],{"class":96},[83,1505,1506],{"class":107}," CliRunner()\n",[83,1508,1509],{"class":85,"line":185},[83,1510,115],{"emptyLinePlaceholder":114},[83,1512,1513],{"class":85,"line":190},[83,1514,115],{"emptyLinePlaceholder":114},[83,1516,1517,1519,1522,1525,1527,1530,1533,1535,1537,1539,1541],{"class":85,"line":209},[83,1518,228],{"class":96},[83,1520,1521],{"class":196}," fake_editor",[83,1523,1524],{"class":107},"(tmp_path, monkeypatch, body: ",[83,1526,237],{"class":100},[83,1528,1529],{"class":107},", exit_code: ",[83,1531,1532],{"class":100},"int",[83,1534,445],{"class":96},[83,1536,713],{"class":100},[83,1538,461],{"class":107},[83,1540,983],{"class":100},[83,1542,472],{"class":107},[83,1544,1545,1548,1550,1553,1555],{"class":85,"line":215},[83,1546,1547],{"class":107},"    script ",[83,1549,314],{"class":96},[83,1551,1552],{"class":107}," tmp_path ",[83,1554,585],{"class":96},[83,1556,1557],{"class":246}," \"fake_editor.py\"\n",[83,1559,1560],{"class":85,"line":220},[83,1561,1562],{"class":107},"    script.write_text(\n",[83,1564,1565,1568,1570],{"class":85,"line":225},[83,1566,1567],{"class":246},"        \"import pathlib, sys",[83,1569,822],{"class":100},[83,1571,1572],{"class":246},"\"\n",[83,1574,1575,1578,1580],{"class":85,"line":243},[83,1576,1577],{"class":246},"        \"p = pathlib.Path(sys.argv[1])",[83,1579,822],{"class":100},[83,1581,1572],{"class":246},[83,1583,1584,1587,1590,1592,1595,1597,1599,1602,1604],{"class":85,"line":250},[83,1585,1586],{"class":96},"        f",[83,1588,1589],{"class":246},"\"p.write_text(",[83,1591,594],{"class":100},[83,1593,1594],{"class":107},"body",[83,1596,689],{"class":96},[83,1598,600],{"class":100},[83,1600,1601],{"class":246}," + p.read_text())",[83,1603,822],{"class":100},[83,1605,1572],{"class":246},[83,1607,1608,1610,1613,1615,1618,1620,1623,1625,1627],{"class":85,"line":280},[83,1609,1586],{"class":96},[83,1611,1612],{"class":246},"\"sys.exit(",[83,1614,594],{"class":100},[83,1616,1617],{"class":107},"exit_code",[83,1619,600],{"class":100},[83,1621,1622],{"class":246},")",[83,1624,822],{"class":100},[83,1626,603],{"class":246},[83,1628,326],{"class":107},[83,1630,1631,1634,1636,1638,1640,1642,1644,1647,1649,1652,1655,1657,1659],{"class":85,"line":301},[83,1632,1633],{"class":107},"    monkeypatch.setenv(",[83,1635,265],{"class":246},[83,1637,17],{"class":107},[83,1639,673],{"class":96},[83,1641,603],{"class":246},[83,1643,594],{"class":100},[83,1645,1646],{"class":107},"sys.executable",[83,1648,600],{"class":100},[83,1650,1651],{"class":100}," {",[83,1653,1654],{"class":107},"script",[83,1656,600],{"class":100},[83,1658,603],{"class":246},[83,1660,326],{"class":107},[83,1662,1663],{"class":85,"line":329},[83,1664,115],{"emptyLinePlaceholder":114},[83,1666,1667],{"class":85,"line":377},[83,1668,115],{"emptyLinePlaceholder":114},[83,1670,1671,1673,1676],{"class":85,"line":390},[83,1672,228],{"class":96},[83,1674,1675],{"class":196}," test_editor_precedence",[83,1677,1678],{"class":107},"(monkeypatch):\n",[83,1680,1681,1684,1686,1688,1691,1693,1696],{"class":85,"line":398},[83,1682,1683],{"class":107},"    monkeypatch.delenv(",[83,1685,265],{"class":246},[83,1687,17],{"class":107},[83,1689,1690],{"class":310},"raising",[83,1692,314],{"class":96},[83,1694,1695],{"class":100},"False",[83,1697,326],{"class":107},[83,1699,1700,1702,1704,1706,1708],{"class":85,"line":412},[83,1701,1633],{"class":107},[83,1703,275],{"class":246},[83,1705,17],{"class":107},[83,1707,365],{"class":246},[83,1709,326],{"class":107},[83,1711,1712,1714,1716,1718,1721],{"class":85,"line":417},[83,1713,1633],{"class":107},[83,1715,270],{"class":246},[83,1717,17],{"class":107},[83,1719,1720],{"class":246},"\"code --wait\"",[83,1722,326],{"class":107},[83,1724,1725,1728,1731,1733,1735,1738,1740,1743],{"class":85,"line":422},[83,1726,1727],{"class":96},"    assert",[83,1729,1730],{"class":107}," editor_command() ",[83,1732,354],{"class":96},[83,1734,362],{"class":107},[83,1736,1737],{"class":246},"\"code\"",[83,1739,17],{"class":107},[83,1741,1742],{"class":246},"\"--wait\"",[83,1744,1745],{"class":107},"]\n",[83,1747,1748],{"class":85,"line":475},[83,1749,115],{"emptyLinePlaceholder":114},[83,1751,1752],{"class":85,"line":481},[83,1753,115],{"emptyLinePlaceholder":114},[83,1755,1756,1758,1761],{"class":85,"line":486},[83,1757,228],{"class":96},[83,1759,1760],{"class":196}," test_message_from_editor_strips_comments",[83,1762,1763],{"class":107},"(tmp_path, monkeypatch):\n",[83,1765,1766,1769,1772,1774,1776],{"class":85,"line":492},[83,1767,1768],{"class":107},"    fake_editor(tmp_path, monkeypatch, ",[83,1770,1771],{"class":246},"\"Fixed the frobnicator.",[83,1773,822],{"class":100},[83,1775,603],{"class":246},[83,1777,326],{"class":107},[83,1779,1780,1783,1785,1788,1791],{"class":85,"line":498},[83,1781,1782],{"class":107},"    result ",[83,1784,314],{"class":96},[83,1786,1787],{"class":107}," runner.invoke(app, [",[83,1789,1790],{"class":246},"\"note\"",[83,1792,1793],{"class":107},"])\n",[83,1795,1796,1798,1801,1803],{"class":85,"line":524},[83,1797,1727],{"class":96},[83,1799,1800],{"class":107}," result.exit_code ",[83,1802,354],{"class":96},[83,1804,1805],{"class":100}," 0\n",[83,1807,1808,1810,1813,1815,1818,1820],{"class":85,"line":537},[83,1809,1727],{"class":96},[83,1811,1812],{"class":107}," result.stdout ",[83,1814,354],{"class":96},[83,1816,1817],{"class":246}," \"Fixed the frobnicator.",[83,1819,822],{"class":100},[83,1821,1572],{"class":246},[83,1823,1824],{"class":85,"line":548},[83,1825,115],{"emptyLinePlaceholder":114},[83,1827,1828],{"class":85,"line":574},[83,1829,115],{"emptyLinePlaceholder":114},[83,1831,1832,1834,1837],{"class":85,"line":609},[83,1833,228],{"class":96},[83,1835,1836],{"class":196}," test_unchanged_buffer_aborts",[83,1838,1763],{"class":107},[83,1840,1841,1843,1845],{"class":85,"line":625},[83,1842,1768],{"class":107},[83,1844,295],{"class":246},[83,1846,326],{"class":107},[83,1848,1849,1851,1853,1855,1857],{"class":85,"line":633},[83,1850,1782],{"class":107},[83,1852,314],{"class":96},[83,1854,1787],{"class":107},[83,1856,1790],{"class":246},[83,1858,1793],{"class":107},[83,1860,1861,1863,1865,1867,1870,1873,1876,1878],{"class":85,"line":654},[83,1862,1727],{"class":96},[83,1864,1800],{"class":107},[83,1866,354],{"class":96},[83,1868,1869],{"class":100}," 1",[83,1871,1872],{"class":96}," and",[83,1874,1875],{"class":246}," \"aborted\"",[83,1877,518],{"class":96},[83,1879,1880],{"class":107}," result.stderr\n",[83,1882,1883],{"class":85,"line":665},[83,1884,115],{"emptyLinePlaceholder":114},[83,1886,1887],{"class":85,"line":703},[83,1888,115],{"emptyLinePlaceholder":114},[83,1890,1891,1893,1896],{"class":85,"line":718},[83,1892,228],{"class":96},[83,1894,1895],{"class":196}," test_failing_editor_saves_nothing",[83,1897,1763],{"class":107},[83,1899,1900,1902,1905,1907,1909,1911,1913],{"class":85,"line":742},[83,1901,1768],{"class":107},[83,1903,1904],{"class":246},"\"half-written\"",[83,1906,17],{"class":107},[83,1908,1617],{"class":310},[83,1910,314],{"class":96},[83,1912,1142],{"class":100},[83,1914,326],{"class":107},[83,1916,1917,1919,1921,1923,1925],{"class":85,"line":761},[83,1918,1782],{"class":107},[83,1920,314],{"class":96},[83,1922,1787],{"class":107},[83,1924,1790],{"class":246},[83,1926,1793],{"class":107},[83,1928,1929,1931,1933,1935,1937,1939,1942,1944],{"class":85,"line":774},[83,1930,1727],{"class":96},[83,1932,1800],{"class":107},[83,1934,354],{"class":96},[83,1936,1869],{"class":100},[83,1938,1872],{"class":96},[83,1940,1941],{"class":246}," \"status 1\"",[83,1943,518],{"class":96},[83,1945,1880],{"class":107},[83,1947,1948],{"class":85,"line":782},[83,1949,115],{"emptyLinePlaceholder":114},[83,1951,1952],{"class":85,"line":811},[83,1953,115],{"emptyLinePlaceholder":114},[83,1955,1956,1958,1961],{"class":85,"line":830},[83,1957,228],{"class":96},[83,1959,1960],{"class":196}," test_missing_editor_is_reported",[83,1962,1678],{"class":107},[83,1964,1966,1968,1970,1972,1975],{"class":85,"line":1965},51,[83,1967,1633],{"class":107},[83,1969,265],{"class":246},[83,1971,17],{"class":107},[83,1973,1974],{"class":246},"\"no-such-editor-xyz\"",[83,1976,326],{"class":107},[83,1978,1980,1982,1985,1988,1990,1993],{"class":85,"line":1979},52,[83,1981,551],{"class":96},[83,1983,1984],{"class":107}," pytest.raises(EditorError, ",[83,1986,1987],{"class":310},"match",[83,1989,314],{"class":96},[83,1991,1992],{"class":246},"\"not found\"",[83,1994,206],{"class":107},[83,1996,1998,2001,2004],{"class":85,"line":1997},53,[83,1999,2000],{"class":107},"        editor.edit_text(",[83,2002,2003],{"class":246},"\"x\"",[83,2005,326],{"class":107},[83,2007,2009],{"class":85,"line":2008},54,[83,2010,115],{"emptyLinePlaceholder":114},[83,2012,2014],{"class":85,"line":2013},55,[83,2015,115],{"emptyLinePlaceholder":114},[83,2017,2019,2021,2024],{"class":85,"line":2018},56,[83,2020,228],{"class":96},[83,2022,2023],{"class":196}," test_no_terminal_needs_message",[83,2025,1678],{"class":107},[83,2027,2029,2031,2033,2035,2037,2039,2041],{"class":85,"line":2028},57,[83,2030,1683],{"class":107},[83,2032,265],{"class":246},[83,2034,17],{"class":107},[83,2036,1690],{"class":310},[83,2038,314],{"class":96},[83,2040,1695],{"class":100},[83,2042,326],{"class":107},[83,2044,2046,2048,2050,2052,2054],{"class":85,"line":2045},58,[83,2047,1782],{"class":107},[83,2049,314],{"class":96},[83,2051,1787],{"class":107},[83,2053,1790],{"class":246},[83,2055,1793],{"class":107},[83,2057,2059,2061,2063,2065,2067,2069,2072,2074],{"class":85,"line":2058},59,[83,2060,1727],{"class":96},[83,2062,1800],{"class":107},[83,2064,354],{"class":96},[83,2066,1869],{"class":100},[83,2068,1872],{"class":96},[83,2070,2071],{"class":246}," \"--message\"",[83,2073,518],{"class":96},[83,2075,1880],{"class":107},[83,2077,2079,2081,2083,2085,2087,2089,2091,2094,2097,2099,2102,2104],{"class":85,"line":2078},60,[83,2080,1727],{"class":96},[83,2082,1787],{"class":107},[83,2084,1790],{"class":246},[83,2086,17],{"class":107},[83,2088,1028],{"class":246},[83,2090,17],{"class":107},[83,2092,2093],{"class":246},"\"done\"",[83,2095,2096],{"class":107},"]).stdout ",[83,2098,354],{"class":96},[83,2100,2101],{"class":246}," \"done",[83,2103,822],{"class":100},[83,2105,1572],{"class":246},[10,2107,2108,2109,2112,2113,2115],{},"The fake editor prepends text, so the template’s comment lines remain and the test proves they are removed. Setting ",[14,2110,2111],{},"MYTOOL_EDITOR"," also lifts the “no terminal” check — the variable is an explicit statement that an editor is available — while the last test confirms that, without it, the runner’s non-terminal stdin produces the helpful error and ",[14,2114,1362],{}," still works.",[40,2117,2119],{"id":2118},"conclusion","Conclusion",[10,2121,2122,2123,17,2125,2127,2128,2131,2132,2134],{},"Launching the user’s editor gives long-form input the tooling people already use. Resolve the editor from a tool-specific variable, then ",[14,2124,1199],{},[14,2126,1203],{}," and a friendly default; split it with ",[14,2129,2130],{},"shlex","; write a template with commented instructions to a private temporary directory with a meaningful suffix; run the editor without a shell and wait; strip comments; abort on an unchanged or empty buffer and on a failing editor; refuse to run without a terminal while offering ",[14,2133,1362],{},"; and test with a fake editor script.",[40,2136,2138],{"id":2137},"frequently-asked-questions","Frequently asked questions",[1190,2140,2142,2143,2146],{"id":2141},"why-not-use-clickedit","Why not use ",[14,2144,2145],{},"click.edit()","?",[10,2148,2149,2151],{},[14,2150,2145],{}," implements much of this — editor lookup, temporary file, extension — and is a fine choice for Click apps. A small helper of your own adds comment stripping, the abort rules and a tool-specific variable, and is easier to test; with Typer you would otherwise reach into its vendored copy of Click.",[1190,2153,2155],{"id":2154},"what-if-the-users-editor-is-a-gui-app-over-ssh","What if the user’s editor is a GUI app over SSH?",[10,2157,2158,2160,2161,24,2164,2167],{},[14,2159,1199],{}," might name a graphical editor that cannot start without a display. Users typically set ",[14,2162,2163],{},"VISUAL",[14,2165,2166],{},"EDITOR"," differently per machine; your CLI just runs what they configured and reports the error if it fails to start.",[1190,2169,2171],{"id":2170},"how-should-windows-users-configure-an-editor","How should Windows users configure an editor?",[10,2173,2174,2175,2177,2178,2181],{},"Set ",[14,2176,2166],{}," to the editor’s command, quoting paths with spaces: ",[14,2179,2180],{},"setx EDITOR \"code --wait\"",". Notepad is always present as a fallback and blocks until closed.",[1190,2183,2185],{"id":2184},"can-the-edited-content-be-validated-before-accepting-it","Can the edited content be validated before accepting it?",[10,2187,2188,2189,2191,2192,38],{},"Yes — and you should for structured input. Parse it, and on error reopen the editor with the error as a comment at the top, as ",[14,2190,23],{}," does. The loop is shown in ",[34,2193,2195],{"href":2194},"\u002Fadvanced-input-parsing-user-experience\u002Fhandling-configuration-files-env-vars\u002Fwriting-a-config-init-and-edit-command\u002F","writing a config init and edit command",[1190,2197,2199],{"id":2198},"is-it-safe-to-put-secrets-in-the-edited-file","Is it safe to put secrets in the edited file?",[10,2201,2202,2203,38],{},"Avoid it. The text sits on disk while the editor runs and may end up in editor swap and backup files. For secrets, prompt without echo instead, as in ",[34,2204,2206],{"href":2205},"\u002Fcli-runtime-systems-integration\u002Fsecrets-and-credentials-in-python-clis\u002Fprompting-for-passwords-securely\u002F","prompting for passwords securely",[40,2208,2210],{"id":2209},"related","Related",[45,2212,2213,2219,2224,2230,2235],{},[48,2214,2215,2216],{},"Up: ",[34,2217,2218],{"href":36},"Running subprocesses from Python CLIs",[48,2220,2221],{},[34,2222,2223],{"href":53},"Calling external commands safely with subprocess",[48,2225,2226],{},[34,2227,2229],{"href":2228},"\u002Fcli-runtime-systems-integration\u002Frunning-subprocesses-from-python-clis\u002Favoiding-shell-injection-in-python-clis\u002F","Avoiding shell injection in Python CLIs",[48,2231,2232],{},[34,2233,2234],{"href":2194},"Writing a config init and edit command",[48,2236,2237],{},[34,2238,2240],{"href":2239},"\u002Fcli-runtime-systems-integration\u002Frunning-subprocesses-from-python-clis\u002Fpiping-between-subprocesses-in-python\u002F","Piping between subprocesses in Python",[2242,2243,2244],"style",{},"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 .sj4cs, html code.shiki .sj4cs{--shiki-default:#005CC5;--shiki-dark:#79B8FF}html pre.shiki code .sVt8B, html code.shiki .sVt8B{--shiki-default:#24292E;--shiki-dark:#E1E4E8}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 .s4XuR, html code.shiki .s4XuR{--shiki-default:#E36209;--shiki-dark:#FFAB70}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);}",{"title":79,"searchDepth":93,"depth":93,"links":2246},[2247,2248,2249,2254,2255,2256,2257,2258,2266],{"id":42,"depth":93,"text":43},{"id":60,"depth":93,"text":61},{"id":71,"depth":93,"text":72,"children":2250},[2251,2252,2253],{"id":1192,"depth":111,"text":1193},{"id":1259,"depth":111,"text":1260},{"id":1292,"depth":111,"text":1293},{"id":1315,"depth":93,"text":1316},{"id":1349,"depth":93,"text":1350},{"id":1406,"depth":93,"text":1407},{"id":2118,"depth":93,"text":2119},{"id":2137,"depth":93,"text":2138,"children":2259},[2260,2262,2263,2264,2265],{"id":2141,"depth":111,"text":2261},"Why not use click.edit()?",{"id":2154,"depth":111,"text":2155},{"id":2170,"depth":111,"text":2171},{"id":2184,"depth":111,"text":2185},{"id":2198,"depth":111,"text":2199},{"id":2209,"depth":93,"text":2210},"2026-10-02","Open $VISUAL or $EDITOR from a Python CLI the way git commit does: editor lookup, temp files with a suffix, comment lines, aborting on empty input, and tests.","intermediate",false,"md",{},"\u002Fcli-runtime-systems-integration\u002Frunning-subprocesses-from-python-clis\u002Flaunching-the-users-editor-from-a-cli",{"title":5,"description":2268},"cli-runtime-systems-integration\u002Frunning-subprocesses-from-python-clis\u002Flaunching-the-users-editor-from-a-cli\u002Findex",[2277,2278,2279,2280,2281],"subprocess","editor","ux","tempfile","testing","Pt_0adJDZ4ZBwO58jdsZKSxPyPJLffGe-HJLhX7vOqA",[2284,2287,2290,2293,2296,2299,2302,2305,2308,2311,2314,2317,2320,2323,2326,2329,2332,2335,2338,2341,2344,2347,2350,2353,2356,2359,2362,2365,2368,2371,2374,2377,2380,2383,2386,2389,2392,2395,2398,2401,2404,2407,2410,2413,2416,2419,2422,2425,2428,2431,2434,2437,2440,2443,2446,2449,2452,2455,2458,2461,2464,2467,2470,2473,2476,2479,2482,2485,2488,2491,2494,2497,2500,2503,2506,2509,2512,2515,2518,2521,2524,2527,2530,2533,2536,2539,2542,2545,2548,2551,2554,2557,2560,2563,2566,2569,2572,2575,2578,2581,2584,2587,2590,2593,2596,2599,2602,2605,2608,2611,2614,2617,2620,2623,2626,2629,2632,2635,2638,2641,2644,2647,2650,2653,2654,2657,2660,2663,2666,2669,2672,2675,2678,2681,2684,2687,2690,2693,2696,2699,2701,2704,2707,2710,2713,2716,2719,2722,2725,2728,2731,2734,2737,2740,2743,2746,2749,2752,2755,2758,2761,2764,2767,2770,2773,2776,2779,2782,2785,2788,2791,2794,2797,2800,2803,2806,2809,2812,2815,2818,2821,2824,2827,2830,2833,2836,2839,2842,2845,2848,2851,2854,2857,2860,2863,2866,2869,2872,2875,2878,2881,2884,2887,2890,2893,2896,2899,2902,2905,2908,2911,2914,2917,2920,2923,2926,2929,2932,2935,2938,2941,2944,2947,2950,2953,2956,2959,2962,2965,2968,2971,2974,2977,2980,2983,2986,2989,2992,2995,2998,3001,3004,3007,3010,3013,3016,3019,3022,3025,3028,3031,3034,3037,3040,3043,3046,3049,3052,3055,3058,3061,3064,3067,3070,3073,3076,3079,3082,3085,3088,3091,3094,3097,3100,3103,3106,3109,3112,3115,3118,3121,3124],{"path":2285,"title":2286},"\u002Fabout","About Python CLI Toolcraft",{"path":2288,"title":2289},"\u002Fadvanced-input-parsing-user-experience\u002Fadvanced-argument-validation-strategies","Advanced Argument Validation Strategies",{"path":2291,"title":2292},"\u002Fadvanced-input-parsing-user-experience\u002Fadvanced-argument-validation-strategies\u002Fparsing-nested-json-arguments-in-python-clis","Parsing Nested JSON Args in Python CLIs",{"path":2294,"title":2295},"\u002Fadvanced-input-parsing-user-experience\u002Fadvanced-argument-validation-strategies\u002Fvalidating-dates-and-durations-in-cli-arguments","Validating Dates and Durations in Python CLI Arguments",{"path":2297,"title":2298},"\u002Fadvanced-input-parsing-user-experience\u002Fadvanced-argument-validation-strategies\u002Fvalidating-dependent-and-conflicting-options","Validating Dependent and Conflicting CLI Options",{"path":2300,"title":2301},"\u002Fadvanced-input-parsing-user-experience\u002Fadvanced-argument-validation-strategies\u002Fvalidating-file-and-directory-paths-in-clis","Validating File and Directory Paths in CLIs",{"path":2303,"title":2304},"\u002Fadvanced-input-parsing-user-experience\u002Fadvanced-argument-validation-strategies\u002Fvalidating-urls-hosts-and-ports","Validating URLs, Hosts and Ports in Python CLI Arguments",{"path":2306,"title":2307},"\u002Fadvanced-input-parsing-user-experience\u002Fadvanced-argument-validation-strategies\u002Fwriting-custom-click-parameter-types","Writing Custom Click Parameter Types",{"path":2309,"title":2310},"\u002Fadvanced-input-parsing-user-experience\u002Fbuilding-terminal-uis-with-textual\u002Fbrowsing-records-with-a-textual-datatable","Browsing Records with a Textual DataTable Picker",{"path":2312,"title":2313},"\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":2315,"title":2316},"\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":2318,"title":2319},"\u002Fadvanced-input-parsing-user-experience\u002Fbuilding-terminal-uis-with-textual","Building Terminal UIs with Textual for Python CLIs",{"path":2321,"title":2322},"\u002Fadvanced-input-parsing-user-experience\u002Fbuilding-terminal-uis-with-textual\u002Frunning-background-work-in-textual-with-workers","Running Background Work in Textual with Workers",{"path":2324,"title":2325},"\u002Fadvanced-input-parsing-user-experience\u002Fbuilding-terminal-uis-with-textual\u002Fstyling-textual-apps-with-tcss","Styling Textual Apps with TCSS",{"path":2327,"title":2328},"\u002Fadvanced-input-parsing-user-experience\u002Fbuilding-terminal-uis-with-textual\u002Ftesting-textual-apps-with-pilot","Testing Textual Apps with Pilot",{"path":2330,"title":2331},"\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":2333,"title":2334},"\u002Fadvanced-input-parsing-user-experience\u002Fcli-help-output-and-documentation\u002Fdocumenting-environment-variables-in-help","Documenting Environment Variables in CLI Help",{"path":2336,"title":2337},"\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":2339,"title":2340},"\u002Fadvanced-input-parsing-user-experience\u002Fcli-help-output-and-documentation","CLI Help Output and Documentation",{"path":2342,"title":2343},"\u002Fadvanced-input-parsing-user-experience\u002Fcli-help-output-and-documentation\u002Frich-formatted-help-with-rich-click","Rich-Formatted Help for Click CLIs with rich-click",{"path":2345,"title":2346},"\u002Fadvanced-input-parsing-user-experience\u002Fcli-help-output-and-documentation\u002Fversioning-and-deprecating-cli-flags","Versioning and Deprecating CLI Flags",{"path":2348,"title":2349},"\u002Fadvanced-input-parsing-user-experience\u002Fcli-help-output-and-documentation\u002Fwriting-help-text-users-actually-read","Writing Help Text Users Actually Read",{"path":2351,"title":2352},"\u002Fadvanced-input-parsing-user-experience\u002Fcross-platform-terminal-compatibility\u002Fadapting-output-to-terminal-width","Adapting Python CLI Output to Terminal Width",{"path":2354,"title":2355},"\u002Fadvanced-input-parsing-user-experience\u002Fcross-platform-terminal-compatibility\u002Fdetecting-ci-environments-and-non-interactive-shells","Detecting CI Environments and Non-Interactive Shells",{"path":2357,"title":2358},"\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":2360,"title":2361},"\u002Fadvanced-input-parsing-user-experience\u002Fcross-platform-terminal-compatibility\u002Fhandling-ansi-escape-codes-on-windows-consoles","Handling ANSI Escape Codes on Windows Consoles",{"path":2363,"title":2364},"\u002Fadvanced-input-parsing-user-experience\u002Fcross-platform-terminal-compatibility","Cross-Platform Terminal Compatibility for Python CLIs",{"path":2366,"title":2367},"\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":2369,"title":2370},"\u002Fadvanced-input-parsing-user-experience\u002Fcross-platform-terminal-compatibility\u002Fsupporting-dumb-terminals-and-screen-readers","Supporting Dumb Terminals and Screen Readers in a Python CLI",{"path":2372,"title":2373},"\u002Fadvanced-input-parsing-user-experience\u002Ferror-handling-and-exit-codes\u002Fchoosing-exit-codes-for-cli-tools","Choosing Exit Codes for CLI Tools",{"path":2375,"title":2376},"\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":2378,"title":2379},"\u002Fadvanced-input-parsing-user-experience\u002Ferror-handling-and-exit-codes\u002Fdid-you-mean-suggestions-for-mistyped-input","Did You Mean…? Suggestions for Mistyped CLI Input",{"path":2381,"title":2382},"\u002Fadvanced-input-parsing-user-experience\u002Ferror-handling-and-exit-codes\u002Ffriendly-error-messages-and-tracebacks","Friendly Error Messages and Tracebacks",{"path":2384,"title":2385},"\u002Fadvanced-input-parsing-user-experience\u002Ferror-handling-and-exit-codes\u002Fhandling-keyboard-interrupt-cleanly","Handling Keyboard Interrupt Cleanly",{"path":2387,"title":2388},"\u002Fadvanced-input-parsing-user-experience\u002Ferror-handling-and-exit-codes","Error Handling and Exit Codes for CLIs",{"path":2390,"title":2391},"\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":2393,"title":2394},"\u002Fadvanced-input-parsing-user-experience\u002Ferror-handling-and-exit-codes\u002Fwriting-crash-reports-users-can-send","Writing Crash Reports Users Can Send",{"path":2396,"title":2397},"\u002Fadvanced-input-parsing-user-experience\u002Fhandling-configuration-files-env-vars\u002Fconfig-precedence-flags-env-files-defaults","Config Precedence: Flags, Env, Files, Defaults",{"path":2399,"title":2400},"\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":2402,"title":2403},"\u002Fadvanced-input-parsing-user-experience\u002Fhandling-configuration-files-env-vars","Handling Config Files and Env Vars in CLIs",{"path":2405,"title":2406},"\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":2408,"title":2409},"\u002Fadvanced-input-parsing-user-experience\u002Fhandling-configuration-files-env-vars\u002Freading-toml-config-with-tomllib","Reading TOML Config with tomllib in Python CLIs",{"path":2411,"title":2412},"\u002Fadvanced-input-parsing-user-experience\u002Fhandling-configuration-files-env-vars\u002Ftyped-settings-with-pydantic-settings","Typed Settings with pydantic-settings in Python CLIs",{"path":2414,"title":2415},"\u002Fadvanced-input-parsing-user-experience\u002Fhandling-configuration-files-env-vars\u002Fvalidating-config-files-with-json-schema","Validating Config Files with JSON Schema in a Python CLI",{"path":2417,"title":2418},"\u002Fadvanced-input-parsing-user-experience\u002Fhandling-configuration-files-env-vars\u002Fwriting-a-config-init-and-edit-command","Writing a Config Init and Edit Command for a Python CLI",{"path":2420,"title":2421},"\u002Fadvanced-input-parsing-user-experience","Advanced Input Parsing for Python CLIs",{"path":2423,"title":2424},"\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":2426,"title":2427},"\u002Fadvanced-input-parsing-user-experience\u002Finteractive-terminal-ui-with-rich\u002Fbuilding-interactive-prompts-and-menus","Building Interactive Prompts and Menus in Python CLIs",{"path":2429,"title":2430},"\u002Fadvanced-input-parsing-user-experience\u002Finteractive-terminal-ui-with-rich\u002Fbuilding-tree-views-with-rich","Building Tree Views with Rich in a Python CLI",{"path":2432,"title":2433},"\u002Fadvanced-input-parsing-user-experience\u002Finteractive-terminal-ui-with-rich","Interactive Terminal UI with Rich",{"path":2435,"title":2436},"\u002Fadvanced-input-parsing-user-experience\u002Finteractive-terminal-ui-with-rich\u002Flive-dashboards-with-rich-live","Live Dashboards with Rich Live in Python CLIs",{"path":2438,"title":2439},"\u002Fadvanced-input-parsing-user-experience\u002Finteractive-terminal-ui-with-rich\u002Frendering-markdown-and-syntax-highlighting-with-rich","Rendering Markdown and Syntax Highlighting with Rich",{"path":2441,"title":2442},"\u002Fadvanced-input-parsing-user-experience\u002Finteractive-terminal-ui-with-rich\u002Frendering-tables-and-json-with-rich","Rendering Tables and JSON with Rich",{"path":2444,"title":2445},"\u002Fadvanced-input-parsing-user-experience\u002Finteractive-terminal-ui-with-rich\u002Ftheming-rich-output-consistently","Theming Rich Output Consistently in Python CLIs",{"path":2447,"title":2448},"\u002Fadvanced-input-parsing-user-experience\u002Foutput-formats-for-data-clis\u002Fadding-a-format-flag-for-table-json-and-csv","Adding a Format Flag for Table, JSON and CSV Output",{"path":2450,"title":2451},"\u002Fadvanced-input-parsing-user-experience\u002Foutput-formats-for-data-clis\u002Fcustom-output-templates-with-a-format-string","Custom Output Templates with a Format String in Python CLIs",{"path":2453,"title":2454},"\u002Fadvanced-input-parsing-user-experience\u002Foutput-formats-for-data-clis\u002Fexporting-cli-results-to-files","Exporting CLI Results to Files from a Python CLI",{"path":2456,"title":2457},"\u002Fadvanced-input-parsing-user-experience\u002Foutput-formats-for-data-clis","Output Formats for Data-Heavy Python CLIs",{"path":2459,"title":2460},"\u002Fadvanced-input-parsing-user-experience\u002Foutput-formats-for-data-clis\u002Fselecting-fields-and-columns-from-cli-output","Selecting Fields and Columns from Python CLI Output",{"path":2462,"title":2463},"\u002Fadvanced-input-parsing-user-experience\u002Foutput-formats-for-data-clis\u002Fwriting-csv-and-tsv-output-correctly","Writing CSV and TSV Output Correctly from a Python CLI",{"path":2465,"title":2466},"\u002Fadvanced-input-parsing-user-experience\u002Fshell-completion-for-python-clis\u002Fargcomplete-for-argparse-clis","Tab Completion for argparse CLIs with argcomplete",{"path":2468,"title":2469},"\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":2471,"title":2472},"\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":2474,"title":2475},"\u002Fadvanced-input-parsing-user-experience\u002Fshell-completion-for-python-clis","Shell Completion for Python CLIs",{"path":2477,"title":2478},"\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":2480,"title":2481},"\u002Fadvanced-input-parsing-user-experience\u002Fshell-completion-for-python-clis\u002Fshipping-completion-scripts-with-packages","Shipping Shell Completion Scripts with a Python CLI",{"path":2483,"title":2484},"\u002Fadvanced-input-parsing-user-experience\u002Fshell-completion-for-python-clis\u002Ftesting-shell-completion-in-python-clis","Testing Shell Completion in Python CLIs",{"path":2486,"title":2487},"\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":2489,"title":2490},"\u002Fadvanced-input-parsing-user-experience\u002Fstructured-logging-for-cli-apps\u002Fadding-verbose-and-quiet-logging-flags","Adding Verbose and Quiet Logging Flags",{"path":2492,"title":2493},"\u002Fadvanced-input-parsing-user-experience\u002Fstructured-logging-for-cli-apps","Structured Logging for CLI Apps",{"path":2495,"title":2496},"\u002Fadvanced-input-parsing-user-experience\u002Fstructured-logging-for-cli-apps\u002Flogging-with-structlog-in-a-cli","Logging with structlog in a Python CLI",{"path":2498,"title":2499},"\u002Fadvanced-input-parsing-user-experience\u002Fstructured-logging-for-cli-apps\u002Fseparating-logs-from-program-output","Separating Logs from Program Output in a Python CLI",{"path":2501,"title":2502},"\u002Fadvanced-input-parsing-user-experience\u002Fstructured-logging-for-cli-apps\u002Fstructured-json-logging-in-python-clis","Structured JSON Logging in Python CLIs",{"path":2504,"title":2505},"\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":2507,"title":2508},"\u002Fadvanced-input-parsing-user-experience\u002Fworking-with-stdin-stdout-and-pipes\u002Fdetecting-tty-and-adapting-output","Detecting a TTY and Adapting Output",{"path":2510,"title":2511},"\u002Fadvanced-input-parsing-user-experience\u002Fworking-with-stdin-stdout-and-pipes\u002Femitting-json-output-for-scripting","Emitting JSON Output for Scripting",{"path":2513,"title":2514},"\u002Fadvanced-input-parsing-user-experience\u002Fworking-with-stdin-stdout-and-pipes\u002Fhandling-broken-pipe-and-sigpipe","Handling Broken Pipe and SIGPIPE",{"path":2516,"title":2517},"\u002Fadvanced-input-parsing-user-experience\u002Fworking-with-stdin-stdout-and-pipes","Working with stdin, stdout and Pipes",{"path":2519,"title":2520},"\u002Fadvanced-input-parsing-user-experience\u002Fworking-with-stdin-stdout-and-pipes\u002Fnull-delimited-input-and-xargs-compatibility","Null-Delimited Input and xargs Compatibility in Python CLIs",{"path":2522,"title":2523},"\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":2525,"title":2526},"\u002Fadvanced-input-parsing-user-experience\u002Fworking-with-stdin-stdout-and-pipes\u002Freading-piped-input-in-python-clis","Reading Piped Input in Python CLIs",{"path":2528,"title":2529},"\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":2531,"title":2532},"\u002Fcli-runtime-systems-integration\u002Fcalling-http-apis-from-python-clis\u002Fdownloading-files-with-progress-in-python","Downloading Files with Progress in Python CLIs",{"path":2534,"title":2535},"\u002Fcli-runtime-systems-integration\u002Fcalling-http-apis-from-python-clis","Calling HTTP APIs from Python CLIs",{"path":2537,"title":2538},"\u002Fcli-runtime-systems-integration\u002Fcalling-http-apis-from-python-clis\u002Fmocking-http-in-cli-tests-with-respx","Mocking HTTP in Python CLI Tests with respx",{"path":2540,"title":2541},"\u002Fcli-runtime-systems-integration\u002Fcalling-http-apis-from-python-clis\u002Foauth-device-flow-login-for-clis","OAuth Device Flow Login for Python CLIs",{"path":2543,"title":2544},"\u002Fcli-runtime-systems-integration\u002Fcalling-http-apis-from-python-clis\u002Fpaginating-api-results-in-a-cli","Paginating API Results in a Python CLI",{"path":2546,"title":2547},"\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":2549,"title":2550},"\u002Fcli-runtime-systems-integration\u002Fcalling-http-apis-from-python-clis\u002Fuploading-files-with-multipart-and-progress","Uploading Files with Multipart and Progress in a Python CLI",{"path":2552,"title":2553},"\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":2555,"title":2556},"\u002Fcli-runtime-systems-integration\u002Fconcurrency-and-async-in-python-clis","Concurrency and Async in Python CLIs",{"path":2558,"title":2559},"\u002Fcli-runtime-systems-integration\u002Fconcurrency-and-async-in-python-clis\u002Fmultiprocessing-for-cpu-bound-cli-tasks","Multiprocessing for CPU-Bound CLI Tasks",{"path":2561,"title":2562},"\u002Fcli-runtime-systems-integration\u002Fconcurrency-and-async-in-python-clis\u002Fparallelising-cli-work-with-thread-pools","Parallelising CLI Work with Thread Pools",{"path":2564,"title":2565},"\u002Fcli-runtime-systems-integration\u002Fconcurrency-and-async-in-python-clis\u002Frate-limiting-concurrent-requests-in-clis","Rate-Limiting Concurrent Requests in Python CLIs",{"path":2567,"title":2568},"\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":2570,"title":2571},"\u002Fcli-runtime-systems-integration\u002Fconcurrency-and-async-in-python-clis\u002Fshowing-progress-for-concurrent-tasks","Showing Progress for Concurrent Tasks in a Python CLI",{"path":2573,"title":2574},"\u002Fcli-runtime-systems-integration\u002Fconcurrency-and-async-in-python-clis\u002Fstructured-concurrency-with-taskgroups-in-clis","Structured Concurrency with TaskGroups in Python CLIs",{"path":2576,"title":2577},"\u002Fcli-runtime-systems-integration\u002Ffilesystem-paths-and-atomic-writes\u002Fcross-platform-paths-with-pathlib","Cross-Platform Paths with pathlib in CLIs",{"path":2579,"title":2580},"\u002Fcli-runtime-systems-integration\u002Ffilesystem-paths-and-atomic-writes\u002Ffile-locking-for-concurrent-cli-runs","File Locking for Concurrent CLI Runs in Python",{"path":2582,"title":2583},"\u002Fcli-runtime-systems-integration\u002Ffilesystem-paths-and-atomic-writes\u002Fhandling-file-permissions-and-umask-in-clis","Handling File Permissions and umask in Python CLIs",{"path":2585,"title":2586},"\u002Fcli-runtime-systems-integration\u002Ffilesystem-paths-and-atomic-writes","Filesystem Paths and Atomic Writes for CLIs",{"path":2588,"title":2589},"\u002Fcli-runtime-systems-integration\u002Ffilesystem-paths-and-atomic-writes\u002Fsafe-temporary-files-and-directories","Safe Temporary Files and Directories in CLIs",{"path":2591,"title":2592},"\u002Fcli-runtime-systems-integration\u002Ffilesystem-paths-and-atomic-writes\u002Fstoring-app-data-with-platformdirs","Storing CLI App Data with platformdirs",{"path":2594,"title":2595},"\u002Fcli-runtime-systems-integration\u002Ffilesystem-paths-and-atomic-writes\u002Fwalking-directory-trees-with-ignore-rules","Walking Directory Trees with Ignore Rules in a Python CLI",{"path":2597,"title":2598},"\u002Fcli-runtime-systems-integration\u002Ffilesystem-paths-and-atomic-writes\u002Fwriting-files-atomically-in-python-clis","Writing Files Atomically in Python CLIs",{"path":2600,"title":2601},"\u002Fcli-runtime-systems-integration","CLI Runtime & Systems Integration for Python",{"path":2603,"title":2604},"\u002Fcli-runtime-systems-integration\u002Flocal-state-and-sqlite-in-python-clis\u002Fcaching-http-responses-on-disk-in-a-cli","Caching HTTP Responses on Disk in a Python CLI",{"path":2606,"title":2607},"\u002Fcli-runtime-systems-integration\u002Flocal-state-and-sqlite-in-python-clis","Local State and SQLite in Python CLIs",{"path":2609,"title":2610},"\u002Fcli-runtime-systems-integration\u002Flocal-state-and-sqlite-in-python-clis\u002Fmigrating-a-cli-sqlite-schema","Migrating a CLI’s SQLite Schema Between Releases",{"path":2612,"title":2613},"\u002Fcli-runtime-systems-integration\u002Flocal-state-and-sqlite-in-python-clis\u002Frecording-and-querying-cli-run-history","Recording and Querying CLI Run History in SQLite",{"path":2615,"title":2616},"\u002Fcli-runtime-systems-integration\u002Flocal-state-and-sqlite-in-python-clis\u002Fstoring-cli-state-in-sqlite","Storing CLI State in SQLite with a Small Repository Class",{"path":2618,"title":2619},"\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":2621,"title":2622},"\u002Fcli-runtime-systems-integration\u002Flong-running-and-watch-mode-clis\u002Fhandling-sigterm-and-graceful-shutdown","Handling SIGTERM and Graceful Shutdown in CLIs",{"path":2624,"title":2625},"\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":2627,"title":2628},"\u002Fcli-runtime-systems-integration\u002Flong-running-and-watch-mode-clis","Long-Running and Watch-Mode Python CLIs",{"path":2630,"title":2631},"\u002Fcli-runtime-systems-integration\u002Flong-running-and-watch-mode-clis\u002Freloading-config-on-sighup","Reloading Configuration on SIGHUP in a Python CLI",{"path":2633,"title":2634},"\u002Fcli-runtime-systems-integration\u002Flong-running-and-watch-mode-clis\u002Frunning-a-cli-as-a-systemd-service","Running a Python CLI as a systemd Service",{"path":2636,"title":2637},"\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":2639,"title":2640},"\u002Fcli-runtime-systems-integration\u002Flong-running-and-watch-mode-clis\u002Fsending-cli-logs-to-journald-and-syslog","Sending Python CLI Logs to journald and syslog",{"path":2642,"title":2643},"\u002Fcli-runtime-systems-integration\u002Frunning-subprocesses-from-python-clis\u002Favoiding-shell-injection-in-python-clis","Avoiding Shell Injection in Python CLIs",{"path":2645,"title":2646},"\u002Fcli-runtime-systems-integration\u002Frunning-subprocesses-from-python-clis\u002Fcalling-external-commands-safely-with-subprocess","Calling External Commands Safely with subprocess",{"path":2648,"title":2649},"\u002Fcli-runtime-systems-integration\u002Frunning-subprocesses-from-python-clis\u002Fhandling-subprocess-timeouts-and-exit-codes","Handling Subprocess Timeouts and Exit Codes",{"path":2651,"title":2652},"\u002Fcli-runtime-systems-integration\u002Frunning-subprocesses-from-python-clis","Running Subprocesses from Python CLIs",{"path":2273,"title":5},{"path":2655,"title":2656},"\u002Fcli-runtime-systems-integration\u002Frunning-subprocesses-from-python-clis\u002Fpiping-between-subprocesses-in-python","Piping Between Subprocesses in Python Without a Shell",{"path":2658,"title":2659},"\u002Fcli-runtime-systems-integration\u002Frunning-subprocesses-from-python-clis\u002Fstreaming-subprocess-output-in-real-time","Streaming Subprocess Output in Real Time",{"path":2661,"title":2662},"\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":2664,"title":2665},"\u002Fcli-runtime-systems-integration\u002Fsecrets-and-credentials-in-python-clis","Secrets and Credentials in Python CLIs",{"path":2667,"title":2668},"\u002Fcli-runtime-systems-integration\u002Fsecrets-and-credentials-in-python-clis\u002Fprompting-for-passwords-securely","Prompting for Passwords Securely in Python CLIs",{"path":2670,"title":2671},"\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":2673,"title":2674},"\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":2676,"title":2677},"\u002Fcli-runtime-systems-integration\u002Fsecrets-and-credentials-in-python-clis\u002Frefreshing-expired-tokens-automatically","Refreshing Expired Tokens Automatically in a Python CLI",{"path":2679,"title":2680},"\u002Fcli-runtime-systems-integration\u002Fsecrets-and-credentials-in-python-clis\u002Fstoring-tokens-with-keyring","Storing CLI Tokens Securely with keyring",{"path":2682,"title":2683},"\u002Fcli-runtime-systems-integration\u002Fsecrets-and-credentials-in-python-clis\u002Fsupporting-multiple-profiles-and-accounts","Supporting Multiple Profiles and Accounts in CLIs",{"path":2685,"title":2686},"\u002Fcli-runtime-systems-integration\u002Fupdate-checks-and-self-updating-clis\u002Fchecking-pypi-for-a-newer-version","Checking PyPI for a Newer Version of Your Python CLI",{"path":2688,"title":2689},"\u002Fcli-runtime-systems-integration\u002Fupdate-checks-and-self-updating-clis","Update Checks, Upgrade Commands and Telemetry for Python CLIs",{"path":2691,"title":2692},"\u002Fcli-runtime-systems-integration\u002Fupdate-checks-and-self-updating-clis\u002Fopt-in-usage-telemetry-for-python-clis","Opt-In Usage Telemetry for Python CLIs Done Responsibly",{"path":2694,"title":2695},"\u002Fcli-runtime-systems-integration\u002Fupdate-checks-and-self-updating-clis\u002Fself-upgrading-a-cli-installed-with-pipx-or-uv","Self-Upgrading a Python CLI Installed with pipx or uv",{"path":2697,"title":2698},"\u002Fcli-runtime-systems-integration\u002Fupdate-checks-and-self-updating-clis\u002Fshowing-non-blocking-update-notices","Showing Non-Blocking Update Notices in a Python CLI",{"path":585,"title":2700},"Python CLI Toolcraft",{"path":2702,"title":2703},"\u002Fmodern-python-cli-frameworks-architecture\u002Falternative-python-cli-frameworks\u002Fbuilding-a-cli-with-cleo","Building a Python CLI with Cleo Command Classes",{"path":2705,"title":2706},"\u002Fmodern-python-cli-frameworks-architecture\u002Falternative-python-cli-frameworks\u002Fbuilding-a-cli-with-cyclopts","Building a Type-Hinted Python CLI with Cyclopts",{"path":2708,"title":2709},"\u002Fmodern-python-cli-frameworks-architecture\u002Falternative-python-cli-frameworks","Beyond Click and Typer: Alternative Python CLI Frameworks",{"path":2711,"title":2712},"\u002Fmodern-python-cli-frameworks-architecture\u002Falternative-python-cli-frameworks\u002Fquick-clis-from-functions-with-python-fire","Quick CLIs from Functions with Python Fire",{"path":2714,"title":2715},"\u002Fmodern-python-cli-frameworks-architecture\u002Falternative-python-cli-frameworks\u002Fusage-string-driven-clis-with-docopt-ng","Usage-String Driven Python CLIs with docopt-ng",{"path":2717,"title":2718},"\u002Fmodern-python-cli-frameworks-architecture\u002Fcli-startup-performance-and-lazy-loading\u002Favoiding-import-time-side-effects","Avoiding Import-Time Side Effects in a Python CLI",{"path":2720,"title":2721},"\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":2723,"title":2724},"\u002Fmodern-python-cli-frameworks-architecture\u002Fcli-startup-performance-and-lazy-loading\u002Fguarding-startup-with-import-tests","Guarding CLI Startup with Import Tests",{"path":2726,"title":2727},"\u002Fmodern-python-cli-frameworks-architecture\u002Fcli-startup-performance-and-lazy-loading","CLI Startup Performance and Lazy Loading",{"path":2729,"title":2730},"\u002Fmodern-python-cli-frameworks-architecture\u002Fcli-startup-performance-and-lazy-loading\u002Flazy-loading-subcommands-for-faster-startup","Lazy Loading Subcommands for Faster Startup",{"path":2732,"title":2733},"\u002Fmodern-python-cli-frameworks-architecture\u002Fcli-startup-performance-and-lazy-loading\u002Fprofiling-python-cli-startup-time","Profiling Python CLI Startup Time",{"path":2735,"title":2736},"\u002Fmodern-python-cli-frameworks-architecture\u002Fcli-startup-performance-and-lazy-loading\u002Freducing-cli-dependency-weight","Reducing CLI Dependency Weight",{"path":2738,"title":2739},"\u002Fmodern-python-cli-frameworks-architecture\u002Fcommand-line-parsing-with-argparse\u002Fargparse-subparsers-for-subcommands","argparse Subparsers for Subcommands",{"path":2741,"title":2742},"\u002Fmodern-python-cli-frameworks-architecture\u002Fcommand-line-parsing-with-argparse\u002Fargparse-vs-click-vs-typer-comparison","argparse vs Click vs Typer Compared",{"path":2744,"title":2745},"\u002Fmodern-python-cli-frameworks-architecture\u002Fcommand-line-parsing-with-argparse\u002Fargument-groups-and-help-formatting-in-argparse","Argument Groups and Help Formatting in argparse",{"path":2747,"title":2748},"\u002Fmodern-python-cli-frameworks-architecture\u002Fcommand-line-parsing-with-argparse","Command-Line Parsing with argparse",{"path":2750,"title":2751},"\u002Fmodern-python-cli-frameworks-architecture\u002Fcommand-line-parsing-with-argparse\u002Fmigrating-from-argparse-to-typer","Migrating from argparse to Typer",{"path":2753,"title":2754},"\u002Fmodern-python-cli-frameworks-architecture\u002Fcommand-line-parsing-with-argparse\u002Fmutually-exclusive-options-in-argparse","Mutually Exclusive Options in argparse",{"path":2756,"title":2757},"\u002Fmodern-python-cli-frameworks-architecture\u002Fcommand-line-parsing-with-argparse\u002Freading-arguments-from-files-with-fromfile-prefix-chars","Reading Arguments from Files with argparse’s fromfile_prefix_chars",{"path":2759,"title":2760},"\u002Fmodern-python-cli-frameworks-architecture\u002Fcommand-line-parsing-with-argparse\u002Fwriting-custom-argparse-actions","Writing Custom argparse Actions in Python",{"path":2762,"title":2763},"\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":2765,"title":2766},"\u002Fmodern-python-cli-frameworks-architecture\u002Fdesigning-cli-interfaces-and-conventions\u002Fdesigning-idempotent-commands","Designing Idempotent Commands in a Python CLI",{"path":2768,"title":2769},"\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":2771,"title":2772},"\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":2774,"title":2775},"\u002Fmodern-python-cli-frameworks-architecture\u002Fdesigning-cli-interfaces-and-conventions","Designing CLI Interfaces and Conventions in Python",{"path":2777,"title":2778},"\u002Fmodern-python-cli-frameworks-architecture\u002Fdesigning-cli-interfaces-and-conventions\u002Fnaming-commands-and-flags-consistently","Naming Commands and Flags Consistently in Python CLIs",{"path":2780,"title":2781},"\u002Fmodern-python-cli-frameworks-architecture\u002Fdesigning-cli-interfaces-and-conventions\u002Fpositional-arguments-vs-options","Positional Arguments vs Options: Designing a CLI Signature",{"path":2783,"title":2784},"\u002Fmodern-python-cli-frameworks-architecture","Python CLI Frameworks and Architecture",{"path":2786,"title":2787},"\u002Fmodern-python-cli-frameworks-architecture\u002Fplugin-architectures-for-extensible-clis\u002Fdiscovering-plugins-with-entry-points","Discovering Plugins with Entry Points in Python CLIs",{"path":2789,"title":2790},"\u002Fmodern-python-cli-frameworks-architecture\u002Fplugin-architectures-for-extensible-clis\u002Fhook-based-plugins-with-pluggy","Hook-Based Plugins for Python CLIs with pluggy",{"path":2792,"title":2793},"\u002Fmodern-python-cli-frameworks-architecture\u002Fplugin-architectures-for-extensible-clis","Plugin Architectures for Extensible CLIs",{"path":2795,"title":2796},"\u002Fmodern-python-cli-frameworks-architecture\u002Fplugin-architectures-for-extensible-clis\u002Fisolating-plugin-failures","Isolating Plugin Failures in an Extensible Python CLI",{"path":2798,"title":2799},"\u002Fmodern-python-cli-frameworks-architecture\u002Fplugin-architectures-for-extensible-clis\u002Ftesting-plugins-against-the-host-cli","Testing Plugins Against the Host CLI",{"path":2801,"title":2802},"\u002Fmodern-python-cli-frameworks-architecture\u002Fplugin-architectures-for-extensible-clis\u002Fversioning-a-plugin-api","Versioning a Plugin API for a Python CLI",{"path":2804,"title":2805},"\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":2807,"title":2808},"\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":2810,"title":2811},"\u002Fmodern-python-cli-frameworks-architecture\u002Fstructuring-multi-command-python-clis\u002Fdependency-injection-patterns-for-cli-commands","Dependency Injection Patterns for CLI Commands",{"path":2813,"title":2814},"\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":2816,"title":2817},"\u002Fmodern-python-cli-frameworks-architecture\u002Fstructuring-multi-command-python-clis","Structuring Multi-Command Python CLIs",{"path":2819,"title":2820},"\u002Fmodern-python-cli-frameworks-architecture\u002Fstructuring-multi-command-python-clis\u002Foffering-a-python-api-alongside-your-cli","Offering a Python API Alongside Your CLI",{"path":2822,"title":2823},"\u002Fmodern-python-cli-frameworks-architecture\u002Fstructuring-multi-command-python-clis\u002Fregistering-commands-from-modules-automatically","Registering CLI Commands from Modules Automatically",{"path":2825,"title":2826},"\u002Fmodern-python-cli-frameworks-architecture\u002Fstructuring-multi-command-python-clis\u002Fsharing-common-options-across-commands","Sharing Common Options Across Python CLI Commands",{"path":2828,"title":2829},"\u002Fmodern-python-cli-frameworks-architecture\u002Fstructuring-multi-command-python-clis\u002Fsharing-state-with-click-context-objects","Sharing State with Click Context Objects",{"path":2831,"title":2832},"\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":2834,"title":2835},"\u002Fmodern-python-cli-frameworks-architecture\u002Ftesting-python-cli-applications","Testing Python CLI Applications",{"path":2837,"title":2838},"\u002Fmodern-python-cli-frameworks-architecture\u002Ftesting-python-cli-applications\u002Fmeasuring-cli-test-coverage","Measuring CLI Test Coverage",{"path":2840,"title":2841},"\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":2843,"title":2844},"\u002Fmodern-python-cli-frameworks-architecture\u002Ftesting-python-cli-applications\u002Fproperty-based-testing-cli-arguments-with-hypothesis","Property-Based Testing CLI Arguments with Hypothesis",{"path":2846,"title":2847},"\u002Fmodern-python-cli-frameworks-architecture\u002Ftesting-python-cli-applications\u002Fsnapshot-testing-cli-output","Snapshot Testing CLI Output",{"path":2849,"title":2850},"\u002Fmodern-python-cli-frameworks-architecture\u002Ftesting-python-cli-applications\u002Ftesting-click-commands-with-clirunner","Testing Click Commands with CliRunner",{"path":2852,"title":2853},"\u002Fmodern-python-cli-frameworks-architecture\u002Ftesting-python-cli-applications\u002Ftesting-commands-that-call-subprocesses","Testing Python CLI Commands That Call Subprocesses",{"path":2855,"title":2856},"\u002Fmodern-python-cli-frameworks-architecture\u002Ftesting-python-cli-applications\u002Ftesting-interactive-prompts-and-stdin","Testing Interactive Prompts and stdin",{"path":2858,"title":2859},"\u002Fmodern-python-cli-frameworks-architecture\u002Ftesting-python-cli-applications\u002Ftranscript-tests-for-cli-commands","Transcript Tests for Python CLI Commands",{"path":2861,"title":2862},"\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":2864,"title":2865},"\u002Fmodern-python-cli-frameworks-architecture\u002Ftyper-vs-click-when-to-use-each\u002Fbuilding-dynamic-commands-in-click","Building Dynamic Commands in Click",{"path":2867,"title":2868},"\u002Fmodern-python-cli-frameworks-architecture\u002Ftyper-vs-click-when-to-use-each\u002Fchoices-and-enums-in-typer-and-click","Choices and Enums in Typer and Click Options",{"path":2870,"title":2871},"\u002Fmodern-python-cli-frameworks-architecture\u002Ftyper-vs-click-when-to-use-each\u002Fclick-option-callbacks-and-eager-options","Click Option Callbacks and Eager Options Explained",{"path":2873,"title":2874},"\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":2876,"title":2877},"\u002Fmodern-python-cli-frameworks-architecture\u002Ftyper-vs-click-when-to-use-each","Typer vs Click: When to Use Each",{"path":2879,"title":2880},"\u002Fmodern-python-cli-frameworks-architecture\u002Ftyper-vs-click-when-to-use-each\u002Frich-markup-and-help-panels-in-typer","Rich Markup and Help Panels in Typer",{"path":2882,"title":2883},"\u002Fmodern-python-cli-frameworks-architecture\u002Ftyper-vs-click-when-to-use-each\u002Ftyper-callback-functions-explained","Typer callback functions explained",{"path":2885,"title":2886},"\u002Fmodern-python-cli-frameworks-architecture\u002Ftyper-vs-click-when-to-use-each\u002Fusing-annotated-options-in-typer","Using Annotated Options in Typer",{"path":2888,"title":2889},"\u002Fproject-setup-dependency-management\u002Fci-cd-pipelines-for-python-clis\u002Fautomating-releases-from-git-tags","Automating Python CLI Releases from Git Tags",{"path":2891,"title":2892},"\u002Fproject-setup-dependency-management\u002Fci-cd-pipelines-for-python-clis\u002Fcaching-uv-dependencies-in-ci","Caching uv Dependencies in CI for Python CLIs",{"path":2894,"title":2895},"\u002Fproject-setup-dependency-management\u002Fci-cd-pipelines-for-python-clis","CI\u002FCD Pipelines for Python CLIs",{"path":2897,"title":2898},"\u002Fproject-setup-dependency-management\u002Fci-cd-pipelines-for-python-clis\u002Fpublishing-a-cli-docker-image-from-ci","Publishing a Python CLI as a Docker Image from CI",{"path":2900,"title":2901},"\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":2903,"title":2904},"\u002Fproject-setup-dependency-management\u002Fci-cd-pipelines-for-python-clis\u002Frunning-cli-tests-on-windows-and-macos-runners","Running Python CLI Tests on Windows and macOS Runners",{"path":2906,"title":2907},"\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":2909,"title":2910},"\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":2912,"title":2913},"\u002Fproject-setup-dependency-management\u002Fcli-project-scaffolding-with-cookiecutter\u002Fbuilding-a-cookiecutter-template-for-typer-clis","Building a Cookiecutter Template for Typer CLIs",{"path":2915,"title":2916},"\u002Fproject-setup-dependency-management\u002Fcli-project-scaffolding-with-cookiecutter\u002Fcopier-vs-cookiecutter-for-cli-templates","Copier vs Cookiecutter for CLI Templates",{"path":2918,"title":2919},"\u002Fproject-setup-dependency-management\u002Fcli-project-scaffolding-with-cookiecutter","CLI Project Scaffolding with Cookiecutter",{"path":2921,"title":2922},"\u002Fproject-setup-dependency-management\u002Fcli-project-scaffolding-with-cookiecutter\u002Fpost-generation-hooks-in-cli-templates","Post-Generation Hooks in Python CLI Templates",{"path":2924,"title":2925},"\u002Fproject-setup-dependency-management\u002Fcli-project-scaffolding-with-cookiecutter\u002Ftemplate-variables-and-conditional-files","Template Variables and Conditional Files in CLI Templates",{"path":2927,"title":2928},"\u002Fproject-setup-dependency-management\u002Fcli-project-scaffolding-with-cookiecutter\u002Ftesting-a-project-template-with-pytest","Testing a CLI Project Template with pytest",{"path":2930,"title":2931},"\u002Fproject-setup-dependency-management\u002Fcli-project-scaffolding-with-cookiecutter\u002Fupdating-generated-projects-with-copier-update","Updating Generated CLI Projects with copier update",{"path":2933,"title":2934},"\u002Fproject-setup-dependency-management\u002Fdistributing-clis-as-standalone-binaries\u002Fbuilding-cross-platform-release-binaries-in-ci","Building Cross-Platform Release Binaries in CI",{"path":2936,"title":2937},"\u002Fproject-setup-dependency-management\u002Fdistributing-clis-as-standalone-binaries\u002Fbundling-a-python-cli-with-pyinstaller","Bundling a Python CLI with PyInstaller",{"path":2939,"title":2940},"\u002Fproject-setup-dependency-management\u002Fdistributing-clis-as-standalone-binaries\u002Fcode-signing-and-notarizing-cli-binaries","Code Signing and Notarizing Python CLI Binaries",{"path":2942,"title":2943},"\u002Fproject-setup-dependency-management\u002Fdistributing-clis-as-standalone-binaries\u002Fhomebrew-and-scoop-packaging-for-python-clis","Homebrew and Scoop Packaging for Python CLIs",{"path":2945,"title":2946},"\u002Fproject-setup-dependency-management\u002Fdistributing-clis-as-standalone-binaries","Distributing CLIs as Standalone Binaries",{"path":2948,"title":2949},"\u002Fproject-setup-dependency-management\u002Fdistributing-clis-as-standalone-binaries\u002Fnuitka-vs-pyinstaller-for-python-clis","Nuitka vs PyInstaller for Python CLI Binaries",{"path":2951,"title":2952},"\u002Fproject-setup-dependency-management\u002Fdistributing-clis-as-standalone-binaries\u002Freducing-pyinstaller-binary-size","Reducing the Size of a PyInstaller CLI Binary",{"path":2954,"title":2955},"\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":2957,"title":2958},"\u002Fproject-setup-dependency-management","Project Setup & Dependency Management",{"path":2960,"title":2961},"\u002Fproject-setup-dependency-management\u002Flinting-and-type-checking-cli-code\u002Fconfiguring-ruff-for-a-cli-project","Configuring Ruff for a Python CLI Project",{"path":2963,"title":2964},"\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":2966,"title":2967},"\u002Fproject-setup-dependency-management\u002Flinting-and-type-checking-cli-code\u002Ffinding-unused-code-and-dependencies-with-vulture-and-deptry","Finding Unused Code and Dependencies with vulture and deptry",{"path":2969,"title":2970},"\u002Fproject-setup-dependency-management\u002Flinting-and-type-checking-cli-code","Linting and Type-Checking Python CLI Code",{"path":2972,"title":2973},"\u002Fproject-setup-dependency-management\u002Flinting-and-type-checking-cli-code\u002Frunning-pyright-in-strict-mode-on-a-cli","Running Pyright in Strict Mode on a Python CLI",{"path":2975,"title":2976},"\u002Fproject-setup-dependency-management\u002Flinting-and-type-checking-cli-code\u002Frunning-ruff-and-mypy-in-ci-with-annotations","Running Ruff and mypy in CI with Inline Annotations",{"path":2978,"title":2979},"\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":2981,"title":2982},"\u002Fproject-setup-dependency-management\u002Fmanaging-cli-versioning-changelogs\u002Fautomating-changelogs-with-conventional-commits","Automating Changelogs with Conventional Commits",{"path":2984,"title":2985},"\u002Fproject-setup-dependency-management\u002Fmanaging-cli-versioning-changelogs\u002Fbumping-versions-consistently-across-a-cli-project","Bumping Versions Consistently Across a Python CLI Project",{"path":2987,"title":2988},"\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":2990,"title":2991},"\u002Fproject-setup-dependency-management\u002Fmanaging-cli-versioning-changelogs\u002Fexposing-version-info-and-build-metadata","Exposing Version Info and Build Metadata",{"path":2993,"title":2994},"\u002Fproject-setup-dependency-management\u002Fmanaging-cli-versioning-changelogs","Managing CLI Versioning & Changelogs",{"path":2996,"title":2997},"\u002Fproject-setup-dependency-management\u002Fmanaging-cli-versioning-changelogs\u002Fsemantic-versioning-policy-for-cli-tools","A Semantic Versioning Policy for CLI Tools",{"path":2999,"title":3000},"\u002Fproject-setup-dependency-management\u002Fmanaging-cli-versioning-changelogs\u002Fshipping-pre-releases-and-release-candidates","Shipping Pre-Releases and Release Candidates of a Python CLI",{"path":3002,"title":3003},"\u002Fproject-setup-dependency-management\u002Fpackaging-python-clis-for-distribution\u002Fbuilding-wheels-and-sdists-for-python-clis","Building Wheels and sdists for Python CLIs",{"path":3005,"title":3006},"\u002Fproject-setup-dependency-management\u002Fpackaging-python-clis-for-distribution\u002Fbundling-data-files-with-importlib-resources","Bundling Data Files with importlib.resources in CLIs",{"path":3008,"title":3009},"\u002Fproject-setup-dependency-management\u002Fpackaging-python-clis-for-distribution\u002Fchoosing-a-build-backend-for-a-python-cli","Choosing a Build Backend for a Python CLI",{"path":3011,"title":3012},"\u002Fproject-setup-dependency-management\u002Fpackaging-python-clis-for-distribution","Packaging Python CLIs for Distribution",{"path":3014,"title":3015},"\u002Fproject-setup-dependency-management\u002Fpackaging-python-clis-for-distribution\u002Finstalling-and-distributing-clis-with-pipx","Installing and Distributing CLIs with pipx",{"path":3017,"title":3018},"\u002Fproject-setup-dependency-management\u002Fpackaging-python-clis-for-distribution\u002Foptional-dependencies-and-extras-for-clis","Optional Dependencies and Extras for Python CLIs",{"path":3020,"title":3021},"\u002Fproject-setup-dependency-management\u002Fpackaging-python-clis-for-distribution\u002Fpublishing-a-python-cli-to-pypi","Publishing a Python CLI to PyPI",{"path":3023,"title":3024},"\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":3026,"title":3027},"\u002Fproject-setup-dependency-management\u002Fpoetry-workflows-for-cli-development\u002Fdynamic-versioning-with-poetry-plugins","Dynamic Versioning for a Poetry CLI from Git Tags",{"path":3029,"title":3030},"\u002Fproject-setup-dependency-management\u002Fpoetry-workflows-for-cli-development","Poetry Workflows for CLI Development",{"path":3032,"title":3033},"\u002Fproject-setup-dependency-management\u002Fpoetry-workflows-for-cli-development\u002Fmanaging-poetry-lock-files-for-cli-tools","Managing Poetry Lock Files for CLI Tools",{"path":3035,"title":3036},"\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":3038,"title":3039},"\u002Fproject-setup-dependency-management\u002Fpoetry-workflows-for-cli-development\u002Fpoetry-dependency-groups-for-cli-tooling","Poetry Dependency Groups for CLI Tooling",{"path":3041,"title":3042},"\u002Fproject-setup-dependency-management\u002Fpoetry-workflows-for-cli-development\u002Fpoetry-entry-points-and-scripts-for-clis","Poetry Entry Points and Scripts for CLIs",{"path":3044,"title":3045},"\u002Fproject-setup-dependency-management\u002Fpoetry-workflows-for-cli-development\u002Fpublishing-a-cli-with-poetry","Building and Publishing a Python CLI with Poetry",{"path":3047,"title":3048},"\u002Fproject-setup-dependency-management\u002Fpre-commit-hooks-for-cli-projects","Pre-commit Hooks for CLI Projects",{"path":3050,"title":3051},"\u002Fproject-setup-dependency-management\u002Fpre-commit-hooks-for-cli-projects\u002Fkeeping-hook-versions-current-with-autoupdate","Keeping pre-commit Hook Versions Current with autoupdate",{"path":3053,"title":3054},"\u002Fproject-setup-dependency-management\u002Fpre-commit-hooks-for-cli-projects\u002Frunning-pre-commit-in-ci","Running pre-commit in CI for a Python CLI Repository",{"path":3056,"title":3057},"\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":3059,"title":3060},"\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":3062,"title":3063},"\u002Fproject-setup-dependency-management\u002Fpre-commit-hooks-for-cli-projects\u002Fspeeding-up-slow-pre-commit-hooks","Speeding Up Slow pre-commit Hooks in a CLI Repository",{"path":3065,"title":3066},"\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":3068,"title":3069},"\u002Fproject-setup-dependency-management\u002Fsecuring-a-python-cli-supply-chain\u002Fauditing-dependencies-with-pip-audit","Auditing a Python CLI’s Dependencies with pip-audit",{"path":3071,"title":3072},"\u002Fproject-setup-dependency-management\u002Fsecuring-a-python-cli-supply-chain\u002Fgenerating-an-sbom-for-a-python-cli","Generating an SBOM for a Python CLI Release",{"path":3074,"title":3075},"\u002Fproject-setup-dependency-management\u002Fsecuring-a-python-cli-supply-chain","Securing the Supply Chain of a Python CLI",{"path":3077,"title":3078},"\u002Fproject-setup-dependency-management\u002Fsecuring-a-python-cli-supply-chain\u002Fpinning-dependencies-with-hashes","Pinning a Python CLI’s Dependencies with Hashes",{"path":3080,"title":3081},"\u002Fproject-setup-dependency-management\u002Fsecuring-a-python-cli-supply-chain\u002Fpublishing-attestations-and-verifying-releases","Publishing Attestations and Verifying Python CLI Releases",{"path":3083,"title":3084},"\u002Fproject-setup-dependency-management\u002Fuv-for-python-cli-dependency-management\u002Fbuilding-and-publishing-a-cli-with-uv","Building and Publishing a Python CLI with uv",{"path":3086,"title":3087},"\u002Fproject-setup-dependency-management\u002Fuv-for-python-cli-dependency-management","uv for Python CLI Dependency Management",{"path":3089,"title":3090},"\u002Fproject-setup-dependency-management\u002Fuv-for-python-cli-dependency-management\u002Flocking-and-syncing-cli-dependencies-with-uv","Locking and Syncing a Python CLI’s Dependencies with uv",{"path":3092,"title":3093},"\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":3095,"title":3096},"\u002Fproject-setup-dependency-management\u002Fuv-for-python-cli-dependency-management\u002Fusing-private-package-indexes-with-uv","Using Private Package Indexes with uv for Internal CLIs",{"path":3098,"title":3099},"\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":3101,"title":3102},"\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":3104,"title":3105},"\u002Fproject-setup-dependency-management\u002Fuv-for-python-cli-dependency-management\u002Fuv-workspaces-for-multi-package-clis","uv Workspaces for Multi-Package Python CLIs",{"path":3107,"title":3108},"\u002Fproject-setup-dependency-management\u002Fvirtual-environments-isolation-best-practices\u002Fdebugging-wrong-python-and-wrong-venv-problems","Debugging Wrong-Python and Wrong-Venv Problems in CLIs",{"path":3110,"title":3111},"\u002Fproject-setup-dependency-management\u002Fvirtual-environments-isolation-best-practices\u002Fexternally-managed-environments-and-pep-668","PEP 668 and Python CLIs: the externally-managed-environment Error",{"path":3113,"title":3114},"\u002Fproject-setup-dependency-management\u002Fvirtual-environments-isolation-best-practices","Python CLI Env Isolation Best Practices",{"path":3116,"title":3117},"\u002Fproject-setup-dependency-management\u002Fvirtual-environments-isolation-best-practices\u002Fisolating-cli-tools-from-project-dependencies","Isolating CLI Tools from Your Project’s Dependencies",{"path":3119,"title":3120},"\u002Fproject-setup-dependency-management\u002Fvirtual-environments-isolation-best-practices\u002Fmanaging-virtual-environments-for-cross-platform-clis","Managing Python CLI Virtual Environments",{"path":3122,"title":3123},"\u002Fproject-setup-dependency-management\u002Fvirtual-environments-isolation-best-practices\u002Fpinning-the-python-version-for-a-cli","Pinning the Python Version for a CLI",{"path":3125,"title":3126},"\u002Fproject-setup-dependency-management\u002Fvirtual-environments-isolation-best-practices\u002Fsupporting-multiple-python-versions-with-nox","Supporting Multiple Python Versions with nox",1790967540098]