You can see the source code for this... thing (under the MIT license) on codeberg, sourcehut, or github.