License for Kimi-CLI: Apache 2.0 Terms and Usage Rights
Kimi-CLI is released under the Apache License 2.0, a permissive open-source license that grants rights to use, modify, distribute, and sublicense the code with explicit patent protection.
The MoonshotAI/kimi-cli repository and all its constituent sub-packages are governed by the Apache License 2.0. This license governs the main CLI tool as well as the supporting SDKs and utility packages within the monorepo structure.
Apache 2.0: The Official License for Kimi-CLI
According to the source code in the MoonshotAI/kimi-cli repository, the project adopts the Apache License 2.0 as its sole license. The full text of the license is located in the repository's top-level LICENSE file, which establishes the legal terms for the entire codebase.
The Apache 2.0 license is a permissive open-source license that provides an explicit patent grant to downstream users. This means contributors cannot sue users for patent infringement regarding code they contribute to the project. The license requires that redistributions of the code, whether in source or binary form, must retain the original copyright notice and include a copy of the license text.
Where to Find the License Files
The license for kimi-cli is documented in multiple locations throughout the repository to ensure compliance across the monorepo structure:
LICENSE— The primary license file at the repository root containing the complete Apache 2.0 text.sdks/kimi-sdk/LICENSE— License file for the Kimi SDK sub-package.packages/kosong/LICENSE— License file for the Kosong LLM abstraction library.packages/kaos/LICENSE— License file for the Kaos OS-abstraction utilities.pyproject.toml— Project configuration file that includeslicense = "Apache-2.0"metadata for Python package distribution.
Each sub-package maintains its own LICENSE file with identical Apache 2.0 terms, ensuring consistent licensing across the entire project boundary.
Rights Granted Under the Apache 2.0 License
The license for kimi-cli grants users specific rights while imposing minimal requirements:
- Use — You may use the software for any purpose, including commercial applications.
- Modification — You may alter the source code to suit your needs.
- Distribution — You may distribute original or modified copies of the software.
- Sublicensing — You may grant sublicenses to third parties.
- Patent Rights — The license includes an express grant of patent rights from contributors to users.
To exercise these rights, you must include the original copyright notice and a copy of the Apache 2.0 license in any redistribution. The license also states that distributed software is provided "AS IS" without warranties or conditions of any kind.
Verifying the License Programmatically
You can confirm the license for kimi-cli programmatically after installation by inspecting the package metadata:
# Install the package
pip install kimi-cli
# Verify the license metadata
python -c "import importlib.metadata as m; print(m.metadata('kimi-cli')['License'])"
The expected output is Apache-2.0, which corresponds to the license declaration in pyproject.toml.
Applying the Apache 2.0 Header to New Contributions
When contributing new source files to the MoonshotAI/kimi-cli repository, you should include the standard Apache 2.0 header. Here is the template as specified in the project standards:
# Example: Adding the Apache-2.0 header to a new source file
# ---------------------------------------------------------
# Copyright © <year> Moonshot AI
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
def hello():
print("Hello from Kimi-CLI!")
Replace <year> with the current year and ensure the copyright holder is listed as "Moonshot AI" or the appropriate entity.
Summary
- The license for kimi-cli is Apache License 2.0, found in the root
LICENSEfile and replicated across all sub-packages. - The license permits commercial use, modification, distribution, and sublicensing with patent protection.
- Key license locations include
sdks/kimi-sdk/LICENSE,packages/kosong/LICENSE,packages/kaos/LICENSE, andpyproject.toml. - Redistribution requires preservation of copyright notices and inclusion of the license text.
Frequently Asked Questions
Is Kimi-CLI open source?
Yes. MoonshotAI/kimi-cli is an open-source project released under the Apache License 2.0. The full license text is available in the repository's root LICENSE file and grants users broad permissions to use and modify the software.
Can I use Kimi-CLI in commercial projects?
Yes. The Apache 2.0 license explicitly permits commercial use. You can integrate Kimi-CLI into proprietary applications and distribute it as part of commercial products, provided you include the original copyright notice and license text.
What licenses apply to the sub-packages in the Kimi-CLI monorepo?
All sub-packages within the MoonshotAI/kimi-cli repository—including sdks/kimi-sdk, packages/kosong, and packages/kaos—are also licensed under Apache 2.0. Each sub-directory contains its own LICENSE file with identical terms to the root license.
Do I need to open-source my modifications to Kimi-CLI?
No. The Apache 2.0 license does not impose copyleft requirements. You can modify the code and keep your changes private or distribute them under different terms. However, you must still include the original Apache 2.0 license and copyright notice when distributing the software itself.
Have a question about this repo?
These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:
curl -s "https://instagit.com/install.md" Maintain an open-source project? Get it listed too →