ccy-0.1.0 is not a library.
ccy (Console Command Yank)
TL;DR: ccy
captures and yanks the last terminal command output to clipboard
A terminal utility that captures and yanks the output of your last command and its output to the clipboard. Perfect for feeding command outputs into LLM agents or sharing terminal results at blazing speed.
Features
- Simple Usage: Run
ccy
to yank your last command output in the terminal to clipboard - Multi-Terminal Support: Works across different terminal windows using PID-based session isolation
- Blazing Fast: Rust-based implementation for maximum performance
- Support: Works with bash and zsh, and across clipboard utilities (xclip, xsel, wl-copy)
Installation
(Requires Rust/Cargo)
From Crates.io (Recommended)
# Install ccy
# Enable shell hooks (required for automatic capture)
# Restart your shell or run: source ~/.bashrc
From Source
Usage
Basic Usage:
Additional Options:
# Print to terminal instead of clipboard
# Yank only the command
# Yank only the output
How It Works
- PID-based Storage: Each terminal session is identified by its PID and stores outputs in
~/.cache/ccy/
- JSON Storage: Command and output stored as JSON (e.g.,
session_123_pts_0.json
) - Latest Retrieval: The
ccy
command reads the most recent output from your current terminal session
Storage
- Command outputs are stored in
~/.cache/ccy/
- Each session gets its own file (e.g.,
session_123_pts_0.json
) - Files are overwritten with each new command (no accumulation)
- Clean text output (ANSI sequences stripped)
Main Commands
ccy
- Main command to yank/print last outputccy --help
- Show help and additional commandsccy --enable
- Enable shell hooksccy --disable
- Disable shell hooksccy-capture <command>
- Manually capture command output (reads from stdin)
Future Improvements (TODOs)
- Better Shell Integration: Improve automatic output capture mechanism, terminal outputs from certain programs are not correctly parsed
- More Shell Support: Add fish and other shell support
- More Clipboard Support: Add more clipboard utilities (e.g., pbcopy, pbpaste)
- Cross-Platform Support: Add support for Windows and macOS
Requirements
- Rust/Cargo for building
- Linux (tested on Ubuntu 24.04)
- Clipboard utility for clipboard functionality:
- xclip (recommended):
sudo apt install xclip
- xsel:
sudo apt install xsel
- wl-copy (Wayland):
sudo apt install wl-clipboard
- xclip (recommended):
- Bash or Zsh shell
Uninstall