kRPC for KSA 0.3.0
==================

Control Kitten Space Agency from scripts running outside the game. A server inside the
game exposes the game's API, and the kRPC 0.8.0 client libraries call it from
Python, C#, C++, C, Java, JavaScript and Lua. Other languages can call it over HTTP or gRPC.
kRPC for KSA is experimental, and its API may change between releases.

Built for Kitten Space Agency 2026.11.16.5901, and requires the StarMap 0.5.4
code mod loader. On another KSA version, the mod warns that it is not supported and lists
the RPCs it found broken.

    kRPC/       the mod
    stubs/      client stubs for C#, C++, C, Java and JavaScript, the gRPC .proto files,
                and the service definitions


INSTALL
-------

1. Install StarMap 0.5.4:
   https://github.com/StarMapLoader/StarMap/releases

2. Copy the kRPC folder into the KSA mods folder, so that you have
       <Documents>/My Games/Kitten Space Agency/mods/kRPC/KRPC.KSA.dll

3. Enable the mod in <Documents>/My Games/Kitten Space Agency/manifest.toml:

       [[mods]]
       id = "kRPC"
       enabled = true

4. Launch the game through StarMap.

The Borea mod manager can do all four steps: it installs StarMap and the mod, and
launches the game through StarMap.

Upgrading from 0.1.0, where the mod was named kRPC.KSA: delete the mods/kRPC.KSA folder,
and change its manifest.toml entry to id = "kRPC".

The servers start when the game has loaded its mods. By default they listen on 127.0.0.1,
with TCP/IP on port 50000 and WebSockets on port 50001, and accept every connection. The
settings are in <Documents>/My Games/Kitten Space Agency/kRPC/settings.toml.


CONNECT
-------

Install the Python client with "pip install krpc==0.8.0", then:

    import krpc
    conn = krpc.connect()
    print(conn.ksa.active_vehicle.name)

The tutorials in the documentation have scripts that launch the Rocket into orbit, and
plan and execute burns. The clients for C#, C++, C, Java and JavaScript use the stubs in
the stubs folder. Its README.md shows each language.


LINKS
-----

Documentation   https://krpc.github.io/krpc/experimental/ksa/
Source          https://github.com/krpc/krpc/tree/main/experimental/ksa
Bug reports     https://github.com/krpc/krpc/issues

kRPC for KSA is licensed under the LGPL v3, see LICENSE, COPYING and COPYING.LESSER. The
bundled Google.Protobuf, System.IO.Ports, ASP.NET Core and gRPC for .NET libraries have
their own licenses, in LICENSE.Google.Protobuf, LICENSE.System.IO.Ports,
LICENSE.AspNetCore (with THIRD-PARTY-NOTICES.AspNetCore) and LICENSE.Grpc.
