PyKaos

0.9.0 · deprecated · verified Mon Apr 13

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

Install

Imports

Quickstart

This quickstart demonstrates basic usage of the deprecated `pykaos` library, specifically its filesystem and environment interaction capabilities. It is provided for historical context only. New projects should *not* use this library directly. Instead, refer to the `kaos` package within the `kimi-cli` project for current development practices and integrated functionality.

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()

view raw JSON →