/**
 * Status CLI Command Handler
 *
 * Handles `sandcode status` — shows project tracking info.
 */

import chalk from 'chalk'
import { getStatusReport, loadTrackerState } from '../../services/projectTracker/index.js'

/**
 * Show project status report.
 */
export async function statusHandler(options: { json?: boolean }): Promise<void> {
  if (options.json) {
    const state = await loadTrackerState()
    // biome-ignore lint/suspicious/noConsole:: intentional output
    console.log(JSON.stringify(state, null, 2))
    return
  }

  const report = await getStatusReport()
  // biome-ignore lint/suspicious/noConsole:: intentional output
  console.log(report)
}
