Skip to content

richardstoeckl/codr

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

codr

codr is (technically) an open-source competitor to Anthropic's Claude Code and other cli coding agents, written entirely in base R*.

⚠️ I highly recommend to never use this. ⚠️
It can actually cause serious issues with your system including loss of data!

It was written "the old fashioned way" without LLMs - which just means I followed the great python tutorial/example from Mihail Eric.

*(Base R and some Ollamar for connecting to LLMs and jsonlite to make parsing easier.)

v1.0.0.png

Why?

Quite simply because it was fun and I wanted to learn how these cli agents work. Also it's ridiculous to write one in R, so all the more reason to do it.

Usage

⚠️ If you want to try this out, be aware that this can cause serious issues with your system including loss of data.⚠️

But if you really know what you are doing and want to try it out, here is a quick setup:

Prerequisites

  • You need to have a working installation of Ollama
  • You need to have downloaded the model you want to use via Ollama. I found that models <=4b are not that good at following precise instructions and might therefore break the tool calls. "qwen3.5:9b" seems to be working fine.
  • You need to have a working installation of R and the R packages ollamar and jsonlite

Usage

  1. Download the codr.R script.
  2. Specify the model you have setup and want to use in the OLLAMA_MODEL_NAME variable at the top of the script.
  3. Run the agent either through the terminal via
Rscript codr.R

or via the RStudio/Positron Console:

source("codr.R")
  1. You can now start chatting with the agent and request things like "What does the Rscript file in this directory do?", "What files are in the project?", "Write a README.md file for the R project in this directory", etc.

History

Version v1.0.0 - Initial release

This is the initial release. Roughly 300 lines of "hand written" base R and only three tools for the assistant to use: reading files, listing dir content, and creating/modifying files. But with this toolset, the agent can now start to implement features to itself - "AGI" has basically just been achieved 😉.

About

A coding agent cli written in R because why not

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages