LocalCode - A Perl-Based AI Coding Agent |
Written by Nikos Vaggalis |
Thursday, 25 September 2025 |
Who said that Perl can't do AI? And to prove it here's LocalCode, a Perl AI coding agent for local Ollama models. It's 98.5% made of Perl and open source for everyone to examine and use. It's an Agentic wrapper interacting with Ollama local models that provides a number of tools. But enough talking; show me what you can do with it. You can create applications from a single prompt. The official example is powerful enough as a showcase: localcode > First write calc.pl which can add two numbers by command line , then make it executable, then test it. This will create a crude cli calculator but do not fret. While LocalCode is written in Perl, it doesn't mean that it can't generate code in other languages, like Python for instance, or in taking the previous example, you can by tweaking the prompt make a HTML/JS web based calculator instead. Another boon is the full transparency of the tool. Whenever you issue a prompt, you get all the actions that LocalCode took behind the scenes, such as which tools it has called and what it did with them. It will also ask for permissions when doing "unsafe" operations like writing files. It also includes thinking fields, intelligent follow-up actions and asking the user when further input if required. Looking at the Tools.pm file we get a list of the available tools: $self->register_tool
Or if not looking at code, to get at the tool listing you issue the TUI /tools command. The rest of the auxiliary commands are: /models # List available models And then there's the switches such as: localcode --set-model "gpt-oss:20b" *note that it fetches the available models from Ollama on startup and to test the browser functionality: localcode --test-mode "websearch Stuttgart" In production, it's basic usage is: localcode # Interactive mode The requirements for installing it are pretty light and are probably already covered by a large percentage of Perl installations by default:
The magic of it, is that the whole toolbox is written in less than 1K lines of Perl code. Of course the other big advantage other than that is written in Perl, is that it's a local first tool that drives privacy-first development; your code stays on your machine. The project is at its early stages but is production ready. Looking at the roadmap, all looks very promising. More InformationRelated ArticlesPerl Rebounds In TIOBE Index - Why?
To be informed about new articles on I Programmer, sign up for our weekly newsletter, subscribe to the RSS feed and follow us on Twitter, Facebook or Linkedin.
Comments
or email your comment to: comments@i-programmer.info |