142 lines
4.6 KiB
HTML
142 lines
4.6 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>CLI Reference - pyserve</title>
|
|
<link rel="stylesheet" href="../style.css">
|
|
</head>
|
|
<body>
|
|
<div id="container">
|
|
<div id="header">
|
|
<h1>pyserve</h1>
|
|
<div class="tagline">python application orchestrator</div>
|
|
</div>
|
|
|
|
<div class="breadcrumb">
|
|
<a href="../index.html">pyserve</a> » <a href="/reference/">Reference</a> » CLI
|
|
</div>
|
|
|
|
<div id="content">
|
|
<h2>CLI Reference</h2>
|
|
|
|
<p>pyserve provides a command-line interface for server management.</p>
|
|
|
|
<h3>Synopsis</h3>
|
|
<pre>pyserve [OPTIONS]</pre>
|
|
|
|
<h3>Options</h3>
|
|
|
|
<table class="dirindex">
|
|
<tr>
|
|
<td><code>-c, --config FILE</code></td>
|
|
<td>Path to configuration file</td>
|
|
<td class="desc">Default: <code>config.yaml</code></td>
|
|
</tr>
|
|
<tr>
|
|
<td><code>--host HOST</code></td>
|
|
<td>Bind address</td>
|
|
<td class="desc">Overrides config value</td>
|
|
</tr>
|
|
<tr>
|
|
<td><code>--port PORT</code></td>
|
|
<td>Listen port</td>
|
|
<td class="desc">Overrides config value</td>
|
|
</tr>
|
|
<tr>
|
|
<td><code>--debug</code></td>
|
|
<td>Enable debug mode</td>
|
|
<td class="desc">Sets log level to DEBUG</td>
|
|
</tr>
|
|
<tr>
|
|
<td><code>--version</code></td>
|
|
<td>Show version and exit</td>
|
|
<td class="desc"></td>
|
|
</tr>
|
|
<tr>
|
|
<td><code>--help</code></td>
|
|
<td>Show help message and exit</td>
|
|
<td class="desc"></td>
|
|
</tr>
|
|
</table>
|
|
|
|
<h3>Examples</h3>
|
|
|
|
<p><strong>Start with default configuration:</strong></p>
|
|
<pre>pyserve</pre>
|
|
|
|
<p><strong>Start with custom config file:</strong></p>
|
|
<pre>pyserve -c /path/to/config.yaml</pre>
|
|
|
|
<p><strong>Override host and port:</strong></p>
|
|
<pre>pyserve --host 127.0.0.1 --port 9000</pre>
|
|
|
|
<p><strong>Enable debug mode:</strong></p>
|
|
<pre>pyserve --debug</pre>
|
|
|
|
<p><strong>Show version:</strong></p>
|
|
<pre>pyserve --version
|
|
<span class="comment"># Output: pyserve 0.7.0</span></pre>
|
|
|
|
<h3>Configuration Priority</h3>
|
|
<p>Settings are applied in the following order (later overrides earlier):</p>
|
|
<ol class="indent">
|
|
<li>Default values</li>
|
|
<li>Configuration file (<code>config.yaml</code>)</li>
|
|
<li>Command-line options</li>
|
|
</ol>
|
|
|
|
<h3>Default Configuration</h3>
|
|
<p>If no configuration file is found, pyserve uses default settings:</p>
|
|
<ul class="indent">
|
|
<li>Host: <code>0.0.0.0</code></li>
|
|
<li>Port: <code>8080</code></li>
|
|
<li>Log level: <code>INFO</code></li>
|
|
</ul>
|
|
|
|
<h3>Exit Codes</h3>
|
|
<table class="dirindex">
|
|
<tr>
|
|
<td><code>0</code></td>
|
|
<td>Success / Clean shutdown</td>
|
|
</tr>
|
|
<tr>
|
|
<td><code>1</code></td>
|
|
<td>Configuration error or startup failure</td>
|
|
</tr>
|
|
</table>
|
|
|
|
<h3>Signals</h3>
|
|
<p>pyserve handles the following signals:</p>
|
|
<table class="dirindex">
|
|
<tr>
|
|
<td><code>SIGINT</code> (Ctrl+C)</td>
|
|
<td>Graceful shutdown</td>
|
|
</tr>
|
|
<tr>
|
|
<td><code>SIGTERM</code></td>
|
|
<td>Graceful shutdown</td>
|
|
</tr>
|
|
</table>
|
|
|
|
<h3>Development Commands (Makefile)</h3>
|
|
<p>When working with the source repository, use make commands:</p>
|
|
|
|
<pre>make run <span class="comment"># Start in development mode</span>
|
|
make run-prod <span class="comment"># Start in production mode</span>
|
|
make test <span class="comment"># Run tests</span>
|
|
make test-cov <span class="comment"># Tests with coverage</span>
|
|
make lint <span class="comment"># Check code with linters</span>
|
|
make format <span class="comment"># Format code</span>
|
|
make build <span class="comment"># Build wheel package</span>
|
|
make clean <span class="comment"># Clean temporary files</span>
|
|
make help <span class="comment"># Show all commands</span></pre>
|
|
</div>
|
|
|
|
<div id="footer">
|
|
<p>pyserve © 2024-2025 | MIT License</p>
|
|
</div>
|
|
</div>
|
|
</body>
|
|
</html>
|