GithubHelp home page GithubHelp logo

snippet-manager's Introduction

CLI snippet manager

This is a CLI app for managing code snippets which was created just for fun. The app uses JSON files to store snippets.

Requirements

Installation

  1. Clone the repository: git clone github.com/artm04/snippet-manager
  2. Install the dependencies: pip install -r requirements.txt
  3. Run the app: python snipman.py -h

Usage

positional arguments:
  command               The command to run (add, delete, list, copy)

options:
  -h, --help            show this help message and exit
  --snippet_id [SNIPPET_ID]
                        The id of the snippet.
  --name [NAME]         The name of the snippet.

Add a snippet

The add command adds a code snippet to the given file. Specify the --name option. To stop the input for your code, press Ctrl+D on Linux or Ctrl+Z on Windows.

$ python snipman.py add --name helloworld
Enter the code below:
print("Hello, World!")
<Ctrl+D>

Delete a snippet

The delete command deletes a code snippet from the given file by its ID. Specify the --snippet_id option.

$ python snipman.py delete --snippet_id 1

Copy a snippet

The copy command copies a code snippet to the clipboard by its ID. Specify the --snippet_id option.

$ python snipman.py copy --snippet_id 1

List all snippets

The list command lists all snippets in the given file.

$ python snipman.py list
1: helloworld
2: hello

Demo of the app on Asciinema

asciicast

snippet-manager's People

Contributors

artm04 avatar

Stargazers

Martin Lechêne avatar

Watchers

 avatar

Forkers

daniel-dev-lab

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.