https://github.com/adoyle-h/ithoughts-search
A bash command for searching content from multi iThoughts (.itmz) files
https://github.com/adoyle-h/ithoughts-search
cli ithoughts itmz
Last synced: over 1 year ago
JSON representation
A bash command for searching content from multi iThoughts (.itmz) files
- Host: GitHub
- URL: https://github.com/adoyle-h/ithoughts-search
- Owner: adoyle-h
- License: apache-2.0
- Created: 2017-09-23T15:16:16.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2021-10-20T07:25:03.000Z (over 4 years ago)
- Last Synced: 2025-03-20T17:51:37.867Z (over 1 year ago)
- Topics: cli, ithoughts, itmz
- Language: Shell
- Homepage:
- Size: 19.5 KB
- Stars: 2
- Watchers: 1
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# iThoughts-Search
A bash command for searching content from multi iThoughts (.itmz) files.
## TOC
- [Dependencies](#dependencies)
- [Install](#install)
- [Usage](#usage)
- [Environment Variables](#environment-variables)
- [Example](#example)
- [Auto-Completion](#auto-completion)
- [Versioning](#versioning)
- [Copyright and License](#copyright-and-license)
## Dependencies
- GNU bash, 4.4.12(1)-release or above
- .itmz files must be created by iThoughts 4.12 or above
- [`ag`](https://github.com/ggreer/the_silver_searcher)
- `realpath`, which installed by `brew install coreutils`
- `cksum`, system default
## Install
```sh
# git clone the source code
src_dir=
git clone https://github.com/adoyle-h/iThoughts-Search "$src_dir"
# ITMZ_DIR: all your .itmz files should be put under this path.
export ITMZ_DIR=
# iThoughts-Search caches and logs will be put under the ITMZ_HOME
export ITMZ_HOME=${ITMZ_HOME:-$HOME/.itmz}
cat >> ~/.bashrc < [dir]` to search contents with `ag` from all `.itmz` files stored in specific directory.
- The search pattern is case-insensitive
- If `dir` is omit, it will search all `.imtz` files in `$ITMZ_DIR`. Otherwise, it will search files in `$ITMZ_DIR/$dir`.
- Each search will generator cache to speed up for next search in ITMZ_REF_DIR which is `$ITMZ_HOME/refs`.
- Each search will auto-update cache if the file has been modified.
- If you really worry about the cache-refreshing, use `itmz --cache-clean` to clean all caches.
- `itmz -l [dir]` to search matched filepaths with `ag` from all .itmz files stored in specific directory.
## Environment Variables
```sh
# all your .itmz files should be put under this path.
ITMZ_DIR=${ITMZ_DIR:?}
# iThoughts-Search caches and logs will be put under the ITMZ_HOME
ITMZ_HOME=${ITMZ_HOME:-$HOME/itmz}
```
## Example
## Auto-Completion
```sh
# For bash
source <(itmz --completion)
# or add it to your .bashrc to make it persist
echo "source <(itmz --completion)" >> ~/.bashrc && source ~/.bashrc
```
## Versioning
The versioning follows the rules of SemVer 2.0.0.
**Attentions**: anything may have **BREAKING CHANGES** at **ANY TIME** when major version is zero (0.y.z), which is for initial development and the public API should be considered unstable.
For more information on SemVer, please visit http://semver.org/.
## Copyright and License
Copyright (c) 2017-2021 ADoyle. The project is licensed under the **Apache License Version 2.0**.
See the [LICENSE][] file for the specific language governing permissions and limitations under the License.
See the [NOTICE][] file distributed with this work for additional information regarding copyright ownership.
[LICENSE]: ./LICENSE
[NOTICE]: ./NOTICE