Git Product home page Git Product logo

dnote's Introduction

Dnote

Build Status

Dnote is a simple command line notebook for programmers.

It keeps you focused by providing a way of effortlessly capturing and retrieving information without leaving your terminal. It also offers a seamless multi-device sync.

A demo of Dnote command line interface

Installation

On macOS, you can install using Homebrew:

brew tap dnote/dnote
brew install dnote

On Linux or macOS, you can use the installation script:

curl -s https://www.getdnote.com/install | sh

Otherwise, you can download the binary for your platform manually from the releases page.

Server

The quickest way to experience the Dnote server is to use Dnote Cloud.

Or you can install it on your server by using Docker, or using a binary.

Documentation

Please see Dnote wiki for the documentation.

See Also

dnote's People

Contributors

apostov avatar craigkai avatar erwyn avatar estysdesu avatar fearnotdaniel avatar girish3 avatar im-kulikov avatar klebervirgilio avatar liamjack avatar m42e avatar maml avatar martaccmoreno avatar michielboekhoff avatar monomaxbot avatar mprobson avatar newyork-anthonyng avatar nicknickel avatar rkuska avatar sungwoncho avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dnote's Issues

Autoupdate

WIP

If a new release is available, the program needs to fetch and self-update the binary.

Use SQLite

Currently all dnotes are in a single JSON file which gets read every time read/write happens. Using a relational database will:

  • increase stability through transaction (sync functionality)
  • remove awkwardness around migration
  • improve read speed through index (benchmark needed)

cons:

  • Maybe larger bundle size? (TODO: measure this)
  • Ejecting is harder because users no longer can just grep JSON and go.
    • However we can develop a built-in way to dump SQLite data. And if we can dump data in a more meaningful way than a single JSON file, it might be beneficial for users.

@YiiKuoChong @michielboekhoff @FearNotDaniel how do you feel about it?

Write tests to ensure feature-correctness.

As the project grows - which I certainly hope - and more features will be added, it will become more necessary to verify that new things don't break old things. As such, I think it would be very useful to at least implement unit tests of some sort.

Deprecate update command

While update command is pretty useful, I'd like to deprecate it.

  • does not support Windows (we cannot replace a program being used by another process) #76
  • CLI does too much and we should keep it simple
  • there is no way to future-proof any changes in the packaging (e.g. if we start compressing binary while distributing like .tar.gz it will break.

Suggestion:

  • Have Dnote occasionally prompt "Check for update?" (currently we do this once in three weeks) and if users chooses yes, instead of upgrading just print out latest version along with a link to instructions.
  • For macOS, distribute using brew to make update smooth. #63

maybe

  • Find a way to distribute using linux distro's package management system. (I am not entirely sure how to do this)
  • Windows installer

Cannot install on Ubuntu 16.04

This looks really interesting, but fails to install on my system.

Output:

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  1341  100  1341    0     0   5728      0 --:--:-- --:--:-- --:--:--  5730
Download Dnote binary from curl https://github.com/dnote-io/cli/releases/download/v0.0.2/dnote-linux-amd64 to /usr/local/bin/dnote
Installation failed

Tell me how I can provide you with more info.

[interface] dnote new should optionally take book name as an argument

It is hard to keep checking which book you are in, or switch books to write notes in.

Therefore the following is useful:

dnote new js "my lesson"

Compared to:

dnote books
dnote use js
dnote new "my lesson"

Alternatively we could use a flag such that:

dnote new -b js "my lesson"

but dnote new js "my lesson" is easier to type, and has less friction.

The book name argument is optional. If omitted, the lesson will be written in the current book.

Dnote does not copy notes from server

I have 2 machines. With one machine, create notes, then sync them to the cloud.

With another machine, install dnote, then login to the server, then run sync. It would not copy over the notes from cloud. It seems like a one way sync, from machine -> cloud.

Sync between different machines?

Initially I thought dnote sync would sync my notes with the server and then whenever I use dnote on a new machine I can just do dnote login and then dnote sync to download my notes. Seems that's not the case.

Is this something you are planning to add?

Broken colors

CLI colors are broken in windows, instead i see this...

  ?[37m•?[0m git ?[33m(1)?[0m
  ?[37m•?[0m linux ?[33m(1)?[0m
  ?[37m•?[0m test ?[33m(1)?[0m

Delete note fails in Windows cmd/powershell

Running delete command in Windows cmd or powershell results in 'aborted by user' message after responding to the confirmation prompt with lowercase y and pressing enter. Tested on both Win7 and Win10. Command does behave correctly under msysgit bash emulator on Win7.

image

image

search

Should be able to search notes by content (full text search)

$ dnote search "some content"
$ dnote search -b js "some content"

IDEA: Use sqlite full text search #84

Interface proposal

dnote books

Lists all books

dnote use

Change the current book

dnote notes

Lists all notes in the current book

flags

  • -b - optionally specify the book name

dnote ls (alternative to dnote notes)

Lists all notes in the current book

argument

  • [book name] - optionally specify the book name

e.g.

dnote notes -b “html”

dnote new

Write a new note in the current book

flags

  • -b - optionally specify the book name

question

Having added -b flag, should we also have a flag for the actual note content?

i.e.

dnote new -b html "some note”

vs

dnote new -b html -m "some note”

Does the first example seem inconsistent?

dnote login

get API key from user input and save to .dnoterc

dnote sync

sync with the server

Add continuous integration by Travis.

Because of my silly mistake earlier, it became evident how important CI is in ensuring the build is working. This would go well with #12 to test the software. I'm willing to create a PR for this.

Multiple lines

  • Support multiple lines in note
  • Support markdown (useful for code snippet)
  • dnote ls output must change (IDEA: show only first line)
  • Add dnote ls [book_name] [note_index] or `dnote cat [book_name] [note_index] to see full note

Not sure if needed

'view' command

View command will either open a note or list notes in a book. Alias v

$ dnote view linux
# lists notes in a book 'linux'

$ dnote view linux 1
# prints the note with index 1 in a book 'linux'

Need it because switching between ls and cat is too cumbersome. Also we can decrease API surface area.

Plan:

  • 0.3.x: Introduce view command
  • 0.4.0: Deprecate ls and cat
  • 1.0.0: Delete ls and cat

v1

dnote server as the source of truth

Problem: It is impractical to maintain local copy of notes and the server copy at the same time. Doing so, we have to reinvent git. The reason is that dnote needs to resolve conflicts between web and cli. Also users need to pull new data from the server.

Solution: dnote writes to a local copy that gets flushed to the server on every nth command execution.

Shortcomings:

  1. Users no longer automatically have all their data on their disk.
  2. Users cannot use dnote offline out-of-box.

Benefits:

  1. Users can still download backup of their data using dnote backup. (solution to shortcoming 1 and 2) -- see below
  2. Multi machine support is possible. This is a frequently requested feature, and will help people using dnote between work and home machine.
  3. Keep it simple for users, not reinventing git.

solution to shortcoming 2:

Allow users to browse notes and books by using a flag to specify backup file.

dnote ls javascript --backup-file-path ~/.dnote/dnote.bak

Instead of hitting the API, dnote will read from the backup file.

edit mode with editor

When dnote edit is triggered without the new content, editor should be launched (inferred from $EDITOR).

On save quit, note should be edited.

dnote not recognized as an internal or external command

Hi! At first I am relatively new to using the CLI.

I'm using windows 10.

I change the directory to the folder where the .exe is and type the name of the .exe file and hit enter

My problem is, i can't use any commands, even though it looks like I should be able to.

cli-error

The error says: "dnote" is not recognized as an internal or external command.."

I tried it in different terminals (Git, Powershell, CMD) also running it as administrator but nothing seems to work.

Can I build my own cloud server?

I wonder if there is some method for me to build my own cloud server. And I can store my data in it and share the server with my classmates.
Thank you all. This is a wonderful project!

Fix format of note content when adding

Currently dnote add prints notes with line breaks awkwardly.

▶ dnote add test
  • note: "* foo
* bar
* baz
"
  ✔ added to test

IDEA:

▶ dnote add test
------------content------------
* foo
* bar
* baz
--------------------------------

  ✔ added to test

Restore state if syncing locally fails

If digesting actions returned from the server fails in the middle, bookmark is never updated. And on the next sync attempt, CLI will digest actions that it already digested up to the last failure.

Back up dnote before digesting actions and restore if failure.

Migrate to JSON

Migrate YAML to JSON

pros:

  • Able to store metadata other than note itself (createdAt, id, etc.)
    • allows us to implement reminder (e.g. remind what we learned 3 days ago, 7 days ago, etc.) Something like dnote remind, dnote random
    • allows us to move notes to different books: dnote mv [noteId] [bookName]

cons:

  • Hard to read ~/.dnote manually (have to use dnote notes or web interface for clean, easily readable output)

assumption

  • Users will read the contents of ~/.dnote not manually using cat, but by using dnote notes or web interface.

Feedback welcomed. How do you feel about this @michielboekhoff?

Stop sending heartbeat

  • should not send heartbeat on every command
  • alternatively, should not send heartbeat at all to avoid intruding privacy

Install fails on OS X Sierra

Running the install script in zsh on OS X Sierra (10.12.4) produces a cryptic error message:

~/sudo curl -s https://raw.githubusercontent.com/dnote-io/cli/master/install.sh | sh Password: Downloading Dnote binary from https://github.com/dnote-io/cli/releases/download/v0.0.3/dnote_darwin_amd64 to /usr/local/bin/dnote curl: (3) [globbing] bad range in column 59 Installation failed. You might need elevated permission.

using the EDITOR environment variable

Looking through the source, trying to figure out how to set my editor to nano, I discovered the following method. Is there a reason why it only uses the value in EDITOR if it recognizes it? I can understand special casing certain editors, however I don't see the reasoning behind ignoring EDITOR if it doesn't know it. Most likely the person has either explicitly set EDITOR (as in my case) and has it specially configured, or is used to using whatever the OS has set as the default EDITOR. I think a more useful way of going about this is something similar to:

func getEditorCommand() string {
	editor := os.Getenv("EDITOR")

	if editor == "" {
		return "vim"
	} else if editor == "atom" {
		return "atom -w"
	} else if editor == "subl" {
		return "subl -n -w"
	} else if editor == "mate" {
		return "mate -w"
	}

	return editor
}

A minor sidenote: vi is POSIX, whereas vim is not, so vi is more likely to be installed.

Timestamped notes

Loving the project. One thing that would really make this ideal for me is the ability to timestamp notes, either by default or with a -t flag. I realise this may not be useful for everyone, so if you could point me in the direction of which file I should be modifying to achieve this (not too familiar with Go), I can just fork it and make those changes for personal use.

Robert

windows upgrade fails: can't find release

Tested on Win7/Git Bash/MINGW32:

$ dnote upgrade
  • current version is 0.2.0
  • latest version is 0.2.1
  ⨯ Failed to upgrade dnote: Could not find the release for windows amd64

utils/utils.go:27:19: multiple-value uuid.NewV4() in single-value context

Also noted in migrate/migrations.go:51:25

Seems related to https://github.com/kataras/iris/issues/861
satori/go.uuid#66

As the recommended way to continue the old behaviour (as mentioned in satori/go.uuid@0ef6afb) I am going to open a PR with the following patch.

--- utils/utils.go.bck  2018-02-13 03:06:34.295215926 -0500
+++ utils/utils.go      2018-02-13 03:06:52.708205990 -0500
@@ -24,7 +24,7 @@

 // GenerateUID returns a uid
 func GenerateUID() string {
-       return uuid.NewV4().String()
+       return uuid.Must(uuid.NewV4()).String()
 }

 func GetInput() (string, error) {
--- migrate/migrations.go.bck   2018-02-13 03:10:28.827089361 -0500
+++ migrate/migrations.go       2018-02-13 03:10:51.090077347 -0500
@@ -48,7 +48,7 @@
                notes := []migrateToV2PostNote{}
                for _, note := range book {
                        newNote := migrateToV2PostNote{
-                               UUID:     uuid.NewV4().String(),
+                               UUID:     uuid.Must(uuid.NewV4()).String(),
                                Content:  note.Content,
                                AddedOn:  note.AddedOn,
                                EditedOn: 0,

Show books even if they have no notes

At the moment when you create a book, you can't view them by using dnote books and they only appear after adding a note.

It would be awesome of you can see books in the list without notes in them, is this possible?

Piping

Pipe an output to dnote to create note.

cat file.txt | dnote js

Not sure if needed

Typo on Timeline Grid

If you view someone's page at dnote.io and hover over a square in the activity grid, you'll see a tooltip that contains a typo: "leanings" instead of "learnings".

Installer

As the user base grow, I think it would become a need for installers to exist that support major platforms such as Windows, Linux and Mac OS. I hope someone could take up the challenge and create this.

Remove the concept of current book

dnote use does not fit dnote's design goal of minimizing distraction and time away from the user's main task.

dnote use js
dnote add "foo bar"

vs.

dnote add js "foo bar"

The first case requires more effort from the user. And most of the time the users know what book to use. If unsure they can run dnote books.

Also having the notion of current book prevents us from implementing the following:

$ dnote add js
  • content: (user input)
  • added to js

## does not actually work because it will add a note with content "js" to the current book.

In addition, removing dnote use will simplify the CLI interface.

I'd appreciate your thoughts @michielboekhoff @YiiKuoChong

Utils imports itself.

Hey there,

In utils.go, it quite literally imports itself:

import (
	"bufio"
	"encoding/json"
	"fmt"
	"io/ioutil"
	"math/rand"
	"os"
	"os/user"
	"sort"
	"strconv"
	"time"

	"github.com/dnote-io/cli/utils"

	"gopkg.in/yaml.v2"
)

This is my mistake, and I'll open a PR to fix it.

Help

As the dnote is designed to quickly write down what we learn with minimal context switching while coding, I think it would be a good idea to integrate a "help" command. This way users would need not to switch between GUI and CLI for reference, thus saving time.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.