The kpshell program is an interactive KP shell utility. The KP emulates the Python interpreter's command loop and allows the user to interactively execute KP-specific operations, like migration.
The interpreter loop provided by kpshell is a lot like the Python interpreter's interactive mode, but there are some differences:
The initial environment for kpshell contains one variable, self, which is bound to the KP instance. There is one instance variable, self.kos, that is bound to the KOS bastion. The basic prompt looks like this:
After the KP migrates, the prompt indicates the original service station and the current service station:
The kpshell can clone just like any other KP, but it will be difficult to use the shell after the clone. Two different KPs will be reading from the same input stream; IO buffering and contention for user input causes confusing overlap. Only one KP, however, will receive any particular line of input. So you can raise SystemExit to cause one of the clones to exit.