short-form

command module
v1.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 7, 2020 License: MIT Imports: 11 Imported by: 0

README

short-form

A command line journal for bite sized thoughts. Started as a project for practicing Golang, turned into something kinda useful!

Features

  1. Simple, short and concise CLI
  2. Efficient and reliable data storage (backed by sqlite3)

Installation

Binaries (Mac only)

64-bit Mac binaries can be found in dist/darwin.

From Source

These instructions require any recent (>= 1.13) version of Golang to be installed, alongside a compatible compiler. For example, I'm running go version go1.13.4 darwin/amd64 currently.

  1. go get github.com/ricanontherun/short-form
  2. cd $GOPATH/src/github.com/ricanontherun/short-form
  3. CGO_ENABLED=1 go build -o sf
  4. mv sf /usr/local/bin

Storage

Note data is stored on disk, in ~/.sf/data. The underlying storage engine is provided via https://github.com/mattn/go-sqlite3.

Usage

Display help sf --help

Writing notes
➜ sf w Hello, this is a note.

You can also tag notes using a comma,separated,list of tags.

➜ sf w -t git,cli git rebase: git rebase COMMIT
Searching Notes

Search by tag

➜ sf s -t git
2 note(s) found

December 08, 2019 02:39 PM | git
git rebase: git rebase COMMIT

December 08, 2019 02:43 PM | git
git rebase (interactive): git rebase -i COMMIT

Search by note content

➜ sf s -c rebase
1 note(s) found

December 08, 2019 02:39 PM | git, cli
git rebase: git rebase COMMIT
➜ sf s today
4 note(s) found

December 08, 2019 02:30 PM
Hello, this is the note.

December 08, 2019 02:39 PM | git, cli
git rebase: git rebase COMMIT

December 08, 2019 02:43 PM | git
git rebase (interactive): git rebase -i COMMIT

Display note details.

➜ sf s -d -t top-secret 
1 note(s) found

December 08, 2019 02:35 PM | NOTEID | top-secret
This is a secret note
Delete a note
➜ sf d NOTEID
Pretty Print (colors)
➜ sf -p ...
Configuration

You can configure short-form to use any file path for a database with the sf c d command. The filepath doesn't need to exist, short-form wil create it for you if need be.

sf c d -p /path/to/your/database

These configuration values are stored at ~/.sf/config.json and can be read via the following command:

sf configure read
sf c r
Shorthand

All commands and flags support short versions.

Search for yesterday's notes tagged as git-tricks

sf s -t git-tricks y

TODO

  1. Finish tests
  2. Binaries for Linux and Windows

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL