You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 28, 2026. It is now read-only.
Copy file name to clipboardExpand all lines: README.md
+48-7Lines changed: 48 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@ Download the version for your operating system from the [Releases](https://githu
6
6
7
7
> To use the default behavior of `pmc`, your device needs a `git` environment.
8
8
9
-
After installation, you can run `pmc -v` to verify it.
9
+
After installation, you can run `pmc -v` to verify it.
10
10
If installed correctly, it will output: `pmc -- pack-my-code. version <your version number>`.
11
11
12
12
## Usage
@@ -22,7 +22,7 @@ pmc .
22
22
pmc ./src
23
23
```
24
24
25
-
`pmc .` can be shortened to `pmc`.
25
+
`pmc .` can be shortened to `pmc`.
26
26
`pmc` also has the following default behaviors:
27
27
28
28
- Follows `.gitignore`
@@ -59,12 +59,12 @@ pmc . -m "*.lua"
59
59
pmc . -m "src/,README.md"
60
60
```
61
61
62
-
> `-m` has lower priority than `-x`.
62
+
> `-m` has lower priority than `-x`.
63
63
> Even if a file matches `-m`, it will still be excluded if it also matches `-x`.
64
64
65
65
### `-r`: Ignore `.gitignore`
66
66
67
-
By default, `pmc` follows `.gitignore` through `git`.
67
+
By default, `pmc` follows `.gitignore` through `git`.
68
68
With `-r`, it performs a direct filesystem scan and ignores `.gitignore`.
69
69
70
70
This option is useful when:
@@ -82,13 +82,13 @@ Appends statistical information at the end of the output.
82
82
83
83
### `-w`: Wrapping Mode
84
84
85
-
Specifies how each file’s content is wrapped in output.
85
+
Specifies how each file's content is wrapped in output.
86
86
87
87
`-w` supports the following modes:
88
88
89
89
-`md` (default): wrapped as Markdown code blocks
90
90
-`nil`: no wrapping
91
-
-`block`: wrapped in a “block” format
91
+
-`block`: wrapped in a "block" format
92
92
93
93
### `-p`: Path Mode
94
94
@@ -104,7 +104,7 @@ Specifies how paths are displayed before each file block.
104
104
105
105
Enables YAML-mode output.
106
106
107
-
In YAML mode, output no longer follows normal plain-text concatenation.
107
+
In YAML mode, output no longer follows normal plain-text concatenation.
108
108
Instead, it uses its own tree hierarchy structure to organize content.
109
109
110
110
Therefore, in `-y` mode, the following options cannot be used together:
@@ -116,6 +116,22 @@ Therefore, in `-y` mode, the following options cannot be used together:
116
116
117
117
That is, YAML mode handles structure, paths, and content organization by itself.
118
118
119
+
In YAML mode, output must be directed somewhere other than stdout: use `-o` to write to a `.yaml`/`.yml` file, or `-c` to copy to clipboard, or both.
120
+
121
+
### `-c`: Copy to Clipboard
122
+
123
+
Copies the output directly to the system clipboard instead of printing to terminal.
124
+
125
+
Platform support:
126
+
127
+
-**Windows**: uses the built-in `clip` command (no extra installation needed)
128
+
-**Linux**: requires one of the following clipboard tools to be installed:
129
+
-`xclip` (X11)
130
+
-`xsel` (X11)
131
+
-`wl-copy` (Wayland, part of `wl-clipboard`)
132
+
133
+
`-c` and `-o` can be used together — the output will be written to the file **and** copied to the clipboard simultaneously. When `-c` or `-o` is specified, stdout is silent.
134
+
119
135
### `-o`: Output Redirection
120
136
121
137
Write results directly to a specified file instead of printing to terminal.
@@ -161,10 +177,35 @@ Export in YAML mode:
161
177
pmc . -y -o context.yaml
162
178
```
163
179
180
+
Copy output to clipboard:
181
+
182
+
```bash
183
+
pmc . -c
184
+
```
185
+
186
+
Copy to clipboard with tree and stats:
187
+
188
+
```bash
189
+
pmc . -t -s -c
190
+
```
191
+
192
+
Write to file and clipboard at the same time:
193
+
194
+
```bash
195
+
pmc . -o context.md -c
196
+
```
197
+
198
+
Export YAML to clipboard:
199
+
200
+
```bash
201
+
pmc . -y -c
202
+
```
203
+
164
204
## Notice
165
205
166
206
- Files larger than **1 MB** are automatically skipped.
167
207
- Known binary formats and files containing null bytes are skipped.
168
208
- Files are assumed to be **UTF‑8 compatible text**.
169
209
- Very large repositories may produce large outputs; consider using `-x` or `-m` to limit scope.
170
210
- Pattern syntax supports `*`, `**`, and `?`, but not advanced glob expressions such as `{}` or `[]`.
211
+
- On Linux, clipboard support requires `xclip`, `xsel`, or `wl-copy` to be installed. If none is found, `pmc` will report an error when `-c` is used.
0 commit comments