一个简单、功能齐全的命令行笔记工具,使用 Rust 编写
# | |_| |__ ___ ___ __ _
# | __| _ \ / _ \/ __/ _` |
# | |_| | | | __/ (_| (_| |
# \__|_| |_|\___|\___\__,_|
#a simple, fully featured, command line note taking tool written in Rust.
STDIN, or using the editor set via $VISUAL
or $EDITORI've built a simple multi-(platform/arch) binary package builder (tools/theca-packer.py)
based on Fabric so I can provide both x86_64 and i686 packages
for unknown-linux-gnu and apple-darwin. You can either download the binary packages and install
them using the packaged install.sh script, or you can use curl to install theca like so
$ curl -s https://static.bracewel.net/theca/get_theca.sh | shIf you want to uninstall you just need to add the --uninstall flag like so
$ curl -s https://static.bracewel.net/theca/get_theca.sh | sh -s -- --uninstallAll that's needed to build theca is a copy of the rustc compiler and the cargo packaging tool which can
be downloaded directly from the Rust website or by running
$ curl -s https://static.rust-lang.org/rustup.sh | shto get the nightly rustc and cargo binaries, once those have finished building we can clone and build theca
$ git clone https://github.com/rolandshoemaker/theca.git
...
$ cd theca
$ cargo build [--release]
...
$ sudo bash tools/build.sh install [--release, --man, --bash-complete, --zsh-complete]The cargo flag --release enables rustc optimizations. F
The cargo flag --release enables rustc optimizations.or the install the flag --man
will additionally install the man page and --bash-complete and --zsh-complete will
additionally install the bash or zsh tab completion scripts. cargo will automatically
download and compile thecas dependencies for you.
$ theca --help
theca - simple cli note taking tool
Usage:
theca [options] new-profile []
theca [options] encrypt-profile [--new-key KEY]
theca [options] decrypt-profile
theca [options] info
theca [options] clear
theca [options]
theca [options]
theca [options] search [--regex, --search-body]
theca [options] transfer to
theca [options] import from
theca [options] add [-s|-u] [-b BODY|-t|-]
theca [options] edit [] [-s|-u|-n] [-b BODY|-t|-]
theca [options] del ...
Profiles:
-f PATH, --profile-folder PATH Path to folder containing profile.json
files [default can be set with env var
THECA_PROFILE_FOLDER].
-p PROFILE, --profile PROFILE Specify non-default profile [default
can be set with env var
THECA_DEFAULT_PROFILE].
Printing format:
-c, --condensed Use the condensed printing format.
-j, --json Print list output as a JSON object.
Note list formatting:
-l LIMIT, --limit LIMIT Limit output to LIMIT notes
[default: 0].
-d, --datesort Sort notes by date.
-r, --reverse Reverse list.
Input:
-y, --yes Silently agree to any [y/n] prompts.
Statuses:
-n, --none No status. (note default)
-s, --started Started status.
-u, --urgent Urgent status.
Body:
-b BODY, --body BODY Set body of the note to BODY.
-t, --editor Drop to $EDITOR to set/edit note body.
- Set body of the note from STDIN.
Encryption:
-e, --encrypted Specifies using an encrypted profile.
-k KEY, --key KEY Encryption key to use for encryption/
decryption, a prompt will be
displayed if no key is provided.
--new-key KEY Specifies the encryption key for a
profile when using `encrypt-profile`,
a prompt will be displayed if no key
is provided.
Search:
--search-body Search the body of notes instead of
the title.
--regex Set search pattern to regex (default
is keyword).
Miscellaneous:
-h, --help Display this help and exit.
-v, --version Display the version of theca and exit.theca new-profile will create the ~/.theca folder as well as the default
note profile in ~/.theca/default.json. If you would like to use a non-standard
profile folder you can use --profile-folder PATH.
theca add will add a note to the default profile with no body or status.
These flags can be used to add a note with a status and/or a body
Statuses:
-s, --started Started status.
-u, --urgent Urgent status.
Body:
-b BODY, --body BODY Set body of the note to BODY.
-t, --editor Drop to $EDITOR to set/edit note body.
- Set body of the note from STDIN.theca edit is used to edit the title, status, or body of a note.
Statuses:
-n, --none No status. (note default)
-s, --started Started status.
-u, --urgent Urgent status.
Body:
-b BODY, --body BODY Set body of the note to BODY.
-t, --editor Drop to $EDITOR to set/edit note body.
- Set body of the note from STDIN.theca del .. deletes one or more notes specified by space separated note ids.
theca prints out all notes in the current profile, the following options can be
used to limit/sort the resulting list
Printing format:
-c, --condensed Use the condensed printing format.
-j, --json Print list output as a JSON object.
Note list formatting:
-l LIMIT, --limit LIMIT Limit output to LIMIT notes.
[default: 0].
-d, --datesort Sort notes by date.
-r, --reverse Reverse list.theca prints out a single note, including the status and body, the following
options can be used to alter the output style
Printing format:
-c, --condensed Use the condensed printing format.
-j, --json Print list output as a JSON object.Notes can be search using either keyword or regex matching against note titles or bodies
using theca search. theca doesn't support any kind of tagging (beyond the two basic
statuses) but you can implement this quite simply by just appending or prepending a tag
of sorts to the note title or body, e.g. "(THECA) something about theca", and then
do a keyword search for "(THECA)" to get all notes tagged as such.
Search:
--search-body Search the body of notes instead of
the title.
--regex Set search pattern to regex (default
is keyword).During initial development of theca I spent quite a bit of time trying to figure out
what statuses I should include (or if I should allow completely custom statuses) and after
playing with quite a few I ended up realising I only ever used three (well... two, if that).
-n or --none)Started (-s or --started)Urgent (-u or --urgent)These flags can be used when adding notes, editing notes, searching notes, and listing events to either specify the note status or filter lists by status.
New named profiles can be created with the theca new-profile command and will be
stored alongside default.json in either ~/.theca/ or in the folder specified by
--profile-folder PATH.
The default profile that theca loads (normalled default) can be changed by setting the
environment variable THECA_DEFAULT_PROFILE.
The default profile folder can also be set via a enviroment variable, THECA_PROFILE_FOLDER.
All profiles in the current profile folder can be view using theca list-profiles.
theca transfer to transfers a note from the current profile (in this case
default) to another profile.
theca import from transfers a note from the profile `` to
the current profile (in this case default).
Using --encrypted tells theca that it should be dealing with encrypted profiles, so
using theca --encrypted new-profile secrets theca knows to create an encrypted profile
and will ask you for a key to encrypt the resulting secrets.json. If you'd like not to
be prompted you can specify it with the argument --key KEY.
--encrypted and --key can be used with all the other commands that read or write a
profile to specify that the profile you want to use will ne
暂无开放 Issues,或尚未同步最近议题。