# Restore tunacode.cli.main Import Compatibility

> Release validation exposed that tunacode.cli.main no longer existed after the CLI entrypoint moved to tunacode.ui.main, breaking import checks and any downstream scripts using the old path.

- Skill: `tools-only/restore-tunacode-cli-main-import-compatibility` (Agent Skill, multi-file: 3 files)
- Install (CLI): `npx skillmds@latest add tools-only/restore-tunacode-cli-main-import-compatibility`
- Raw SKILL.md: https://api.skillmd.com/api/skills/tools-only/restore-tunacode-cli-main-import-compatibility/raw
- Safety review: pending (external: skill-scanner PASS, skillspector PASS)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: tools-only (https://skillmd.com/u/tools-only)
- Updated: 2026-09-29
- Page: https://skillmd.com/skills/tools-only/restore-tunacode-cli-main-import-compatibility

---


# Restore tunacode.cli.main Import Compatibility

## Summary

Release validation exposed that `tunacode.cli.main` no longer existed after the CLI entrypoint moved to `tunacode.ui.main`, breaking import checks and any downstream scripts using the old path. We added a small compatibility shim that re-exports the Typer app and aligned linted `isinstance` checks with PEP 604 unions to keep release tooling green.

## Context

- File: `src/tunacode/cli/main.py`
- Symptom: `ModuleNotFoundError` on `from tunacode.cli.main import app` during release testing.

## Root Cause

The CLI entrypoint was consolidated under `tunacode.ui.main` without leaving a compatibility package for the previous import path, so older references failed at import time.

## Changes

- Added a `tunacode.cli` package with a `main.py` shim that re-exports `app` from `tunacode.ui.main`.
- Re-exported `app` in `tunacode.cli.__init__` for convenience.
- Swapped tuple-based `isinstance` checks to PEP 604 union syntax to satisfy ruff pre-flight checks.

## Behavioral Impact

- `tunacode.cli.main` imports now resolve without errors.
- CLI behavior remains unchanged because the entrypoint still delegates to `tunacode.ui.main`.

## Related Cards

- [[cli-entrypoint]]

