Commit graph

14 commits

Author SHA1 Message Date
Jonathan Hodgson
4731545df5 Adds git-lfs as a dependency and initialises lfs in the repo 2020-12-23 11:43:18 +00:00
Jonathan Hodgson
f8260821ea Makes fuzzy the default
If no arguments are passed, it will open the fuzzy search

From here you can search, create and delete
2020-12-22 19:12:37 +00:00
Jonathan Hodgson
d70f5398a3 Adds the ability to index folder and re-populate the db
Misc:
The arguments are now sorted alphabetically in the main funciton

close #4
2020-12-22 09:38:04 +00:00
Jonathan Hodgson
5863d5a58f Moves FZF related code into an include 2020-12-22 09:15:35 +00:00
Jonathan Hodgson
34d0a6bf19 Removes some unneeded lines from an early version 2020-12-22 09:07:47 +00:00
Jonathan Hodgson
0ac730ca3c Adds pager option and uses $PAGER environment variable
Due to bat also reading the $PAGER environment variable, I first look to
see if bat is available. If it is, I use that. If it isn't, I use the
$PAGER environment variable. If that's not available, I use cat.

I also added the --editor flag to the help output which had clearly been
missed

Close #12
2020-12-22 08:58:53 +00:00
Jonathan Hodgson
90cef0d7c0 Makes fzf full height and aligns the help header 2020-12-21 20:22:26 +00:00
Jonathan Hodgson
828e21e328 Makes default operation after fzf viewing
Consider adding an option for this in the future
2020-12-21 20:08:02 +00:00
Jonathan Hodgson
f8d04a304a Adds key combinations for fuzzy search
Currently:
* ctrl-n - new file from query
* ctrl-o - view file
* ctrl-e - edit file
* ctrl-d - delete file

close #11
2020-12-21 18:28:13 +00:00
Jonathan Hodgson
caab854c09 Adds update command for externally modified files
This can be used when a file is modified externally. It will update the
sqlite database and potentially run git commands for the change.

If there are 2 files provided, it assumes that the file was moved. The
first filename should be the old file.

The new, edit and delete functions were also re factored slightly to use
this new update function.

Relevant to #4
Close #2
Close #1
2020-12-20 20:04:52 +00:00
Jonathan Hodgson
660c739c18 Moves safeSQL function to utils 2020-12-20 18:28:19 +00:00
Jonathan Hodgson
b84cf93f4a Adds list-tags option
This will list the tags along with the number of number of times it is
used.

An optional --noheader flag can be passed after the command to prevent
the header being printed.

e.g.

```
$ kb list-tags
name              count
----------------  -----
Linux             2
Authentication    1
Pentesting        1
Enumeration       3
Network Protocol  2
```

```
$ kb list-tags --noheader
Linux             2
Authentication    1
Pentesting        1
Enumeration       3
Network Protocol  2
```

This --noheader flag was also added to the list command

Close #10
2020-12-20 18:25:25 +00:00
Jonathan Hodgson
ac031344d3 Splits up file into smaller files
Closes issue #9
2020-12-20 17:07:17 +00:00
Jonathan Hodgson
8ddda7f2b4 This is the initial commit. See description for what currently works
Currently Working:
* creating files
* deleting files
* editing files
* viewing files
* searching by id
* git
    - Initialises repository
    - commits when a file is created or edited (except rename)
    - arbitrary git commands on repo with `kb git ....`
* sql
    - Database is kept up to date when files are added, deleted or
      edited

TODO:
* Recreate database if deleted or freshly cloned
* Add database to gitignore if not in normal location
* Update database if edited without this tool
* Create a git commit if files are deleted or renamed
* makefile for install and test (currently just surecheck)
2020-12-19 15:52:27 +00:00