Add clipboard control options, quiet mode, and Android/Termux support to croc#1002
Merged
schollz merged 3 commits intoschollz:mainfrom Nov 19, 2025
Merged
Add clipboard control options, quiet mode, and Android/Termux support to croc#1002schollz merged 3 commits intoschollz:mainfrom
schollz merged 3 commits intoschollz:mainfrom
Conversation
Add three new CLI flags to improve usability and automation: - --quiet: Suppresses all output by setting log level to error and redirecting stderr to /dev/null. Useful for scripts and automation. - --disable-clipboard: Prevents automatic clipboard copying of the code phrase, giving users control over clipboard behavior. - --extended-clipboard: Copies the full command with CROC_SECRET as an environment variable (e.g., CROC_SECRET="code" croc --relay ...) instead of just the code phrase. Matches the format shown in the Unix/Linux/macOS instructions and includes any relay/pass flags. Additionally, add support for termux-clipboard-set as a fallback clipboard utility for Android/Termux environments. Updated README with usage examples for all new flags.
- Change clipboard confirmation message to "Command copied to clipboard!" when using --extended-clipboard to accurately reflect what was copied - Remove trailing space from flags string in extended clipboard output
Add clipboard support for Android/Termux by: - Adding "android" to the GOOS case statement (Android reports GOOS as "android", not "linux") - Adding termux-clipboard-set as a fallback clipboard tool alongside other Unix clipboard utilities (xsel, xclip, wl-copy) This enables clipboard functionality on Android devices running Termux while maintaining compatibility with all other Unix-like systems.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add clipboard control options, quiet mode, and Android/Termux support to croc.
Changes
New CLI Flags
--quiet: Suppresses all output by setting log level to error and redirecting stderr.Useful for scripts and automation.
--disable-clipboard: Prevents automatic clipboard copying of the code phrase, givingusers control over clipboard behavior.
--extended-clipboard: Copies the full command withCROC_SECRETas an environmentvariable (e.g.,
CROC_SECRET="code-phrase" croc --relay ...) instead of just the code phrase.Matches the format shown in Unix/Linux/macOS instructions and includes any relay/pass flags.
Clipboard Improvements
Android/Termux support: Added
termux-clipboard-setas a clipboard tool option andincluded "android" in the GOOS case statement (Android reports GOOS as "android", not "linux")
Context-aware messages: When using
--extended-clipboard, the confirmation message nowsays "Command copied to clipboard!" instead of "Code copied to clipboard!" to accurately
reflect what was copied
Cleaner output: Removed trailing whitespace from extended clipboard command format
Testing
All existing tests pass. Clipboard functionality verified on:
Documentation
Updated README.md with usage examples for all new flags.