Skip to main content

SCCB – A customizable CLI tool for managing command shortcuts and clipboard snippets.

Project description

📋 SCCB – Shortcut Clipboard + Command Binder

SCCB is a customizable CLI tool that lets you save and run command shortcuts and clipboard snippets. It’s like a mix of a snippet manager, alias system, and Git helper, but fully configurable via a JSON file.

I built this project to save time in my daily workflow — instead of typing long Git commands or reusing the same text snippets, I can now run them instantly with sccb.


✨ Features

  • 🔖 Snippets → Save reusable text (like API keys, tokens, boilerplate) and copy it to your clipboard with one command.
  • ⚡ Commands → Save shell command macros and run them instantly.
  • 📝 Variable substitution → Use placeholders like {msg} or {key} and fill them at runtime.
  • 🛠 Defaults → Define default values for variables in your config or via sccb default.
  • 📂 Config file → All shortcuts are stored in ~/.sccb.json (easy to edit, share, or sync).
  • 🎨 Pretty output → Uses Rich for nice tables.
  • 🖥 Shell integration → Optionally push commands into your shell buffer (zsh).
  • 🧹 Simple management → Add, remove, list, set defaults, and edit shortcuts easily.

📦 Installation

From PyPI (recommended)

pip install sccb

From source

git clone https://github.com/Jinkuman/sccb.git
cd sccb
pip install -e .

🚀 Usage

Add a Command

sccb add gitall:"git add . && git commit -m '{msg}' && git push"
  • {msg} is a variable placeholder.

  • Run it with a custom message:

    sccb run gitall msg:"Initial commit" !
    

→ Executes git add . && git commit -m 'Initial commit' && git push

  • Or define a default:

    sccb default gitall msg:"quick commit"
    sccb run gitall !
    

→ Executes with "quick commit" as the default message.


Add a Snippet (API Key Example)

sccb add@ apikey:"sk-1234567890abcdef"
  • Copy it to clipboard:

    sccb run apikey
    

→ Copies sk-1234567890abcdef to clipboard.

  • With a variable (e.g., different environments):

    sccb add@ apikey:"{env}_sk-1234567890abcdef"
    sccb run apikey env:"dev"
    

→ Copies dev_sk-1234567890abcdef to clipboard.

  • With a default:

    sccb default apikey env:"prod"
    sccb run apikey
    

→ Copies prod_sk-1234567890abcdef to clipboard.


List Shortcuts

sccb ls

Remove a Shortcut

sccb rm apikey

Edit Config

sccb edit

Help

sccb help

Shell Integration (Optional)

You can install shell integration to push commands into your shell buffer (zsh only for now):

sccb install-shell
source ~/.zshrc

Then you can type:

sccb run gitall

and the command will appear in your terminal buffer, ready to run.


📌 Example Config (~/.sccb.json)

{
  "commands": {
    "gitall": {
      "type": "command",
      "value": "git add . && git commit -m '{msg}' && git push",
      "defaults": { "msg": "quick commit" }
    }
  },
  "snippets": {
    "apikey": {
      "type": "snippet",
      "value": "sk-1234567890abcdef",
      "defaults": {}
    }
  }
}

🛠 How I Built It

  • Language: Python

  • CLI Framework: Typer

  • Clipboard: Pyperclip

  • Pretty Output: Rich

  • Config: JSON file stored at ~/.sccb.json

  • Packaging: pyproject.toml + published to PyPI This project started as a way to save time typing repetitive Git commands and reusing text snippets. Over time, I added:

  • Variable substitution ({msg}, {env})

  • Defaults (sccb default)

  • Shell integration for buffer mode

  • A polished CLI with ls, rm, edit, and help

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sccb-0.4.2.tar.gz (7.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sccb-0.4.2-py3-none-any.whl (7.8 kB view details)

Uploaded Python 3

File details

Details for the file sccb-0.4.2.tar.gz.

File metadata

  • Download URL: sccb-0.4.2.tar.gz
  • Upload date:
  • Size: 7.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for sccb-0.4.2.tar.gz
Algorithm Hash digest
SHA256 bdd63b34bcc2fd024a2c77501945f3d843b8a43112436f615af79be8b336e679
MD5 5a0ff05f19b976934737a1e52e6730ce
BLAKE2b-256 cf5e297221847bee858af0060f6b06769ce552707a624f5c1052365c164151a4

See more details on using hashes here.

File details

Details for the file sccb-0.4.2-py3-none-any.whl.

File metadata

  • Download URL: sccb-0.4.2-py3-none-any.whl
  • Upload date:
  • Size: 7.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for sccb-0.4.2-py3-none-any.whl
Algorithm Hash digest
SHA256 6b729a97d6dbc474788d982d116cead95aaac9a9cea774f36140bdb65724d8b9
MD5 cd69cbe7c1f5fafe3e935aa0aebd30db
BLAKE2b-256 8581ba14a2ce5d95bd8d51cffab4e593be96f4e701ec09e510f74f77e0fede2a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page