Skip to content

andrepadez/codeclip

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🧠 Codeclip

Codeclip is now available on the AUR! 🎉

🧩 Installation (Arch / Manjaro)

With an AUR helper (recommended)

yay -S codeclip

or with paru:

paru -S codeclip

Manual installation

git clone https://aur.archlinux.org/codeclip.git
cd codeclip
makepkg -si

Codeclip is a fast, minimal CLI tool written in C that turns entire codebases — or single files — into clean, syntax-highlighted Markdown files.
It’s ideal for documentation, sharing snippets, or creating AI-ready context dumps of your code.


🚀 Features

  • 🪶 Simple CLI: Works with just one command — codeclip <path>
  • 🧭 Auto project detection: Finds the project root via .git
  • 🧱 Breadth-first traversal: Outputs files in logical, readable order
  • 🧹 Smart ignore system: Skips binaries and common junk (.git, node_modules, etc.`)
  • 🧩 Single-file mode: codeclip file.c dumps one file instead of a whole folder
  • 💾 Automatic config: Creates default config and ignore files on first run
  • 📋 Clipboard integration:
    • By default: copies the Markdown file path
    • With -c or --clipboard: copies the full Markdown contents
  • 🧼 Subcommands:
    • codeclip clear — clears generated Markdown files
    • codeclip help — prints this help
    • codeclip version — prints current version
  • 🕓 Timestamped output names: e.g.
    ~/.local/share/codeclips/20251017_173455_src_main.c.md

⚙️ Installation (from source)

Build from source

git clone https://github.com/andrepadez/codeclip.git
cd codeclip
make clean && make
sudo make install

This installs the codeclip binary to /usr/local/bin.

To uninstall:

sudo make uninstall

🧭 Usage

Basic

codeclip <path>

Dumps the directory or file at <path> into Markdown
and copies the resulting file path to the clipboard.

Example:

codeclip src/

→ Creates a file like:

~/.local/share/codeclips/20251017_173455_src_main.c.md

Copy full Markdown contents

codeclip -c <path>
# or
codeclip --clipboard <path>

Copies the full Markdown content instead of the file path.


Single file

codeclip src/main.c

Generates and copies:

~/.local/share/codeclips/20251017_173455_src_main.c.md

Clear old clips

codeclip clear
# or
codeclip clear --force

Deletes all files in your configured output directory (~/.local/share/codeclips by default).


Show help and version

codeclip help
codeclip -h
codeclip --help

codeclip version
codeclip -v
codeclip --version

🧰 Configuration

Your configuration lives in:

~/.config/codeclip/config.yaml

Default contents:

output_dir: "~/.local/share/codeclips"
clipboard_tool: "xclip"  # auto-detected (wl-copy / pbcopy supported)

The ignore file (codeclipignore) defines which files and directories are skipped.


🧠 Example Output

Example Markdown generated by Codeclip:

--- src/main.c ---
```c
#include <stdio.h>
int main() {
    printf("Hello, Codeclip!\n");
    return 0;
}

---

## 🧩 Development

To rebuild with default assets:

```bash
make clean && make

To run without installing:

make run ARGS="src/"

🏷️ Version

Codeclip 1.0.0 — Initial stable release
✨ Refactored codebase with modular helpers, subcommands,
clipboard mode toggle, and timestamped file outputs.


📄 License

MIT License © 2025 André Pádez
Use freely, modify, share, and have fun!

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published