vibecode

Crates.iovibecode
lib.rsvibecode
version0.1.3
created_at2026-01-09 17:57:35.995585+00
updated_at2026-01-21 20:59:54.082825+00
descriptionCompile-time vibe coding.
homepage
repositoryhttps://github.com/Michael-JB/vibecode
max_upload_size
id2032499
size37,931
Michael Barlow (Michael-JB)

documentation

README

vibecode

Docs Crates.io Version Crates.io Total Downloads

Tired of fast, reproducible and secure builds? Try compile-time vibe coding.

use vibecode::vibecode;

#[vibecode]
fn sum(xs: Vec<i32>) -> i32 {}

let result = sum(vec![42, 86, -17]);

assert_eq!(result, 111); // That's numberwang!

Tell me more!

Add vibecode to your project:

cargo add vibecode

At present, vibecode only supports OpenAI; you'll need to set the OPENAI_API_KEY environment variable to compile your code.

vibecode

The vibecode attribute macro generates the body of the annotated function at compile time using an LLM.

You can provide more context via an explicit prompt. The complexity you configure determines the model vibecode uses to generate the code:

use vibecode::vibecode;

#[vibecode(prompt = "Return sorted in descending order", complexity = "medium")]
fn prime_numbers_below(limit: u64) -> Vec<u64> {}

assert_eq!(prime_numbers_below(12), vec![11, 7, 5, 3, 2]);

viberun!

You can also generate and evaluate code inline with viberun!:

use vibecode::viberun;

let my_number = 5;

let result = viberun!("Calculate the factorial of a number", my_number);

assert_eq!(result, 120);

Credits

The idea for this crate came from Markus, Moritz and Max.

License

MIT License

Commit count: 50

cargo fmt