Skip to content

πŸ“£ Discussion: Default Output Behavior (Clipboard vs Unix-style stdout)Β #209

@ODAncona

Description

@ODAncona

πŸ“£ What Should be the Default Output Behavior of Code2Prompt ? πŸ“£

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 ( πŸŽ‰ ) : Keep current behavior (Clipboard-first)

πŸ‘ code2prompt . β†’ clipboard
πŸ“€ code2prompt . - or code2prompt . -O - β†’ stdout
πŸ’Ύ code2prompt . -O file β†’ file

βœ… Pros:

  • Keeps backward compatibility for users.
  • Fastest workflow for copy/paste use cases.

❌ Cons:

  • Non-standard for Unix tooling.
  • Surprising for new users expecting stdout by default.

Vote with: πŸŽ‰


Proposal B ( πŸš€ ) : Switch to Unix-style behavior (Stdout-first)

πŸ‘ code2prompt . β†’ stdout
πŸ“‹ code2prompt . -c β†’ clipboard
πŸ’Ύ code2prompt . -O file β†’ file

βœ… Pros:

  • Standard Unix semantics.
  • Plays better with piping/redirects.

❌ Cons:

  • Breaking change for current users (default no longer clipboard).
  • Requires re-training muscle memory.

Vote with: πŸš€


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:

# ~/.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 :

code2prompt . | tee | wl-copy
code2prompt . > output.txt
code2prompt . | grep "public static void main()"

VOTE

Please vote with

  • πŸŽ‰ (keep clipboard default)
  • πŸš€ (move to stdout default)

and feel free to share your thoughts below !

Metadata

Metadata

Assignees

Labels

enhancementNew feature or requesthelp wantedExtra attention is neededquestionFurther information is requested

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions