Extensible code concatenator and clipboard tool
Project description
cbler
Concatenate code into your clipboard with filters.
cbler is a CLI tool for extracting source files, filtering them, and copying the result to your clipboard. It also includes several helpful Git utilities for viewing logs and diffs.
- Built with Typer
- Rich, colorful output
- Multi-flag filtering with regex support
- Git integration for diffs and logs
- Designed for piping code into LLMs like ChatGPT, Claude, or Gemini
Install
pip install cbler
CLI Layout
cbler code <lang> [path] [filters]
cbler git log [path] [options]
cbler git diff [path] [options]
cbler git tree [path] [options]
cbler git merge [path]
code Command
The code command is the core of cbler. It walks a directory, finds files matching the specified language (py or gml), applies a series of filters, and copies the concatenated result to the clipboard.
Usage
# Copy all python files in the current directory, excluding test files
cbler code py . --not-suffix _test.py
# Copy all GameMaker scripts containing "Player" in their path
cbler code gml . --path-contains Player
# Copy all python files that have been changed in git (unstaged)
cbler code py . --git-diff
Code Command Filters
All filters are optional and can be combined. They accept multiple values (e.g., --suffix .py .pyw) and support regex patterns by default (disable with --no-regex).
| Filter | Description |
|---|---|
--prefix, --not-prefix |
Match file names that start with a pattern. |
--suffix, --not-suffix |
Match file names that end with a pattern. |
--contains, --not-contains |
Match file names that contain a pattern. |
--path-contains, --not-path-contains |
Match the full relative path against a pattern. |
--parent-contains |
Parent directory must match ANY of the given patterns. |
--parent-contains-all |
Parent directory must match ALL of the given patterns. |
--git-diff |
Only include files that are part of the unstaged git diff. |
--git-staged |
Only include files that have been staged in git. |
--no-regex |
Disable regex matching for all filters. |
git Command
The git command provides several utilities for inspecting a Git repository.
git log
Shows a detailed, formatted log of the most recent commits.
cbler git log . -n 20 # Show last 20 commits
Author names are colorized with deterministic colors so different contributors stand out in the table.
git diff
Displays a summary of file changes (modified, added, deleted, untracked).
cbler git diff # Show unstaged changes and untracked files
cbler git diff --staged # Show only staged changes
cbler git diff --no-untracked # Hide untracked files
Each status letter is colored (e.g. green for added, yellow for modified) so changes are easier to spot.
git tree
Displays a compact, graphical representation of the commit history.
cbler git tree -n 30 # Show a graph of the last 30 commits
git branch
Interactive branch switcher. Launches a TUI showing all branches. Use the arrow
keys to select a branch and press Enter to switch. Press n or choose
"+ New Branch" to create one.
cbler git branch # Open the TUI
cbler git branch --help # Show options
git merge
Launches an interactive UI for merging another branch into the current one.
cbler git merge .
Use the arrow keys to choose a branch and press Enter to perform the merge.
After completion, a reminder to push is shown. If textual is not installed or
the terminal is non-interactive, a short message suggests installing it with
uv add textual.
Roadmap
-
--max-fileslimit with confirmation - Progress bar
-
--outputfor saving to file - Show skipped files with reasons
Dev install
uv pip install -e .
cbler code py . --suffix .py
License
MIT
Name
"cbler" = clipboard + -ler
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file cbler-1.2.0.tar.gz.
File metadata
- Download URL: cbler-1.2.0.tar.gz
- Upload date:
- Size: 10.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0beaa84347f7e6976e22b0a9746dae686cba6252aaa51148d5abbaa80622f43e
|
|
| MD5 |
1c36e8bd50a3abafcd088cf43aae0eae
|
|
| BLAKE2b-256 |
0b3a4285a26d919421d76fef04fd7d1a4bb2e117e3b3ef941f882122433a620d
|
Provenance
The following attestation bundles were made for cbler-1.2.0.tar.gz:
Publisher:
workflow.yml on Gaburyuu/CBler
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cbler-1.2.0.tar.gz -
Subject digest:
0beaa84347f7e6976e22b0a9746dae686cba6252aaa51148d5abbaa80622f43e - Sigstore transparency entry: 318084915
- Sigstore integration time:
-
Permalink:
Gaburyuu/CBler@23e6221ad33cffb0b3991e2188ccc509a90612c9 -
Branch / Tag:
refs/tags/v1.2.0 - Owner: https://github.com/Gaburyuu
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
workflow.yml@23e6221ad33cffb0b3991e2188ccc509a90612c9 -
Trigger Event:
push
-
Statement type:
File details
Details for the file cbler-1.2.0-py3-none-any.whl.
File metadata
- Download URL: cbler-1.2.0-py3-none-any.whl
- Upload date:
- Size: 13.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3664068201ec0ccd0ce1ffe6f3f52110d61938236da87b30848d0804795d7b6e
|
|
| MD5 |
6006548ebac588d10f7e16a098f8f1dc
|
|
| BLAKE2b-256 |
1c4c4ff8b944519a352ebb59e3a2add3a732ef1a86467e6caaaabefda4aa2806
|
Provenance
The following attestation bundles were made for cbler-1.2.0-py3-none-any.whl:
Publisher:
workflow.yml on Gaburyuu/CBler
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cbler-1.2.0-py3-none-any.whl -
Subject digest:
3664068201ec0ccd0ce1ffe6f3f52110d61938236da87b30848d0804795d7b6e - Sigstore transparency entry: 318084930
- Sigstore integration time:
-
Permalink:
Gaburyuu/CBler@23e6221ad33cffb0b3991e2188ccc509a90612c9 -
Branch / Tag:
refs/tags/v1.2.0 - Owner: https://github.com/Gaburyuu
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
workflow.yml@23e6221ad33cffb0b3991e2188ccc509a90612c9 -
Trigger Event:
push
-
Statement type: