INNER CODE UNIT · Python
OpenArcCLI
SearchSavior/OpenArc · src/cli/main.py:45
class OpenArcCLI:
def __init__(self, base_url=None, api_key=None, server_config=None):
if base_url is None and server_config is not None:
base_url = server_config.get_base_url()
self.base_url = base_url
self.api_key = api_key or os.getenv('OPENARC_API_KEY')
def get_headers(self):
"""Get headers for API requests."""
headers = {'Content-Type': 'application/json'}
if self.api_key:
headers['Authorization'] = f'Bearer {self.api_key}'
return headers
class ColoredAsciiArtGroup(click.RichGroup):
"""Custom Click group with cached ASCII art banner for performance."""