145 lines
4.8 KiB
HTML
145 lines
4.8 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">
|
|
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/github-dark.min.css">
|
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js"></script>
|
|
<script>hljs.highlightAll();</script>
|
|
</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">Home</a> / <a href="index.html">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><code class="language-bash">pyserve [OPTIONS]</code></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><code class="language-bash">pyserve</code></pre>
|
|
|
|
<p><strong>Start with custom config file:</strong></p>
|
|
<pre><code class="language-bash">pyserve -c /path/to/config.yaml</code></pre>
|
|
|
|
<p><strong>Override host and port:</strong></p>
|
|
<pre><code class="language-bash">pyserve --host 127.0.0.1 --port 9000</code></pre>
|
|
|
|
<p><strong>Enable debug mode:</strong></p>
|
|
<pre><code class="language-bash">pyserve --debug</code></pre>
|
|
|
|
<p><strong>Show version:</strong></p>
|
|
<pre><code class="language-bash">pyserve --version
|
|
# Output: pyserve 0.7.0</code></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><code class="language-bash">make run # Start in development mode
|
|
make run-prod # Start in production mode
|
|
make test # Run tests
|
|
make test-cov # Tests with coverage
|
|
make lint # Check code with linters
|
|
make format # Format code
|
|
make build # Build wheel package
|
|
make clean # Clean temporary files
|
|
make help # Show all commands</code></pre>
|
|
</div>
|
|
|
|
<div id="footer">
|
|
<p>pyserve © 2024-2025 | MIT License</p>
|
|
</div>
|
|
</div>
|
|
</body>
|
|
</html>
|