humanscript is an inferpreter. A script interpreter that infers commands from natural language using AI. There is no predefined syntax, humanscripts just say what they want to happen, and when you execute them, it happens.

https://github.com/lukechilds/humanscript

This is a humanscript called tidy-screenshots. It takes an unorganised directory of screenshots and organises them into directories based on the month the screenshot was taken.

It can be executed like any other script.

https://void.cat/d/Rf3GkVQbCtg6NSfzUndkou.webp

The LLM inferpreted the humanscript into the following bash script at runtime.

https://void.cat/d/Br86EpyZev12HtsxtYka3i.webp

The code is streamed out of the LLM during inferpretation and executed line by line so execution is not blocked waiting for inference to finish. The generated code is cached on first run and will be executed instantly on subsequent runs, bypassing the need for reinferpretation.

https://void.cat/d/CCLBU6ZNWq5bXnioMGkkcB.webp

The humanscript inferpreter supports a wide range of LLM backends. It can be used with cloud hosted LLMs like OpenAI's GTP-3.5 and GPT-4 or locally running open source LLMs like Llama 2.

You can run humanscript in a sandboxed Docker environment with a single command if you want to have a play.

https://github.com/lukechilds/humanscript#install-humanscript

Reply to this note

Please Login to reply.

Discussion

interesting.

what if the script did something malicious?

...like deciding to store and replace your home directory with the files?

how can this be secure against side effects from sloppily written instructions?

You can run it in a sandbox with Docker, also note the disclaimer.

https://void.cat/d/HSFLrikz6MdYqWmRuXVqkD.webp

I knew it was nonsense to #learntocode

I got you fam

Amazing

that's pretty cool! nice usage.

does it contain same guards that the script does not mess something up? e.g. works only in a folder and such?

Not if you run it on your host but you can also run it in a Docker sandbox so you can just mount in directories that you want it to have access to.