swiss-knife-cli
v1.4.0
Published
A beautiful Swiss Army knife CLI tool for developers
Maintainers
Readme
🇨🇭 Swiss Knife CLI
A beautiful, interactive CLI tool that serves as a collection of daily developer utilities. Features a stunning interface with gradients, emojis, and ASCII art throughout.
✨ Features
Interactive Menu
Simply type sk to launch an interactive menu where you can:
- Navigate with arrow keys
- Select tools with Enter
- Exit gracefully anytime
Available Tools
🔑 Test ID Generator (sk testid / sk tid)
Generate data-testid attributes for testing with customizable options:
- Custom length (default: 21 characters)
- Generate multiple IDs at once
- Alphanumeric characters only (A-Za-z0-9)
- Automatic clipboard copying
- Beautiful table output
🔀 Git Branch Rename (sk git-rename / sk grn)
Rename git branches both locally and on remote:
- Auto-detect current branch
- Animated progress indicators
- Handles remote operations
- Graceful error handling
- Celebration on success
🔒 Base64 Encode/Decode (sk b64)
Smart base64 encoding/decoding with auto-detection:
- Automatic mode detection
- Support for piped input
- File input support
- Beautiful comparison tables
- Clipboard integration
🚀 Installation
From npm (Recommended)
# Install globally
npm install -g swiss-knife-cli
# Now you can use it anywhere!
skFrom Source
# Clone the repository
git clone https://github.com/alexgalkin94/swiss-knife-cli.git
cd swiss-knife-cli
# Install dependencies
npm install
# Build and link globally
npm run build && npm link
# Now you can use it anywhere!
sk📖 Usage
Interactive Mode (Recommended)
skNavigate the beautiful menu with arrow keys and select your tool!
Direct Commands
# Test ID Generator
sk testid # Generate one ID
sk testid --count 5 --length 15 # Generate 5 IDs of length 15
sk tid -c 3 -l 10 # Short form
# Git Branch Rename
sk git-rename old-branch new-branch # Rename specific branch
sk git-rename new-branch # Rename current branch
sk grn feature-new # Short form
# Base64 Encode/Decode
sk b64 "Hello World" # Auto-detect and encode
sk b64 "SGVsbG8gV29ybGQ=" # Auto-detect and decode
sk b64 -e "Hello" # Force encode
sk b64 -d "SGVsbG8=" # Force decode
echo "test" | sk b64 # Pipe input
sk b64 -f input.txt # Read from file🏗️ Architecture
The CLI is built with a modular architecture making it trivial to add new commands:
src/
├── index.ts # Main entry with interactive menu
├── commands/ # Individual command implementations
│ ├── testid.ts
│ ├── git-rename.ts
│ └── base64.ts
└── utils/ # Shared utilities
└── ui.ts # Beautiful UI componentsAdding a New Command
- Create a new file in
src/commands/your-command.ts - Export a registration function
- Import and register in
index.ts - Add to interactive menu
That's it! No core modifications needed.
🎨 Visual Features
- Gradient text using multiple color schemes
- ASCII art banner with custom font
- Colored tables for structured output
- Animated spinners for async operations
- Beautiful boxes for important information
- Consistent emoji usage for better scanning
- Theme system for consistent colors
🛠️ Development
# Run in development mode
npm run dev
# Build for production
npm run build
# Run TypeScript compiler
npm run build:tsc📦 Dependencies
- commander - CLI framework
- inquirer - Interactive prompts
- chalk - Terminal colors
- gradient-string - Beautiful gradients
- figlet - ASCII art text
- ora - Elegant spinners
- boxen - Terminal boxes
- cli-table3 - Beautiful tables
- nanoid - ID generation
- simple-git - Git operations
- clipboardy - Clipboard access
🎯 Design Philosophy
This isn't just a utility tool - it's a beautiful utility tool. Every command output is carefully crafted to be visually pleasing and delightful to use. The goal is to make you want to use it just to see the gorgeous output!
📄 License
MIT
