1 comments

  • rangersui 1 hour ago
    sshd gives you a shell, and pythond gives you a persistent python repl

    I built pythond because every AI agent uses the one shot bash_tool, where the state cannot persist across its tool calls. It has to use python -c "import ..." or "export ..." every time, wasting tokens and cannot hold a long lived database connection or socket. We have a real bash terminal and the envs survive, but they act as if every time it's a new terminal.

    Background tasks that help AI hold a persistent connection can work but they must be restarted if you want to change configs, or they need to provide a cli interface or an API for live operation. So instead of waiting for different softwares to have their cli interface, I thought that the most general purpose tool is something you can exec() right on the spot and that's exactly Python.

    At first I was trying to give AI a real terminal but it was hell with ANSI and the terminal itself is a stream with a lot of noise rather than a structured call because of AI's natural tool use pattern.

    AI is naturally a request-response commmunication model, so it needs a server or daemon to help it persist the status. The daemon shall not be any specific server, agent runtime or api, but the most primitive and convenient language, runtime: PYTHON.

    Unlike Jupyter, it's CLI-native with no browser, with no .ipynb files. History are just stored in text and shell friendly. I was having fun with my AI locally and it uses this to do literally everything, and the bash tool becomes just a pipe for using pythond. Instead of writing python scripts and then run them, crash in the middle and then debug, the REPL allows AI to retry the code and do it step by step.

    For remote usage, I was copying the secruity model of SSH using mTLS + token, and I know it's not a sandbox, since it's exactly an RCE running arbitrary python code. I would love feedback about the secruity model, my API design like run (sync), fire (async), fork behavior(POSIX only), poll (fetch async result), and attach (human can attach to the REPL agents are working at) and whether someone would actually use this

    GitHub: https://github.com/rangersui/pythond Install: pip install pythond