MoonshotAI / MoonshotAI/kimi-code

feat(cli): expand a leading tilde in KIMI_CODE_HOME

Open
#2,543 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
7.5k
Forks
1.2k
Avg merge
11h 53m
Merged PRs (30d)
350

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the centralized CLI data-path helper and inspect the focused unit-test setup. Verify that only ~ and ~/... (with the platform separator equivalent) expand under the current home directory, while other values remain unchanged. Update the English and Chinese environment-variable references, and finish when the tests and both documents cover the supported behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
cli, documentation
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
75/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.