Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions src/kimi_cli/share.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
from __future__ import annotations

import os
from functools import lru_cache
from pathlib import Path


@lru_cache(maxsize=1)
Comment thread
gugu8intel-i9 marked this conversation as resolved.
def get_share_dir() -> Path:
"""Get the share directory path."""
if share_dir := os.getenv("KIMI_SHARE_DIR"):
share_dir = Path(share_dir)
else:
share_dir = Path.home() / ".kimi"
"""Return the Kimi share directory, creating it if necessary."""
share_dir = Path(os.environ.get("KIMI_SHARE_DIR", "~/.kimi")).expanduser()
share_dir.mkdir(parents=True, exist_ok=True)
return share_dir
Loading