Code Monkey home page Code Monkey logo

qc's Introduction

QOwnNotes command-line snippet manager

GitHub | Changelog | Releases

You can use the QOwnNotes command-line snippet manager to execute command snippets stored in notes in QOwnNotes from the command line.

qc

You can use notes with a special tag (commands by default) to store command snippets, which you can execute from the command-line snippet manager.

commands

For more information on how to add commands and configuration please see Command-line Snippet Manager.

The QOwnNotes command-line snippet manager is based on the wonderful pet CLI Snippet Manager.

Installation

Visit the latest release page and download the version you need.

If you have jq installed you can also use this snippet to download and install for example the latest Linux AMD64 binary to /usr/local/bin/qc:

curl https://api.github.com/repos/qownnotes/qc/releases/latest | \
jq '.assets[] | select(.browser_download_url | endswith("_linux_amd64.tar.gz")) | .browser_download_url' | \
xargs curl -Lo /tmp/qc.tar.gz && \
tar xfz /tmp/qc.tar.gz -C /tmp && \
rm /tmp/qc.tar.gz && \
sudo mv /tmp/qc /usr/local/bin/qc && \
/usr/local/bin/qc version

macOS / Homebrew

You can use homebrew on macOS to install qc.

brew install qownnotes/qc/qc

If you receive an error (Error: qownnotes/qc/qc 64 already installed) during brew upgrade, try the following command:

brew unlink qc && brew uninstall qc
rm -rf /usr/local/Cellar/qc/64
brew install qownnotes/qc/qc

Dependencies

fzf (fuzzy search) or peco (older, but more likely to be installed by default) need to be installed to search for commands on the command-line.

By default fzf is used for searching, but you can use peco by setting it with qc configure.

Usage

Usage:
qc [command]

Available Commands:
completion  generate the autocompletion script for the specified shell
configure   Edit config file
exec        Run the selected commands
help        Help about any command
search      Search snippets
version     Print the version number

Flags:
--config string   config file (default is $HOME/.config/qc/config.toml)
--debug           debug mode
-h, --help        help for qc

Use "qc [command] --help" for more information about a command.

Configuration

Run qc configure.

[General]
  editor = "vim"            # your favorite text editor
  column = 40               # column size for list command
  selectcmd = "fzf"         # selector command for edit command (fzf or peco)
  sortby = ""               # specify how snippets get sorted (recency (default), -recency, description, -description, command, -command, output, -output)

[QOwnNotes]
  token = "SECRET"          # your QOwnNotes API token
  websocket_port = 22222    # websocket port in QOwnNotes

Shell completion

You can generate shell completion code for your shell with qc completion <shell>.

For example for the Fish shell you can use:

qc completion fish > ~/.config/fish/completions/qc.fish

qc's People

Contributors

pbek avatar dependabot[bot] avatar

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.