:mega: Discussion: Default Output Behavior (Clipboard vs Unix-style stdout)
enhancementhelp wantedquestion
# :mega: What Should be the Default Output Behavior of Code2Prompt ? :mega:
## Current behavior
Right now, `code2prompt` defaults to copying the generated prompt into the **clipboard**:
* `code2prompt .` → clipboard
* `code2prompt . -` → stdout
* `code2prompt . -O file` → file
This is convenient for fast interactive workflows, but it is **not standard Unix behavior** (where stdout is usually the default).
---
## Proposal A ( :tada: ) : Keep current behavior (Clipboard-first)
:thumbsup: `code2prompt .` → clipboard
:outbox_tray: `code2prompt . -` or `code2prompt . -O -` → stdout
:floppy_disk: `code2prompt . -O file` → file
:white_check_mark: Pros:
* Keeps backward compatibility for users.
* Fastest workflow for copy/paste use cases.
:x: Cons:
* Non-standard for Unix tooling.
* Surprising for new users expecting stdout by default.
Vote with: :tada:
---
## Proposal B ( :rocket: ) : Switch to Unix-style behavior (Stdout-first)
:thumbsup: `code2prompt .` → stdout
:clipboard: `code2prompt . -c` → clipboard
:floppy_disk: `code2prompt . -O file` → file
:white_check_mark: Pros:
* Standard Unix semantics.
* Plays better with piping/redirects.
:x: Cons:
* Breaking change for current users (default no longer clipboard).
* Requires re-training muscle memory.
Vote with: :rocket:
---
## Context & Transition Plan
To smooth the migration, we will introduce a **user config file** (`~/.c2prc` or `~/.c2pconfig`) that allows setting the default output mode #101 .
Example:
```ini
# ~/.c2pconfig
default_output = clipboard # or stdout or file
```
This way:
* We can safely switch the **global default** to Unix-style (stdout).
* Users who prefer clipboard as default can keep it by setting `default_output = clipboard`.
* No one loses their preferred workflow.
* Make more sense by default to be able to chain `Code2Prompt` with other unix tools
Few examples :
```bash
code2prompt . | tee | wl-copy
code2prompt . > output.txt
code2prompt . | grep "public static void main()"
```
---
# VOTE
Please vote with
- :tada: (keep clipboard default)
- :rocket: (move to stdout default)
and feel free to share your thoughts below !
关闭于 2025-10-04 3 条评论