package main

import "core:fmt"
import "../core"
import "../shared"

main :: proc() {
	cfg := shared.load_config()
	state := core.new_initial_state()
	defer core.dispose_state(&state)

	fmt.println("comic-odin: phase6 cli runtime")
	fmt.printf("DeepSeek configured: %v\n", len(cfg.deepseek_api_key) > 0)

	out, err := run_cli_from_process_args(&state)
	if !shared.is_ok(err) {
		fmt.printf("Error: %s\n", err.message)
		if len(out) > 0 {
			fmt.println(out)
		}
		return
	}

	fmt.println(out)
}
