| Crates.io | vibecode |
| lib.rs | vibecode |
| version | 0.1.3 |
| created_at | 2026-01-09 17:57:35.995585+00 |
| updated_at | 2026-01-21 20:59:54.082825+00 |
| description | Compile-time vibe coding. |
| homepage | |
| repository | https://github.com/Michael-JB/vibecode |
| max_upload_size | |
| id | 2032499 |
| size | 37,931 |
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!
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.
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]);
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);
The idea for this crate came from Markus, Moritz and Max.