continue-custom/server/continuedev/headless/__init__.py
Nate Sesti 279593a848
Strong typing (#533)
* refactor: ♻️ get rid of continuedev.src.continuedev structure

* refactor: ♻️ switching back to server folder

* feat: ✨ make config.py imports shorter

* feat: 🔖 publish as pre-release vscode extension

* refactor: ♻️ refactor and add more completion params to ui

* build: 🏗️ download from preview S3
2023-10-04 23:47:59 -07:00

20 lines
555 B
Python

from typing import Optional, Union
import typer
from ..core.config import ContinueConfig
from ..server.session_manager import Session, session_manager
from .headless_ide import LocalIdeProtocol
app = typer.Typer()
async def start_headless_session(
config: Optional[Union[str, ContinueConfig]] = None
) -> Session:
if config is not None:
if isinstance(config, str):
config: ContinueConfig = ContinueConfig.from_filepath(config)
ide = LocalIdeProtocol()
return await session_manager.new_session(ide, config=config)