{"id":28609922,"url":"https://github.com/snipt/snipt","last_synced_at":"2025-06-11T22:07:40.358Z","repository":{"id":292159804,"uuid":"954898264","full_name":"snipt/snipt","owner":"snipt","description":"Snipt is a powerful text snippet expansion tool!","archived":false,"fork":false,"pushed_at":"2025-05-18T09:46:14.000Z","size":878,"stargazers_count":68,"open_issues_count":3,"forks_count":1,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-05-18T10:30:59.398Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/snipt.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-03-25T19:35:49.000Z","updated_at":"2025-05-18T09:46:17.000Z","dependencies_parsed_at":null,"dependency_job_id":"34cf9aca-c21b-4328-a452-6c3b3d2d8f9b","html_url":"https://github.com/snipt/snipt","commit_stats":null,"previous_names":["snipt/snipt"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/snipt/snipt","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/snipt%2Fsnipt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/snipt%2Fsnipt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/snipt%2Fsnipt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/snipt%2Fsnipt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/snipt","download_url":"https://codeload.github.com/snipt/snipt/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/snipt%2Fsnipt/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259352880,"owners_count":22844740,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-06-11T22:02:06.701Z","updated_at":"2025-06-11T22:07:40.353Z","avatar_url":"https://github.com/snipt.png","language":"Rust","funding_links":[],"categories":["Rust","\u003ca name=\"cheatsheet\"\u003e\u003c/a\u003eCommands cheatsheet and snippets","💻 Apps"],"sub_categories":["🚀 Productivity and Utilities"],"readme":"\u003cdiv align=\"center\"\u003e\n\n# Snipt\n\n[![Rust Version](https://img.shields.io/badge/rust-1.56+-orange.svg)](https://www.rust-lang.org/)\n[![Platform](https://img.shields.io/badge/platform-Linux%20%7C%20macOS%20%7C%20Windows-blue.svg)]()\n\n\u003c/div\u003e\n\n---\n## 🚀 Overview\n\nsnipt is a powerful text snippet expansion tool that boosts your productivity by replacing short text shortcuts with longer content. Just type a prefix (like `:`) followed by your shortcut, and snipt automatically expands it into your predefined text.\n\n## ✨ Key Features\n\n- **Custom Text Snippets**: Define shortcut aliases for frequently used text\n- **System-Wide Expansion**: Works in any application where you can type\n- **Modern TUI**: Beautiful terminal interface for managing snippets\n- **Background Daemon**: Silent monitoring of keyboard input for expansion\n- **Cross-Platform**: Works seamlessly on Linux, macOS, and Windows\n- **Clipboard Integration**: Quickly copy expansions to clipboard\n- **Script Execution**: Execute shell scripts and commands with `!` prefix\n- **Parameterized Snippets**: Create dynamic snippets with parameters\n- **Text Transformations**: Transform text with case conversion, formatting, and more\n- **URL Commands**: Execute web requests and process responses\n- **Code Snippets**: Store and expand code snippets with syntax highlighting\n- **Date and Time**: Insert formatted dates and times\n- **File Operations**: Create projects and perform file operations\n- **System Information**: Get system stats and information\n- **Network Tools**: Make HTTP requests and process responses\n- **CSV Processing**: Convert CSV to markdown tables and other formats\n\n## 📦 Installation\n\n### Via Cargo (Recommended)\n\n```bash\n# Install directly from crates.io\ncargo install snipt\n```\n\n### From Source\n\n```bash\n# 1. Install Rust if needed (https://rustup.rs/)\ncurl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh\n\n# 2. Clone and build snipt\ngit clone https://github.com/snipt/snipt.git\ncd snipt\ncargo build --release\n\n# 3. Install the binary (optional)\ncargo install --path .\n```\n\n## 🎮 Usage\n\n### Starting snipt\n\n```bash\n# Launch interactive UI\nsnipt\n\n# Start the daemon (required for expansion)\nsnipt start\n```\n\n### Managing Snippets\n\n```bash\n# Add a snippet\nsnipt add --shortcut hello --snippet \"Hello, world!\"\n\n# Add interactively\nsnipt new\n\n# View and manage all snippets\nsnipt list\n\n# Remove a snippet\nsnipt delete --shortcut hello\n\n# Update existing snippet\nsnipt update --shortcut hello --snippet \"Hello there, world!\"\n```\n\n### Using Snippets\n\nSnipt supports two types of triggers:\n\n1. **Colon Trigger (`:`)**: For simple text expansion\n   ```\n   :hello  # Expands to \"Hello, world!\" (if you've created this snippet)\n   ```\n\n2. **Exclamation Trigger (`!`)**: For executing scripts and transformations\n   ```\n   !now    # Inserts current date and time (if you've created this snippet)\n   !uppercase(hello)  # Transforms to \"HELLO\" (if you've created this snippet)\n   ```\n\n\u003e **Important Note**: All snippets, including text transformations and commands, must be created first using `snipt add` or `snipt new` before they can be used. The examples above assume you have already created these snippets. See the \"Managing Snippets\" section below for how to create your own snippets.\n\n### Parameterized Snippets\n\nCreate dynamic snippets with parameters:\n\n```bash\n# Add a parameterized snippet\nsnipt add --shortcut \"greet(name)\" --snippet \"Hello, ${name}!\"\n\n# Usage\n!greet(John)  # Expands to \"Hello, John!\"\n```\n\n### Script Execution\n\nExecute shell scripts and commands:\n\n```bash\n# Add a script snippet\nsnipt add --shortcut \"sys-info\" --snippet \"#!/bin/bash\\necho '=== System Information ==='\\necho 'Hostname: $(hostname)'\"\n\n# Usage\n!sys-info  # Executes the script and inserts output\n```\n\n### Text Transformations\n\nTransform text with built-in functions. Remember to create these snippets first:\n\n```bash\n# First, create the transformation snippets\nsnipt add --shortcut \"uppercase\" --snippet \"#!/bin/bash\\necho \\\"$1\\\" | tr '[:lower:]' '[:upper:]'\"\nsnipt add --shortcut \"lowercase\" --snippet \"#!/bin/bash\\necho \\\"$1\\\" | tr '[:upper:]' '[:lower:]'\"\nsnipt add --shortcut \"titlecase\" --snippet \"#!/bin/bash\\necho \\\"$1\\\" | sed 's/.*/\\L\u0026/; s/[a-z]*/\\u\u0026/g'\"\n\n# Then you can use them like this:\n!uppercase(hello)  # HELLO\n!lowercase(HELLO)  # hello\n!titlecase(hello world)  # Hello World\n```\n\n### Monitoring \u0026 Control\n\n```bash\n# Check daemon status\nsnipt status\n\n# Stop the daemon\nsnipt stop\n```\n\n## 💡 How Expansion Works\n\nOnce the daemon is running, type your prefix followed by a shortcut anywhere on your system:\n\n```\n:hello\n```\n\nThis instantly expands to \"Hello, world!\" (or your custom text).\n\n## 🖥️ Terminal User Interface\n\n\u003cdiv align=\"center\"\u003e\n\n![snipt TUI Screenshot](assets/images/snipt-tui-screenshot.png)\n\n\u003c/div\u003e\n\nLaunch the beautiful terminal UI with either `snipt` or `snipt list`.\n\n### Navigation\n\n| Key         | Action                     |\n|-------------|----------------------------|\n| ↑/↓         | Navigate through snippets  |\n| Tab         | Switch between tabs        |\n| Enter       | Copy to clipboard          |\n| /           | Search snippets            |\n| Ctrl+D      | Delete selected snippet    |\n| Esc/q       | Exit                       |\n\n## ⚙️ Configuration\n\nsnipt stores your data in `~/.snipt/`:\n\n- `snipt.json`: Your snippet database\n- `snipt-daemon.pid`: Process ID of running daemon\n\n## 🧩 Architecture\n\nsnipt consists of several components:\n\n- **Core Library**: Handles snippet management, persistence, and expansion\n- **Daemon**: Background process that listens for keyboard events\n- **CLI**: Command-line interface for controlling snipt\n- **TUI**: Terminal user interface for snippet management\n- **Server**: HTTP API for potential GUI clients\n- **Execution Engine**: Handles script execution and text transformations\n- **Storage**: Manages snippet persistence and configuration\n- **Keyboard**: Handles system-wide keyboard monitoring\n- **Clipboard**: Manages clipboard operations\n\n## 🔨 Requirements\n\n- Rust 1.56+\n- Core dependencies: rdev, clap, serde, crossterm, ratatui, enigo, arboard\n\n### System Dependencies\n\n#### Linux (Ubuntu/Debian)\n```bash\nsudo apt-get update\nsudo apt-get install -y libx11-dev libxi-dev libxtst-dev pkg-config libxdo-dev\n```\n\n#### Linux (Fedora/RHEL)\n```bash\nsudo dnf install libX11-devel libXi-devel libXtst-devel pkg-config libxdo-devel\n```\n\n#### Linux (Arch Linux)\n```bash\nsudo pacman -S libx11 libxi libxtst pkg-config xdotool\n```\n\n#### Linux (openSUSE)\n```bash\nsudo zypper install libX11-devel libXi-devel libXtst-devel pkg-config libxdo-devel\n```\n\nNote: These dependencies are required for X11 window system integration and keyboard monitoring functionality.\n\n## 🤝 Contributing\n\nContributions are welcome! Please feel free to:\n\n1. Fork the repository\n2. Create a feature branch\n3. Submit a pull request\n\n## 📜 License\n\nMIT\n\n---\n\n\u003cdiv align=\"center\"\u003e\n  \u003cp\u003eBuilt with ❤️ using Rust\u003c/p\u003e\n\u003c/div\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsnipt%2Fsnipt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsnipt%2Fsnipt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsnipt%2Fsnipt/lists"}