Skip to content

feat(cli): expand a leading tilde in KIMI_CODE_HOME #2543

Description

@tagadearpit

Problem

KIMI_CODE_HOME is returned verbatim by the CLI path helper. A commonly used value such as KIMI_CODE_HOME="~/.local/share/kimi-code" therefore remains a relative path containing a literal ~, instead of resolving under the user's home directory.

This is easy to trigger because environment-variable values are often quoted in shell profiles, where tilde expansion does not occur.

Proposed behavior

Expand only these forms:

  • ~ to the current home directory
  • ~/... (and the platform separator equivalent) under the current home directory

Keep other values unchanged, including ~user/..., to avoid implementing user-account lookup semantics.

Scope

  • centralize the expansion in the CLI data-path helper
  • add focused unit tests
  • document the supported behavior in the English and Chinese environment-variable references

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions