PyKaos
PyKaos is a lightweight operating system abstraction layer designed for agents. As of late 2025, the standalone `pykaos` library has been archived, and its development and functionality have been integrated into the `kimi-cli` monorepo. The last independent release was version 0.9.0.
Warnings
- breaking The standalone `pykaos` library has been officially archived on GitHub. Its development has ceased, and new features or bug fixes will not be released for this independent package.
- deprecated Users are strongly advised against starting new projects with `pykaos`. The project is no longer actively maintained as a separate entity.
Install
-
pip install pykaos
Imports
- Kaos
from pykaos import Kaos
Quickstart
import os
from pykaos import Kaos
# NOTE: The standalone pykaos library is deprecated.
# This example is illustrative for historical usage of pykaos v0.9.0.
# For active development, refer to the 'kaos' package within the kimi-cli monorepo.
def main():
kaos = Kaos()
try:
# Example: Listing files in the current directory using Kaos's filesystem abstraction
print(f"Current directory content: {kaos.fs.listdir('.')}")
# Example: Reading an environment variable
api_key = kaos.env.get('MY_API_KEY', 'default_value')
print(f"My API Key (from env or default): {api_key}")
except Exception as e:
print(f"An error occurred: {e}")
if __name__ == '__main__':
# Set a dummy environment variable for demonstration
os.environ['MY_API_KEY'] = os.environ.get('MY_API_KEY', 'TEST_123')
main()