Skip to content

rodnye/codepicker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

94 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Stop copying files into ChatGPT one by one...

codepicker πŸ‘ŒπŸ»

# 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 -c

npm version npm downloads GitHub stars npm license


What?

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 β†’ apply turns 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-tool
codepicker --version
# or
codep --version

codep is just a shorter alias for codepicker.

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 -c

Helping the LLM behave

Some models need guidance. Use:

codepicker "src/**/*.ts" -cD

The -D flag appends the full format spec so the model responds correctly.

Backups

codepicker "src/**/*" > backup.md

Restore anytime:

codepicker apply backup.md

Useful Patterns

Limit output

codepicker "src/**/*.ts" -l 5 -n

Listing 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.ts

Include ignored files

codepicker "dist/**/*.js" -I

Handling 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:

License

MIT

About

πŸ‘ŒπŸ» Pick code into Markdown. Apply Markdown to code. Built for LLMs and quick backups.

Topics

Resources

License

Stars

Watchers

Forks

Contributors