6f1158a2d7
DeepSeek TUI - Unofficial terminal UI + CLI for DeepSeek models. Features: - Interactive TUI with multiple modes (Normal, Plan, Agent, YOLO, RLM, Duo) - Comprehensive tool access with approval gating - File operations, shell execution, task management - Sub-agent system for parallel work - MCP integration for external tool servers - Session management and skills system - Cross-platform support (macOS, Linux, Windows) 🤖 Generated with [Claude Code](https://claude.ai/code)
35 lines
980 B
Python
35 lines
980 B
Python
from importlib.metadata import PackageNotFoundError, version
|
|
from pathlib import Path
|
|
from typing import Optional
|
|
import re
|
|
|
|
__all__ = ["__version__"]
|
|
|
|
|
|
def _version_from_metadata() -> Optional[str]:
|
|
for dist_name in ("DeepSeek-CLI", "deepseek-cli", "DeepSeek_CLI"):
|
|
try:
|
|
return version(dist_name)
|
|
except PackageNotFoundError:
|
|
continue
|
|
return None
|
|
|
|
|
|
def _version_from_pyproject() -> Optional[str]:
|
|
this_file = Path(__file__).resolve()
|
|
for parent in list(this_file.parents)[:6]:
|
|
candidate = parent / "pyproject.toml"
|
|
if not candidate.exists():
|
|
continue
|
|
try:
|
|
contents = candidate.read_text(encoding="utf-8")
|
|
except OSError:
|
|
continue
|
|
match = re.search(r'(?m)^version\\s*=\\s*"([^"]+)"\\s*$', contents)
|
|
if match:
|
|
return match.group(1)
|
|
return None
|
|
|
|
|
|
__version__ = _version_from_metadata() or _version_from_pyproject() or "0.0.0"
|