#pocket #snippets #control #name #version #pocket-cli

bin+lib pocket-cli

A CLI tool for saving, organizing, and retrieving code snippets with integrated version control

1 stable release

1.0.2 Mar 17, 2025
0.7.0 Mar 15, 2025
0.6.3 Mar 12, 2025
0.5.2 Mar 12, 2025
0.1.2 Mar 10, 2025

#380 in Filesystem

Download history 123/week @ 2025-03-04 821/week @ 2025-03-11 151/week @ 2025-03-18 9/week @ 2025-03-25 1/week @ 2025-04-01

1,105 downloads per month

MIT license

275KB
4K SLoC

Pocket


Hits-of-Code Crates.io License: MIT PRs Welcome

A CLI tool for saving, organizing, and retrieving code snippets with integrated version control. Because your brilliant solutions deserve better than being lost in a sea of Stack Overflow tabs.

Overview

Pocket helps developers save and find code snippets, manage version control, and automate workflows. It's designed to reduce the time spent searching for code you've already written—because let's face it, you've solved this problem before, you just can't remember where you put the solution.

Features

  • Snippet Management: Save, search, and reuse code snippets that would otherwise be destined for digital oblivion
  • Semantic Search: Find snippets using natural language queries, because remembering exact variable names from six months ago is unrealistic
  • Backpacks: Organize snippets into collections, like folders but with a more adventurous name
  • Workflows: Chain commands together for automation, because typing the same sequence repeatedly is soul-crushing
  • Cards: Extend functionality with plugins, for when the base features aren't quite enough
  • Shell Integration:
    • Add shell extensions that load when your terminal starts, providing aliases and functions
    • Create executable hooks that can be run directly with the @name command syntax

Quick Start

# Install (the beginning of a beautiful friendship)
cargo install pocket-cli

# Save a snippet (future you will thank present you)
pocket add file.js

# Find a snippet (with eerily human-like understanding)
pocket search "that thing with the loop"

# Use a snippet (the payoff moment)
pocket insert ID file.js

# Add a shell extension for aliases and functions
pocket blend my_aliases.sh

# Create an executable hook you can run with @name
pocket blend --executable my_script.sh

Documentation

For more detailed information, check out the documentation, which we've actually taken the time to write properly:

Issues and Support

If you encounter any issues or have questions, please create an issue on GitHub. Be sure to include details about your environment and the steps to reproduce the problem. The more specific you are, the faster we can help—vague bug reports are the digital equivalent of "it hurts when I do something."

Join the discord

Pocket CLI Discord Community

Version

Current version: v-pocket-R1

I use a versioning system with letter-based releases, because apparently semver was too mainstream. For more information, see my versioning philosophy.

GitHub stars Crates.io Downloads GitHub issues

License

MIT - Which means you can do pretty much whatever you want with this code, as long as you keep the copyright notice. Freedom comes with surprisingly little fine print sometimes.

Dependencies

~16–32MB
~490K SLoC