All Projects → yuis-ice → note-cli

yuis-ice / note-cli

Licence: other
Markdown Indexing and Pcre Regular Expression Compatible Full Text Searching for Advanced Note Takers.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to note-cli

Codex
A free note-taking software for programmers and Computer Science students
Stars: ✭ 242 (+1513.33%)
Mutual labels:  notetaking, notetaking-applications
zhamao-framework
协程、高性能、灵活的聊天机器人 & Web 开发框架(炸毛框架)
Stars: ✭ 99 (+560%)
Mutual labels:  cmdline
go-http-file-server
Simple command line based HTTP file server to share local file system
Stars: ✭ 90 (+500%)
Mutual labels:  cmdline
Flashtext
Extract Keywords from sentence or Replace keywords in sentences.
Stars: ✭ 5,012 (+33313.33%)
Mutual labels:  search-in-text
regXwild
⏱ Superfast ^Advanced wildcards++? | Unique algorithms that was implemented on native unmanaged C++ but easily accessible in .NET via Conari (with caching of 0x29 opcodes +optimizations) etc.
Stars: ✭ 20 (+33.33%)
Mutual labels:  search-in-text
Flexsearch
Next-Generation full text search library for Browser and Node.js
Stars: ✭ 8,108 (+53953.33%)
Mutual labels:  search-in-text
The silver searcher
A code-searching tool similar to ack, but faster.
Stars: ✭ 23,030 (+153433.33%)
Mutual labels:  search-in-text
pg-tsquery
🔍 Parse user input into a valid PostgreSQL tsquery
Stars: ✭ 48 (+220%)
Mutual labels:  search-in-text
septum
Context-based code search tool
Stars: ✭ 25 (+66.67%)
Mutual labels:  search-in-text
sliceslice-rs
A fast implementation of single-pattern substring search using SIMD acceleration.
Stars: ✭ 66 (+340%)
Mutual labels:  search-in-text
textics
📉 JavaScript Text Statistics that counts lines, words, chars, and spaces.
Stars: ✭ 36 (+140%)
Mutual labels:  search-in-text
ngp
Ncurses code parsing tool
Stars: ✭ 52 (+246.67%)
Mutual labels:  search-in-text
Ambar
🔍 Ambar: Document Search Engine
Stars: ✭ 1,829 (+12093.33%)
Mutual labels:  search-in-text
jseval
Evaluate JavaScript on a URL through headless Chrome browser.
Stars: ✭ 19 (+26.67%)
Mutual labels:  cmdline
notesnook
A fully open source & end-to-end encrypted note taking alternative to Evernote.
Stars: ✭ 5,098 (+33886.67%)
Mutual labels:  note-taking-app
ttdl
TTDL - Terminal Todo List Manager
Stars: ✭ 91 (+506.67%)
Mutual labels:  cmdline
sqip
SQIP is a tool for SVG-based LQIP image creation written in go
Stars: ✭ 46 (+206.67%)
Mutual labels:  cmdline
osmosnote
The knowledge IDE
Stars: ✭ 69 (+360%)
Mutual labels:  notetaking
laravel-scout-settings
DEPRECATED: Use of this repository is deprecated. Please use Scout Extended - https://github.com/algolia/scout-extended instead.
Stars: ✭ 23 (+53.33%)
Mutual labels:  search-in-text
bulksearch
Lightweight and read-write optimized full text search library.
Stars: ✭ 108 (+620%)
Mutual labels:  search-in-text

Note-CLI

Markdown Indexing and Pcre Regular Expression Compatible Full Text Searching for Advanced Note Takers.

Quick Start

# indexing file
./note-cli.js --index --database notes.db.example --file notes.md.example

# searching for keywords by regular expression
./note-cli.js --search --database notes.db.example --header "python" --content "hello.?world" --hide-sql

# and you will get:
[
    {
        "id": 2,
        "header": "how to hello world in python",
        "content": "```py \n# how to hello world in python\n\nprint(\"hello world\")\n```\n\n",
        "entire_note": "# how to hello world in python\n\n```py \n# how to hello world in python\n\nprint(\"hello world\")\n```\n\n"
    }
]

Basic concept

There are great note taking tools over there, such as Evernote. But the reason I quit using Evernote was its poor searching capability (i.e. cannot search some special characters; cannot search with regular expression, of course) and also, lack of extensibility. That's where Note-CLI comes in.

I'm kind of person who likes to take a note on my favorite text editor (Atom editor, for my case). For note taking, I have a single Markdown format text file. In it, I do take notes about everything. Note-CLI does work for indexing chunks of Markdown content to a database file and enables you to search your Markdown notes with SQL query (and also regex).

Installation

git clone https://github.com/yuis-ice/note-cli.git
cd note-cli
chmod 755 ./note-cli.js # if needed
npm i

Requirement

  • node.js v13.10.1 (probably higher or other versions work)
  • sqlite3-pcre
# node.js [nvm-sh/nvm](https://github.com/nvm-sh/nvm)
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.37.2/install.sh | bash
bash
nvm install v13.10.1
node -v

# sqlite3-pcre
sudo apt update
sudo apt install sqlite3 sqlite3-pcre

Examples

https://yuis.xsrv.jp/images/ss/ShareX_ScreenShot_da0baae1-0746-49b4-ab0d-790b1adddb7c.png

./note-cli.js --search --database notes.db.example --header "python" --content "hello.?world" --limit 1 --hide-sql --format md | bat -l md --paging=never # using [sharkdp/bat](https://github.com/sharkdp/bat) *image
./note-cli.js --search --database notes.db.example --header "python" --content "hello.?world" --limit 1 --hide-sql --format json | jq ".[].header" -r # using [jq](https://github.com/stedolan/jq/)
./note-cli.js --search --database notes.db.example --header "python" --content "hello.?world" --limit 1 --hide-sql --format html | jq ".[].entire_note" -r
./note-cli.js --search --database notes.db.example --header "python" --content "hello.?world" --limit 1 --raw-sql "$( cat raw-sql.sql.example )"

Command line options

$ ./note-cli.js --help
Usage: note-cli [options]

Options:
  -i, --index            set command type: index
  -f, --file <file>      (index) specify file to index (default: null)
  -s, --search           set command type: search
  -r, --regex            (search) enable regex extension for search (default: true)
  --header <keyword>     (search) search by header (default: ".")
  --content <keyword>    (search) search by content (default: ".")
  --note <keyword>       (search) search by note (default: ".")
  --limit <number>       (search) set limit for search (default: -1)
  -S, --raw-sql <sql>    (search) use raw SQL query for search (default: null)
  -H, --hide-sql         (search) disable showing sql query executed
  -F, --format <format>  (search) output format (default: "json")
  --pcre-path <file>     set sqlite3 pcre file path for search (default: "/usr/lib/sqlite3/pcre.so")
  -d, --database <file>  specify database file for index/search (default: "./note-cli.db")
  --delete-database      delete database
  -y, --yes              no confirmation prompt
  -h, --help             display help for command

LICENSE

Note-CLI is released under the BSD-3-Clause license.

Copyright (c) 2021, Fumiya Arisaka [email protected] All rights reserved.

This source code is licensed under the BSD-style license found in the LICENSE file in the root directory of this source tree.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].