From 57ef134cc3304233c6d0016714326975e7f5e5da Mon Sep 17 00:00:00 2001 From: 7000pctAUTO Date: Fri, 30 Jan 2026 18:57:27 +0000 Subject: [PATCH] Add core source files: main, models, config --- src/codexchange/main.py | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 src/codexchange/main.py diff --git a/src/codexchange/main.py b/src/codexchange/main.py new file mode 100644 index 0000000..65d35de --- /dev/null +++ b/src/codexchange/main.py @@ -0,0 +1,35 @@ +"""Main entry point for CodeXchange CLI.""" + +import typer + +from codexchange.config import get_config +from codexchange.cli.commands import convert_cmd, batch_convert_cmd, list_models_cmd, list_languages_cmd + +app = typer.Typer( + name="codexchange", + help="CodeXchange CLI - Convert code between programming languages using local LLMs", + add_completion=False +) + +app.command("convert", help="Convert a single file from one language to another")(convert_cmd) +app.command("batch-convert", help="Convert multiple files in a directory")(batch_convert_cmd) +app.command("list-models", help="List available Ollama models")(list_models_cmd) +app.command("list-languages", help="List supported programming languages")(list_languages_cmd) + + +@app.callback() +def callback( + verbose: bool = typer.Option(False, "--verbose", "-v", help="Enable verbose output"), +) -> None: + """CodeXchange CLI - Convert code between programming languages using local LLMs.""" + config = get_config() + config.verbose = verbose + + +def main() -> None: + """Entry point for the CLI application.""" + app() + + +if __name__ == "__main__": + main()