Hi all,

I am looking for a local database that is easily accessible via the command line.

It can be SQL or non-SQL

Whats my use case? I want to use it kinda like a second brain. A place to save my notes, my todo lists, my book reading lists, links / articles to read later, etc.

I want it to be a good CLI citizen so that I can script its commands to create simpler abstractions, rather than writing out the full queries every time.

Maybe sqlite is what I need, but is that ideal for my use case?

Edit: removed notes, as evidently they aren’t suitable for this and aren’t like the rest.

27 points

Counter-proposal: Perhaps use Obsidian instead?

permalink
report
reply
1 point

I want something I can use from the command line, so that I can integrate and interface it with other unix tools and scripts.

permalink
report
parent
reply
3 points

As far as I can tell, you can do.

permalink
report
parent
reply
1 point

Oh wow that’s pretty cool. From my understanding this is good for notes, but would it work for tasks / todos?

permalink
report
parent
reply
5 points

I second this, as it’s my use case.

Providing you lay out each note correctly with appropriate frontmatter, Dataview’s DQL and DataviewJS give you all the SQL-like functionality you could want.

Plus a load of useful functionality beyond a plain DB.

permalink
report
parent
reply
6 points
*

Add in the local REST API as well if you want to easily interact with your notes programmatically:

https://github.com/coddingtonbear/obsidian-local-rest-api

permalink
report
parent
reply
5 points

Had no idea about this. Very useful, thanks!

permalink
report
parent
reply
3 points
*

They aren’t exactly CLI but I really like obsidian for taking notes. It’s not open source though. Logseq is good too and is OSS. Both use markdown for formatting so if you are familiar with writing pages on GitHub you’ll have no trouble. Even if not markdown is super easy to learn. That and all of your data stays local and in open formats. I edit my stuff in a terminal anyway.

Just look up obsidian OSINT on YouTube you’ll find some good stuff on how to use it.

Another thought is just use markdown files and a directory structure in a private git repo. You’d be able to interact with it locally entirely in the terminal with vim etc and have the option of going online and searching or organizing etc. You could probably even use a cli browser for that part if you wanted.

permalink
report
reply
4 points

Definitely sounds like sqlite.

permalink
report
reply
2 points

If you want something a bit more powerful than SQLite, MySQL and PostgreSQL both support CLI interactions and scripting too.

permalink
report
reply
2 points

For note-taking and to-do lists both seem a bit overkill, and I’d recommend MariaDB instead of MySQL.

permalink
report
parent
reply
2 points

I agree they’re overkill. I’d use something like Joplin for note taking and to-do lists, which stores its data in SQLite anyway.

permalink
report
parent
reply
10 points

@matcha_addict Anything beyond SQLite is too heavy, but if it were me I would use a lightweight wiki like dokuwiki. Having to run SQL to do all these sorts of things sounds like it would just get in the way of both getting and consuming your thoughts.

permalink
report
reply
-1 points

I don’t think it would suffice. It would work for notes, but I want to also have a todo list in there, for example. Be able to check things off, query by due date, by assignee or task, etc.

permalink
report
parent
reply
4 points

For todo stuff there’s the excellent “todo-txt” for cli use. Though not great for notes. Perhaps separate tools would be fine?

permalink
report
parent
reply
1 point
*
1 point

Todo txt lacked some features I needed, which would be trivial to implement as a SQL column.

I do not remember what it was… Maybe it was dependent tasks? I believe so.

permalink
report
parent
reply
2 points

Org mode, org roam, org agenda and org-ql

permalink
report
parent
reply
13 points

I don’t think a database is a good fit for your use case at all, unless you’re willing to reinvent a lot of wheels.

permalink
report
parent
reply
2 points

What would then? I haven’t found anything that has command line interface and supports dependent tasks and a flexible, queryable tag system

permalink
report
parent
reply
6 points

Linux

!linux@lemmy.ml

Create post

From Wikipedia, the free encyclopedia

Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).

Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word “Linux” in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.

Rules

  • Posts must be relevant to operating systems running the Linux kernel. GNU/Linux or otherwise.
  • No misinformation
  • No NSFW content
  • No hate speech, bigotry, etc

Related Communities

Community icon by Alpár-Etele Méder, licensed under CC BY 3.0

Community stats

  • 9.5K

    Monthly active users

  • 3.2K

    Posts

  • 37K

    Comments