SIGN IN SIGN UP
schollz / croc UNCLAIMED

Easily and securely send things from one computer to another :crocodile: :package:

0 0 39 Go

Add clipboard control options, quiet mode, and Android/Termux support to croc (#1002)

* Add clipboard control and quiet mode options

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.

* Fix extended-clipboard message and trailing space

- 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 Android/Termux clipboard support

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.

---------

Co-authored-by: Christian Wohlert <wohlert@appbase.hamburg>
C
C. Wohlert committed
89b26ca3f4d29f20e72d485d23a3749be39b6b02
Parent: 738a80c
Committed by GitHub <noreply@github.com> on 11/19/2025, 1:40:52 PM