parthtamu/rag-code-assistant
0
1<!DOCTYPE html>2 3<html lang="en" data-content_root="../">4 <head>5 <meta charset="utf-8" />6 <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="viewport" content="width=device-width, initial-scale=1" />7<meta property="og:title" content="Modules command-line interface (CLI)" />8<meta property="og:type" content="website" />9<meta property="og:url" content="https://docs.python.org/3/library/cmdline.html" />10<meta property="og:site_name" content="Python documentation" />11<meta property="og:description" content="The following modules have a command-line interface. ast, asyncio, base64, calendar, code, compileall, cProfile: see profiling.tracing, dis, doctest, encodings.rot_13, ensurepip, filecmp, fileinput..." />12<meta property="og:image:width" content="1146" />13<meta property="og:image:height" content="600" />14<meta property="og:image" content="https://docs.python.org/3.15/_images/social_previews/summary_library_cmdline_fd26b6e5.png" />15<meta property="og:image:alt" content="The following modules have a command-line interface. ast, asyncio, base64, calendar, code, compileall, cProfile: see profiling.tracing, dis, doctest, encodings.rot_13, ensurepip, filecmp, fileinput..." />16<meta name="description" content="The following modules have a command-line interface. ast, asyncio, base64, calendar, code, compileall, cProfile: see profiling.tracing, dis, doctest, encodings.rot_13, ensurepip, filecmp, fileinput..." />17<meta name="twitter:card" content="summary_large_image" />18<meta name="theme-color" content="#3776ab">19 20 <title>Modules command-line interface (CLI) — Python 3.15.0a6 documentation</title><meta name="viewport" content="width=device-width, initial-scale=1.0">21 22 <link rel="stylesheet" type="text/css" href="../_static/pygments.css?v=b86133f3" />23 <link rel="stylesheet" type="text/css" href="../_static/classic.css?v=234b1a7c" />24 <link rel="stylesheet" type="text/css" href="../_static/pydoctheme.css?v=89a2f22a" />25 <link rel="stylesheet" type="text/css" href="../_static/profiling-sampling-visualization.css?v=0c2600ae" />26 <link id="pygments_dark_css" media="(prefers-color-scheme: dark)" rel="stylesheet" type="text/css" href="../_static/pygments_dark.css?v=5349f25f" />27 28 <script src="../_static/documentation_options.js?v=6b7c9ff5"></script>29 <script src="../_static/doctools.js?v=9bcbadda"></script>30 <script src="../_static/sphinx_highlight.js?v=dc90522c"></script>31 <script src="../_static/profiling-sampling-visualization.js?v=9811ed04"></script>32 33 <script src="../_static/sidebar.js"></script>34 35 <link rel="search" type="application/opensearchdescription+xml"36 title="Search within Python 3.15.0a6 documentation"37 href="../_static/opensearch.xml"/>38 <link rel="author" title="About these documents" href="../about.html" />39 <link rel="index" title="Index" href="../genindex.html" />40 <link rel="search" title="Search" href="../search.html" />41 <link rel="copyright" title="Copyright" href="../copyright.html" />42 <link rel="next" title="Superseded modules" href="superseded.html" />43 <link rel="prev" title="syslog — Unix syslog library routines" href="syslog.html" />44 45 46 <script defer file-types="bz2,epub,zip" data-domain="docs.python.org" src="https://analytics.python.org/js/script.file-downloads.outbound-links.js"></script>47 48 <link rel="canonical" href="https://docs.python.org/3/library/cmdline.html">49 50 51 52 53 <style>54 @media only screen {55 table.full-width-table {56 width: 100%;57 }58 }59 </style>60<link rel="stylesheet" href="../_static/pydoctheme_dark.css" media="(prefers-color-scheme: dark)" id="pydoctheme_dark_css">61 <link rel="shortcut icon" type="image/png" href="../_static/py.svg">62 <script type="text/javascript" src="../_static/copybutton.js"></script>63 <script type="text/javascript" src="../_static/menu.js"></script>64 <script type="text/javascript" src="../_static/search-focus.js"></script>65 <script type="text/javascript" src="../_static/themetoggle.js"></script> 66 <script type="text/javascript" src="../_static/rtd_switcher.js"></script>67 <meta name="readthedocs-addons-api-version" content="1">68 69 </head>70<body>71<div class="mobile-nav">72 <input type="checkbox" id="menuToggler" class="toggler__input" aria-controls="navigation"73 aria-pressed="false" aria-expanded="false" role="button" aria-label="Menu">74 <nav class="nav-content" role="navigation">75 <label for="menuToggler" class="toggler__label">76 <span></span>77 </label>78 <span class="nav-items-wrapper">79 <a href="https://www.python.org/" class="nav-logo">80 <img src="../_static/py.svg" alt="Python logo">81 </a>82 <span class="version_switcher_placeholder"></span>83 <form role="search" class="search" action="../search.html" method="get">84 <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" class="search-icon">85 <path fill-rule="nonzero" fill="currentColor" d="M15.5 14h-.79l-.28-.27a6.5 6.5 0 001.48-5.34c-.47-2.78-2.79-5-5.59-5.34a6.505 6.505 0 00-7.27 7.27c.34 2.8 2.56 5.12 5.34 5.59a6.5 6.5 0 005.34-1.48l.27.28v.79l4.25 4.25c.41.41 1.08.41 1.49 0 .41-.41.41-1.08 0-1.49L15.5 14zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"></path>86 </svg>87 <input placeholder="Quick search" aria-label="Quick search" type="search" name="q">88 <input type="submit" value="Go">89 </form>90 </span>91 </nav>92 <div class="menu-wrapper">93 <nav class="menu" role="navigation" aria-label="main navigation">94 <div class="language_switcher_placeholder"></div>95 96<label class="theme-selector-label">97 Theme98 <select class="theme-selector" oninput="activateTheme(this.value)">99 <option value="auto" selected>Auto</option>100 <option value="light">Light</option>101 <option value="dark">Dark</option>102 </select>103</label>104 <div>105 <h4>Previous topic</h4>106 <p class="topless"><a href="syslog.html"107 title="previous chapter"><code class="xref py py-mod docutils literal notranslate"><span class="pre">syslog</span></code> — Unix syslog library routines</a></p>108 </div>109 <div>110 <h4>Next topic</h4>111 <p class="topless"><a href="superseded.html"112 title="next chapter">Superseded modules</a></p>113 </div>114 <script>115 document.addEventListener('DOMContentLoaded', () => {116 const title = document.querySelector('meta[property="og:title"]').content;117 const elements = document.querySelectorAll('.improvepage');118 const pageurl = window.location.href.split('?')[0];119 elements.forEach(element => {120 const url = new URL(element.href.split('?')[0].replace("-nojs", ""));121 url.searchParams.set('pagetitle', title);122 url.searchParams.set('pageurl', pageurl);123 url.searchParams.set('pagesource', "library/cmdline.rst");124 element.href = url.toString();125 });126 });127 </script>128 <div role="note" aria-label="source link">129 <h3>This page</h3>130 <ul class="this-page-menu">131 <li><a href="../bugs.html">Report a bug</a></li>132 <li><a class="improvepage" href="../improve-page-nojs.html">Improve this page</a></li>133 <li>134 <a href="https://github.com/python/cpython/blob/main/Doc/library/cmdline.rst?plain=1"135 rel="nofollow">Show source136 </a>137 </li>138 139 </ul>140 </div>141 </nav>142 </div>143</div>144 145 146 <div class="related" role="navigation" aria-label="Related">147 <h3>Navigation</h3>148 <ul>149 <li class="right" style="margin-right: 10px">150 <a href="../genindex.html" title="General Index"151 accesskey="I">index</a></li>152 <li class="right" >153 <a href="../py-modindex.html" title="Python Module Index"154 >modules</a> |</li>155 <li class="right" >156 <a href="superseded.html" title="Superseded modules"157 accesskey="N">next</a> |</li>158 <li class="right" >159 <a href="syslog.html" title="syslog — Unix syslog library routines"160 accesskey="P">previous</a> |</li>161 162 <li><img src="../_static/py.svg" alt="Python logo" style="vertical-align: middle; margin-top: -1px"></li>163 <li><a href="https://www.python.org/">Python</a> »</li>164 <li class="switchers">165 <div class="language_switcher_placeholder"></div>166 <div class="version_switcher_placeholder"></div>167 </li>168 <li>169 170 </li>171 <li id="cpython-language-and-version">172 <a href="../index.html">3.15.0a6 Documentation</a> »173 </li>174 175 <li class="nav-item nav-item-1"><a href="index.html" accesskey="U">The Python Standard Library</a> »</li>176 <li class="nav-item nav-item-this"><a href="">Modules command-line interface (CLI)</a></li>177 <li class="right">178 179 180 <div class="inline-search" role="search">181 <form class="inline-search" action="../search.html" method="get">182 <input placeholder="Quick search" aria-label="Quick search" type="search" name="q" id="search-box">183 <input type="submit" value="Go">184 </form>185 </div>186 |187 </li>188 <li class="right">189<label class="theme-selector-label">190 Theme191 <select class="theme-selector" oninput="activateTheme(this.value)">192 <option value="auto" selected>Auto</option>193 <option value="light">Light</option>194 <option value="dark">Dark</option>195 </select>196</label> |</li>197 198 </ul>199 </div> 200 201 <div class="document">202 <div class="documentwrapper">203 <div class="bodywrapper">204 <div class="body" role="main">205 206 <section id="modules-command-line-interface-cli">207<span id="library-cmdline"></span><h1>Modules command-line interface (CLI)<a class="headerlink" href="#modules-command-line-interface-cli" title="Link to this heading">¶</a></h1>208<p>The following modules have a command-line interface.</p>209<ul class="simple">210<li><p><a class="reference internal" href="ast.html#ast-cli"><span class="std std-ref">ast</span></a></p></li>211<li><p><a class="reference internal" href="asyncio.html#asyncio-cli"><span class="std std-ref">asyncio</span></a></p></li>212<li><p><a class="reference internal" href="base64.html#module-base64" title="base64: RFC 4648: Base16, Base32, Base64 Data Encodings; Base85 and Ascii85"><code class="xref py py-mod docutils literal notranslate"><span class="pre">base64</span></code></a></p></li>213<li><p><a class="reference internal" href="calendar.html#calendar-cli"><span class="std std-ref">calendar</span></a></p></li>214<li><p><a class="reference internal" href="code.html#module-code" title="code: Facilities to implement read-eval-print loops."><code class="xref py py-mod docutils literal notranslate"><span class="pre">code</span></code></a></p></li>215<li><p><a class="reference internal" href="compileall.html#compileall-cli"><span class="std std-ref">compileall</span></a></p></li>216<li><p><code class="docutils literal notranslate"><span class="pre">cProfile</span></code>: see <a class="reference internal" href="profiling.tracing.html#profiling-tracing-cli"><span class="std std-ref">profiling.tracing</span></a></p></li>217<li><p><a class="reference internal" href="dis.html#dis-cli"><span class="std std-ref">dis</span></a></p></li>218<li><p><a class="reference internal" href="doctest.html#doctest-cli"><span class="std std-ref">doctest</span></a></p></li>219<li><p><code class="xref py py-mod docutils literal notranslate"><span class="pre">encodings.rot_13</span></code></p></li>220<li><p><a class="reference internal" href="ensurepip.html#ensurepip-cli"><span class="std std-ref">ensurepip</span></a></p></li>221<li><p><a class="reference internal" href="filecmp.html#module-filecmp" title="filecmp: Compare files efficiently."><code class="xref py py-mod docutils literal notranslate"><span class="pre">filecmp</span></code></a></p></li>222<li><p><a class="reference internal" href="fileinput.html#module-fileinput" title="fileinput: Loop over standard input or a list of files."><code class="xref py py-mod docutils literal notranslate"><span class="pre">fileinput</span></code></a></p></li>223<li><p><a class="reference internal" href="ftplib.html#module-ftplib" title="ftplib: FTP protocol client (requires sockets)."><code class="xref py py-mod docutils literal notranslate"><span class="pre">ftplib</span></code></a></p></li>224<li><p><a class="reference internal" href="gzip.html#gzip-cli"><span class="std std-ref">gzip</span></a></p></li>225<li><p><a class="reference internal" href="http.server.html#http-server-cli"><span class="std std-ref">http.server</span></a></p></li>226<li><p><a class="reference internal" href="idle.html#idlelib-cli"><span class="std std-ref">idlelib</span></a></p></li>227<li><p><a class="reference internal" href="inspect.html#inspect-module-cli"><span class="std std-ref">inspect</span></a></p></li>228<li><p><a class="reference internal" href="json.html#json-commandline"><span class="std std-ref">json</span></a></p></li>229<li><p><a class="reference internal" href="mimetypes.html#mimetypes-cli"><span class="std std-ref">mimetypes</span></a></p></li>230<li><p><a class="reference internal" href="pdb.html#pdb-cli"><span class="std std-ref">pdb</span></a></p></li>231<li><p><a class="reference internal" href="pickle.html#pickle-cli"><span class="std std-ref">pickle</span></a></p></li>232<li><p><a class="reference internal" href="pickletools.html#pickletools-cli"><span class="std std-ref">pickletools</span></a></p></li>233<li><p><a class="reference internal" href="platform.html#platform-cli"><span class="std std-ref">platform</span></a></p></li>234<li><p><a class="reference internal" href="poplib.html#module-poplib" title="poplib: POP3 protocol client (requires sockets)."><code class="xref py py-mod docutils literal notranslate"><span class="pre">poplib</span></code></a></p></li>235<li><p><a class="reference internal" href="profiling.sampling.html#profiling-sampling"><span class="std std-ref">profiling.sampling</span></a></p></li>236<li><p><a class="reference internal" href="profiling.tracing.html#profiling-tracing-cli"><span class="std std-ref">profiling.tracing</span></a></p></li>237<li><p><a class="reference internal" href="pstats.html#pstats-cli"><span class="std std-ref">pstats</span></a></p></li>238<li><p><a class="reference internal" href="py_compile.html#py-compile-cli"><span class="std std-ref">py_compile</span></a></p></li>239<li><p><a class="reference internal" href="pyclbr.html#module-pyclbr" title="pyclbr: Supports information extraction for a Python module browser."><code class="xref py py-mod docutils literal notranslate"><span class="pre">pyclbr</span></code></a></p></li>240<li><p><a class="reference internal" href="pydoc.html#module-pydoc" title="pydoc: Documentation generator and online help system."><code class="xref py py-mod docutils literal notranslate"><span class="pre">pydoc</span></code></a></p></li>241<li><p><a class="reference internal" href="quopri.html#module-quopri" title="quopri: Encode and decode files using the MIME quoted-printable encoding."><code class="xref py py-mod docutils literal notranslate"><span class="pre">quopri</span></code></a></p></li>242<li><p><a class="reference internal" href="random.html#random-cli"><span class="std std-ref">random</span></a></p></li>243<li><p><a class="reference internal" href="runpy.html#module-runpy" title="runpy: Locate and run Python modules without importing them first."><code class="xref py py-mod docutils literal notranslate"><span class="pre">runpy</span></code></a></p></li>244<li><p><a class="reference internal" href="site.html#site-commandline"><span class="std std-ref">site</span></a></p></li>245<li><p><a class="reference internal" href="sqlite3.html#sqlite3-cli"><span class="std std-ref">sqlite3</span></a></p></li>246<li><p><a class="reference internal" href="symtable.html#symtable-cli"><span class="std std-ref">symtable</span></a></p></li>247<li><p><a class="reference internal" href="sysconfig.html#sysconfig-cli"><span class="std std-ref">sysconfig</span></a></p></li>248<li><p><a class="reference internal" href="tabnanny.html#module-tabnanny" title="tabnanny: Tool for detecting white space related problems in Python source files in a directory tree."><code class="xref py py-mod docutils literal notranslate"><span class="pre">tabnanny</span></code></a></p></li>249<li><p><a class="reference internal" href="tarfile.html#tarfile-commandline"><span class="std std-ref">tarfile</span></a></p></li>250<li><p><code class="xref py py-mod docutils literal notranslate"><span class="pre">this</span></code></p></li>251<li><p><a class="reference internal" href="timeit.html#timeit-command-line-interface"><span class="std std-ref">timeit</span></a></p></li>252<li><p><a class="reference internal" href="tokenize.html#tokenize-cli"><span class="std std-ref">tokenize</span></a></p></li>253<li><p><a class="reference internal" href="trace.html#trace-cli"><span class="std std-ref">trace</span></a></p></li>254<li><p><a class="reference internal" href="turtle.html#module-turtledemo" title="turtledemo: A viewer for example turtle scripts"><code class="xref py py-mod docutils literal notranslate"><span class="pre">turtledemo</span></code></a></p></li>255<li><p><a class="reference internal" href="unittest.html#unittest-command-line-interface"><span class="std std-ref">unittest</span></a></p></li>256<li><p><a class="reference internal" href="uuid.html#uuid-cli"><span class="std std-ref">uuid</span></a></p></li>257<li><p><a class="reference internal" href="venv.html#venv-cli"><span class="std std-ref">venv</span></a></p></li>258<li><p><a class="reference internal" href="webbrowser.html#webbrowser-cli"><span class="std std-ref">webbrowser</span></a></p></li>259<li><p><a class="reference internal" href="zipapp.html#zipapp-command-line-interface"><span class="std std-ref">zipapp</span></a></p></li>260<li><p><a class="reference internal" href="zipfile.html#zipfile-commandline"><span class="std std-ref">zipfile</span></a></p></li>261</ul>262<p>See also the <a class="reference internal" href="../using/cmdline.html#using-on-general"><span class="std std-ref">Python command-line interface</span></a>.</p>263</section>264 265 266 <div class="clearer"></div>267 </div>268 </div>269 </div>270 <div class="sphinxsidebar" role="navigation" aria-label="Main">271 <div class="sphinxsidebarwrapper">272 <div>273 <h4>Previous topic</h4>274 <p class="topless"><a href="syslog.html"275 title="previous chapter"><code class="xref py py-mod docutils literal notranslate"><span class="pre">syslog</span></code> — Unix syslog library routines</a></p>276 </div>277 <div>278 <h4>Next topic</h4>279 <p class="topless"><a href="superseded.html"280 title="next chapter">Superseded modules</a></p>281 </div>282 <script>283 document.addEventListener('DOMContentLoaded', () => {284 const title = document.querySelector('meta[property="og:title"]').content;285 const elements = document.querySelectorAll('.improvepage');286 const pageurl = window.location.href.split('?')[0];287 elements.forEach(element => {288 const url = new URL(element.href.split('?')[0].replace("-nojs", ""));289 url.searchParams.set('pagetitle', title);290 url.searchParams.set('pageurl', pageurl);291 url.searchParams.set('pagesource', "library/cmdline.rst");292 element.href = url.toString();293 });294 });295 </script>296 <div role="note" aria-label="source link">297 <h3>This page</h3>298 <ul class="this-page-menu">299 <li><a href="../bugs.html">Report a bug</a></li>300 <li><a class="improvepage" href="../improve-page-nojs.html">Improve this page</a></li>301 <li>302 <a href="https://github.com/python/cpython/blob/main/Doc/library/cmdline.rst?plain=1"303 rel="nofollow">Show source304 </a>305 </li>306 307 </ul>308 </div>309 </div>310<div id="sidebarbutton" title="Collapse sidebar">311<span>«</span>312</div>313 314 </div>315 <div class="clearer"></div>316 </div> 317 <div class="related" role="navigation" aria-label="Related">318 <h3>Navigation</h3>319 <ul>320 <li class="right" style="margin-right: 10px">321 <a href="../genindex.html" title="General Index"322 >index</a></li>323 <li class="right" >324 <a href="../py-modindex.html" title="Python Module Index"325 >modules</a> |</li>326 <li class="right" >327 <a href="superseded.html" title="Superseded modules"328 >next</a> |</li>329 <li class="right" >330 <a href="syslog.html" title="syslog — Unix syslog library routines"331 >previous</a> |</li>332 333 <li><img src="../_static/py.svg" alt="Python logo" style="vertical-align: middle; margin-top: -1px"></li>334 <li><a href="https://www.python.org/">Python</a> »</li>335 <li class="switchers">336 <div class="language_switcher_placeholder"></div>337 <div class="version_switcher_placeholder"></div>338 </li>339 <li>340 341 </li>342 <li id="cpython-language-and-version">343 <a href="../index.html">3.15.0a6 Documentation</a> »344 </li>345 346 <li class="nav-item nav-item-1"><a href="index.html" >The Python Standard Library</a> »</li>347 <li class="nav-item nav-item-this"><a href="">Modules command-line interface (CLI)</a></li>348 <li class="right">349 350 351 <div class="inline-search" role="search">352 <form class="inline-search" action="../search.html" method="get">353 <input placeholder="Quick search" aria-label="Quick search" type="search" name="q" id="search-box">354 <input type="submit" value="Go">355 </form>356 </div>357 |358 </li>359 <li class="right">360<label class="theme-selector-label">361 Theme362 <select class="theme-selector" oninput="activateTheme(this.value)">363 <option value="auto" selected>Auto</option>364 <option value="light">Light</option>365 <option value="dark">Dark</option>366 </select>367</label> |</li>368 369 </ul>370 </div> 371 <div class="footer">372 © <a href="../copyright.html">Copyright</a> 2001 Python Software Foundation.373 <br>374 This page is licensed under the Python Software Foundation License Version 2.375 <br>376 Examples, recipes, and other code in the documentation are additionally licensed under the Zero Clause BSD License.377 <br>378 379 See <a href="/license.html">History and License</a> for more information.<br>380 381 382 <br>383 384 The Python Software Foundation is a non-profit corporation.385<a href="https://www.python.org/psf/donations/">Please donate.</a>386<br>387 <br>388 Last updated on Mar 10, 2026 (08:58 UTC).389 390 <a href="/bugs.html">Found a bug</a>?391 392 <br>393 394 Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 8.2.3.395 </div>396 397 </body>398</html>