CLI Reference

pyserve provides a command-line interface for server management.

Synopsis

pyserve [OPTIONS]

Options

-c, --config FILE Path to configuration file Default: config.yaml
--host HOST Bind address Overrides config value
--port PORT Listen port Overrides config value
--debug Enable debug mode Sets log level to DEBUG
--version Show version and exit
--help Show help message and exit

Examples

Start with default configuration:

pyserve

Start with custom config file:

pyserve -c /path/to/config.yaml

Override host and port:

pyserve --host 127.0.0.1 --port 9000

Enable debug mode:

pyserve --debug

Show version:

pyserve --version
# Output: pyserve 0.7.0

Configuration Priority

Settings are applied in the following order (later overrides earlier):

  1. Default values
  2. Configuration file (config.yaml)
  3. Command-line options

Default Configuration

If no configuration file is found, pyserve uses default settings:

Exit Codes

0 Success / Clean shutdown
1 Configuration error or startup failure

Signals

pyserve handles the following signals:

SIGINT (Ctrl+C) Graceful shutdown
SIGTERM Graceful shutdown

Development Commands (Makefile)

When working with the source repository, use make commands:

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