codepicker-tool
v2.1.5
Published
Pick code into Markdown. Apply Markdown to code. Built for LLMs and quick backups.
Maintainers
Readme
Stop copying files into ChatGPT one by one...
# 1. Grab your backend context in one command
codepicker "src/**/*.ts" -c
# 2. Paste into your LLM and copy the response
# 3. Apply it back to your project
codepicker apply -cWhat?
codepicker is a bidirectional CLI that turns your codebase into structured Markdown—and back again!
It’s designed to make working with LLMs on real projects fast and predictable. Instead of juggling files manually, you move context in and out of your project with a couple of commands.
Why?
Working with LLM chats on existing codebases usually looks like: open files, copy paths and content, paste into chat, repeat, manually reconstruct changes...
Even with IDE agents, you're often locked into their workflow.
Features
- Instant context → copy entire project slices with
-c - Reverse workflow →
applyturns Markdown back into files - Noise-tolerant parsing → ignores explanations, keeps only code
- Smart Markdown wrapping → prevents broken code blocks
- Precision controls → limit lines, add numbers, absolute paths (only for context)
- Documentation mode (
-D) → helps LLMs follow the codepick format correctly - Binary-safe → avoids dumping unreadable content
- .gitignore aware → respects your repo by default
To apply the copied LLM response, a format called codepick is used. This is perfectly parsed, and —unlike diffs or other response formats— it packages the entire content of the file.
Installation
npm install -g codepicker-toolcodepicker --version
# or
codep --version
codepis just a shorter alias forcodepicker.
Usage
Pick (extract context)
codepicker pick [options] <patterns...>[!note] pick command is optional, just use:
codepicker [options] <patterns...>
Options
| Option | Description |
| ----------------------- | ------------------------------------------------------------------------------------------------ |
| <patterns...> | Required glob file patterns to find |
| -c, --clipboard | Copy output to clipboard |
| -D, --doc | Append format documentation |
| -I, --include-ignored | Include .gitignore files |
| -a, --absolute | Use absolute paths |
| -l, --lines <n> | Limit lines per file |
| -p, --paths | Output only file paths |
| -n, --line-numbers | Show line numbers |
| -V, --version | Show version |
| -h, --help | Help |
Apply (write changes)
codepicker apply [options] [dump-file]Options
| Option | Description |
| ------------------ | ---------------------------------------- |
| [dump-file] | Markdown file with code blocks |
| -c, --clipboard | Read from clipboard instead of dump file |
| -d, --dir <path> | Target directory (default current) |
| --dry-run | Preview changes without write |
Typical Workflow
1. Extract context
codep -Dc "src/services/*.ts" "src/views/**/*.tsx"2. Ask your LLM
Paste and instruct:
Modify the view with a blue button and modern shadow.
IMPORTANT: Use Codepick format.3. Apply result
codep apply -cHelping the LLM behave
Some models need guidance. Use:
codepicker "src/**/*.ts" -cDThe -D flag appends the full format spec so the model responds correctly.
Backups
codepicker "src/**/*" > backup.mdRestore anytime:
codepicker apply backup.mdUseful Patterns
Limit output
codepicker "src/**/*.ts" -l 5 -nListing Paths Only
Need to feed file paths into another tool (like xargs or grep)? Use -p:
codepicker "src/**/*.ts" -p -a/home/user/project/src/index.ts
/home/user/project/src/utils/helpers.tsInclude ignored files
codepicker "dist/**/*.js" -IHandling messy LLM responses
apply ignores everything outside code blocks.
If the response includes explanations, they’re safely discarded.
Only valid code is written.
Binary files
Binary files are replaced with metadata instead of raw bytes:
```png
// assets/logo.png
// [BINARY FILE] - Size: 0.024 MB
```Pattern syntax
Uses fast-glob.
Supports:
**(globstars)!(negation)- advanced matching
More info:
- https://github.com/mrmlnc/fast-glob
- https://github.com/micromatch/picomatch
License
MIT
