wrapr

Crates.iowrapr
lib.rswrapr
version0.2.10
created_at2025-04-01 09:38:07.986063+00
updated_at2026-01-17 08:35:58.344427+00
descriptionwrap your code for ai
homepage
repositoryhttps://github.com/incredimo/wrapr
max_upload_size
id1614645
size6,786,276
incredimo (incredimo)

documentation

README

Wrapr

Wrapr is a handy little tool for wrapping up your code into a formate easy for llms to understand. It helps format your files into Markdown so AI assistants can better understand your codebase.

What it does

Wraps code files in nice markdown format

It's simple. wrapr wraps your code into a markdown format that AI models love. Each file gets a subtitle and the code is enclosed in triple backticks with the appropriate language tag for syntax highlighting. example of a blank rust project wrapped by wrapr looks like this:

# Repository

## ./src/main.rs
```rust
fn main() {
    println!("Hello, world!");
}

./Cargo.toml

[package]
name = "my_project"
version = "0.1.0"
edition = "2021"

that's it! then again wrapr makes your life easier by providing a nice user friendly terminal ux with preview preview for file contents so taht you can interactively choose which files to include and which filse to ignore. Note that ./target folder from the rust project is missing in the above example. this is intentional. wraper is smart enough to automatically ignore noisy often useless files and folders like `node-modules` and `go.sum`. 
her's how the terminal ux looks like:

█ █ █ █▀█ █▀█ █▀█ █▀█ C:\repo\wrapr ▀▄█▄█ █▀▄ █▀█ █▀▀ █▀▄ Files: 6 Tokens: 15.3k Selected: 4 | 14.6k

FILES ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ PREVIEW ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ │ ├─ Cargo.toml 55 │ preview of the selected file will be visible here
│ └─ ● src 88 │ │ └─ main.rs 88 │ │
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━



### Remembers what you selected 😊

Once you pick files, wrapr saves your choices in a `.wrapr` config file. Next time you run it, your previous selections are pre-loaded so you can quickly adjust or add more files without starting from scratch.
notice the green dot next to `src` folder in the above screenshot. that means all files inside that folder are already selected from previous run. you can collapse/expand folders to see their contents and adjust your selections as needed.
wrapr also shows you how many tokens your selected files will use up so you can stay within limits for your AI model.

### Wraps web pages too 😮

Wrapr isn't just for code files. You can also give it URLs and it will fetch the page content, clean it up, and wrap it in markdown format just like your code files. This is great for sharing documentation or web resources with your AI assistant.

### Automatically copies to clipboard

After wrapping your files, wrapr automatically copies the formatted markdown to your clipboard. This way, you can just paste it directly into your AI chat without any extra steps.

### Unwraps from clipboard 🤯

Wrapr can also do the reverse. If you have markdown content in your clipboard that was generated by an AI model, wrapr can unwrap it back into individual files on your filesystem. This is super handy for taking code snippets from AI chats and turning them into real files you can work with. How? providing code blocks in markdown format is a common way for AI models to share code. Wrapr recognizes these blocks and extracts the code, saving it into files with the correct names and extensions. Dead simple but incredibly powerful.
Dont worry, wrapr allows you to review the files and pick which ones to actually write to disk so you dont accidentally overwrite anything important.

wrapr can easily and reliably unwrap clipboard content like this:

Any title and content here is easily ignored by wrapr

this description or text is ignored by wrapr as it focuses only on code blocks below.

./src/main.rs

wrapr handles text after the file subtitle and before the code block gracefully. wrapr displays this in the preview pane for your reference but does not include it in the actual file content. only the first code block is considered as the file content. all other code blocks after the first one after the subtitle are ignored. wrapr needs the file subtitle to start with ./ or .\ to recognize it as a valid file. any text after the subtitle like ## ./src/main.rs (new file) is ignored.

fn main() {
    println!("Hello, world!");
}

./Cargo.toml

[package]
name = "my_project"
version = "0.1.0"
edition = "2021"


## Getting started

### Install it

```bash
cargo install wrapr

Command stuff

# Basic usage
wrapr

# Save to a file instead of clipboard
wrapr -o my_code.md

# Limit token count per file
wrapr --limit 1000

# Grab specific files
wrapr "src/**/*.rs" "*.toml"

# Show hidden files in UI
wrapr ui --all

Configuration (.wrapr file)

below is a sample of a .wrapr config file that gets automatically created in the current working directory when you run wrapr for the first time.

{
  "excluded_patterns": [
    "**/.git/**",
    "**/.svn/**",
    "**/.hg/**",
    "**/node_modules/**",
    "**/target/**",
    "**/dist/**",
    "**/build/**",
    "**/vendor/**",
    "**/.venv/**",
    "**/venv/**",
    "**/*.min.*",
    "**/*.bundle.*",
    "**/*.png",
    "**/*.jpg",
    "**/*.jpeg",
    "**/*.gif",
    "**/*.ico",
    "**/*.svg",
    "**/*.woff",
    "**/*.woff2",
    "**/*.ttf",
    "**/*.eot",
    "**/*.pdf",
    "**/*.zip",
    "**/*.gz",
    "**/*.exe",
    "**/*.dll",
    "**/*.so",
    "**/*.dylib",
    "**/package-lock.json",
    "**/yarn.lock",
    "**/Cargo.lock",
    "**/*.bin",
    "**/*.obj",
    "**/*.lib",
    "**/*.a",
    "**/*.pdb",
    "**/*.ilk",
    "**/*.suo",
    "**/*.user",
    "**/*.tmp",
    "**/*.temp",
    "**/*.log",
    "**/*.cache",
    "**/*.DS_Store",
    "**/Thumbs.db",
    "**/*.swp",
    "**/*.swo"
  ],
  "selected_files": [
    ".\\src\\main.rs",
    ".\\Cargo.toml",
    ".\\src\\tail.md",
    ".\\README.md"
  ],
  "last_limit": null,
  "max_file_size": null,
  "head": "this is a custom head text that will appear at the top of the wrapped markdown. this can be used to provide context or instructions to the ai model. by default, this will be null meaning no head text is added.",
  "tail": "study the provided code files, if no further instructions are given, review the code for potential improvements and optimizations, suggest refactorings, and identify any bugs or issues that could be addressed. list out the improvements that can be made to enhance code quality, performance, and maintainability. provide clear explanations for each suggestion to help understand the reasoning behind them. Then make all the suggested changes and for each file that needs to be modified, write down the relative path of the file as a sub headding eg. `## ./src/main.rs`. in the next line provide a short description of the changes made and then provide complete unabridged code for the entire file wthout any ommisions, placeholders, or incomplete sections. in a single code block. Ensure the code is properly formatted and ready to be used. repeat this for all files that were changed. if any file/folder needs to be removed, provide each file/folder path as a sub headding eg. `## [DELETE] ./src/old_file.rs` and in the next line provide a brief reason for its deletion. do not include any other text or explanations outside of the specified format."
}
Commit count: 0

cargo fmt