Skip to content

Add --port CLI flag to configure the API server port #101

Description

@alimaandev

Summary

The API server (desktop/api_server.py) hardcodes its bind address to \127.0.0.1:8080\ (line ~1608) and is launched from main.py via python api_server.py (lines ~88-92). The port cannot be changed without editing code.

Goal

Add a --port CLI flag to main.py so users can run python main.py --ui --port 9090 (or similar) and the API server binds to the chosen port. The flag should default to 8080.

Tasks

  • Add --port argument to the argparse parser in main.py
  • Pass the port through to the �pi_cmd subprocess launch
  • Update docs/api.md / README quick-start if port is mentioned

Acceptance criteria

  • python main.py --ui --port 9090 launches the API server on 9090
  • Default behavior unchanged (8080)
  • A small test exists in ests/test_main.py asserting the flag default

Labels

good first issue, help wanted

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions