#!/usr/bin/env python3
import os
import sys
from github_code_review.config import Config
from github_code_review.server import GitHubCodeReviewServer
def main():
# Load configuration
config = Config.from_args()
# Validate token
if not config.token:
print("ERROR: GITHUB_PERSONAL_ACCESS_TOKEN environment variable not set", file=sys.stderr)
sys.exit(1)
# Create and run server
server = GitHubCodeReviewServer(
version="0.1.0",
token=config.token,
host=config.host,
read_only=config.read_only
)
# Run server
server.run_stdio()
if __name__ == "__main__":
main()