|
| 1 | +""" |
| 2 | +Main entry point for poly_lithic CLI. |
| 3 | +
|
| 4 | +Provides backward compatibility while supporting new Click-based commands. |
| 5 | +""" |
| 6 | + |
| 7 | + |
1 | 8 | def main(): |
2 | | - import asyncio |
3 | | - import logging |
4 | | - import os |
5 | | - from poly_lithic.src.cli import model_main, setup |
6 | | - from poly_lithic.src.logging_utils import make_logger, reset_logging |
| 9 | + """ |
| 10 | + Main entry point that supports both old and new CLI styles. |
7 | 11 |
|
8 | | - logger = make_logger('model_manager') |
9 | | - logger.info('Starting model manager') |
| 12 | + Old style (still works): |
| 13 | + python -m poly_lithic.scripts.main --config config.yaml --debug |
10 | 14 |
|
11 | | - (args, config, broker) = setup() |
12 | | - print('resetting logging...') |
13 | | - reset_logging() |
| 15 | + New style (recommended): |
| 16 | + poly-lithic --config config.yaml --debug |
| 17 | + poly-lithic run --config config.yaml |
| 18 | + poly-lithic plugin init --name my-plugin |
| 19 | + """ |
| 20 | + import sys |
| 21 | + from poly_lithic.src.cli import cli |
14 | 22 |
|
15 | | - if os.environ.get('DEBUG') == 'True': |
16 | | - logger = make_logger('model_manager', level=logging.DEBUG) |
17 | | - else: |
18 | | - logger = make_logger('model_manager') |
| 23 | + # If no arguments, show help |
| 24 | + if len(sys.argv) == 1: |
| 25 | + sys.argv.append('--help') |
19 | 26 |
|
20 | | - asyncio.run(model_main(args, config, broker)) |
| 27 | + # Run the Click CLI |
| 28 | + cli() |
21 | 29 |
|
22 | 30 |
|
23 | 31 | if __name__ == '__main__': |
|
0 commit comments