GithubHelp home page GithubHelp logo

snipt's Introduction

snipt

multiple remote platform snippet-code manager command.

Features

  • Supported Github Gist and Gitlab Snippets.
  • Can Get/Update/Delete Remote Snippets(Gist/Gitlab Snippets), and Edit them directly in your local editor.
  • Supports group projects snippet creating at Gitlab Snippets.
  • Like pet, you can choose Remote Snippets with peco or fzf.

Install

go get github.com/blacknon/snipt

Configuration

The configuration file is auto-generated in $XDG_CONFIG_HOME/snipt/config.toml or $HOME/.snipt/config.toml by default.

[General]
  editor = "vim"                                  # your favorite text editor
  selectcmd = "peco"                              # elector command for edit command (fzf or peco)

[[Gist]]
  access_token = "ghp_hogehogefugafuga"           # gist access token

[[Gitlab]]
  url = "https://gitlab.com/api/v4"               # gitlab1 url
  access_token = "glplat-hogehogefugafuga"        # gitlab1 access token

[[Gitlab]]
  url = "https://hogehoge.gitlab.local/api/v4"    # gitlab2 url
  access_token = "glplat-testtest123123"          # gitlab2 access token

Usage

NAME:
   snipt - multiple remote platform snippet manager.

USAGE:
   snipt [global options] command [command options] [arguments...]

VERSION:
   0.1.0

COMMANDS:
   list     list all snippet.
   get      get remote snippet data.
   create   create remote snippet. default by github creates a secret gist, gitlab snippet creates a private snippet.
   update   update remote snippet data.
   edit     edit remote snippet file. use the command specified in `editor` in config.toml for editing.
   delete   delete remote snippet data.
   help, h  Shows a list of commands or help for one command

GLOBAL OPTIONS:
   --config FILE, -c FILE  load configuration from FILE
   --help, -h              show help
   --version, -v           print the version

Edit snippet

use edit subcommand.

NAME:
   snipt edit - edit remote snippet file. use the command specified in `editor` in config.toml for editing.

USAGE:
   snipt edit [command options] [arguments...]

OPTIONS:
   --visibility github gist, -v github gist  specify visibility according to each github gist/`gitlab snippet`. (default: false)
   --title value, -t value                   specify remote snippet title.
   --secret, -s                              printout (default: false)
   --help, -h                                show help
snipt edit <options...>

Get snippet list

use list subcommand.

NAME:
   snipt list - list all snippet.

USAGE:
   snipt list [command options] [arguments...]

OPTIONS:
   --file, -f    output snippet by file (default: false)
   --secret, -s  printout (default: false)
   --help, -h    show help
snipt list <options...>

Create snippet

use create subcommand.

NAME:
   snipt create - create remote snippet. default by github creates a secret gist, gitlab snippet creates a private snippet.

USAGE:
   snipt create [command options] FILE...

OPTIONS:
   --visibility github gist, -v github gist  specify visibility according to each github gist/`gitlab snippet`. (default: false)
   --title value, -t value                   specify remote snippet title.
   --project_snippet, -p                     output to a list so that it can also support the creation of Gitlab's Project Snippet. (default: false)
   --help, -h                                show help
snipt create <options...> /path/to/file

Get snippet

use get subcommand.

NAME:
   snipt get - get remote snippet data.

USAGE:
   snipt get [command options] [arguments...]

OPTIONS:
   --output PATH, -o PATH  output snippet to PATH
   --file, -f              output snippet by file (default: false)
   --secret, -s            printout (default: false)
   --read, -r              printout to stdout from snippet. (default: false)
   --help, -h              show help
snipt get <options...>

Update snippet

NAME:
   snipt update - update remote snippet data.

USAGE:
   snipt update [command options] [arguments...]

OPTIONS:
   --file, -f                                output snippet by file (default: false)
   --visibility github gist, -v github gist  specify visibility according to each github gist/`gitlab snippet`. (default: false)
   --title value, -t value                   specify remote snippet title.
   --secret, -s                              printout (default: false)
   --help, -h                                show help
snipt update <options...> /path/to/file

Delete snippet

NAME:
   snipt delete - delete remote snippet data.

USAGE:
   snipt delete [command options] [arguments...]

OPTIONS:
   --secret, -s  printout (default: false)
   --help, -h    show help
snipt delete <options...>

snipt's People

Contributors

blacknon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

snipt's Issues

Client does not deal with pagination

If you have more than 20 snippets at the root (unassociated with a project) snipt is unable to access any but the most recent 20 items.
╰─ snipt list -s -f | wc -l ─╯ 20

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.