qotm 1.0.7 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2019 WessCoby
3
+ Copyright (c) 2026 WessCoby
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/README.md CHANGED
@@ -1,50 +1,156 @@
1
- # Quote of the Moment
2
- Display a random tech or programming quote to the console.
1
+ # qotm
3
2
 
4
- ## Overview
5
- `qotm` is my version of `fortune` but outputs tech or programming quotes. And like `fortune`, `qotm` is better with `cowsay` and/or `lolcat`. So it is best to have either or both of them installed.
6
- ![qotm command preview](./images/preview.png)
3
+ One considered programming quote in your terminal, from a community that
4
+ verifies and curates them at [qotm.dev](https://qotm.dev).
7
5
 
8
- ## Installation
9
6
  ```sh
10
- # Installing qotm
11
- > npm install -g qotm
7
+ npm i -g qotm
8
+ qotm
9
+ ```
10
+
11
+ Requires Node.js 22.16 or later (or 24+). No account and no network on the default
12
+ path: quotes come from a local copy of the curated dataset, which ships with
13
+ the package.
12
14
 
13
- # Installing cowsay and lolcat:
14
- # Via apt
15
- > sudo apt-get install cowsay lolcat
15
+ ## Reading quotes
16
16
 
17
- # Via npm
18
- > npm install -g cowsay lolcatjs
17
+ ```sh
18
+ qotm # a quote, avoiding the last 50 shown
19
+ qotm --topic debugging # from one topic
20
+ qotm --author dijkstra # by one author
21
+ qotm --favorites # from your favorites
22
+ qotm --personal # from your private quotes
23
+ qotm --source # with where it is from
24
+ qotm last # the previous quote again
19
25
  ```
20
- ### Usage
26
+
27
+ ## Favorites and private quotes
28
+
29
+ These work signed out and offline, kept on this machine:
30
+
21
31
  ```sh
22
- # Get a random quote [ text only ]
23
- > qotm
32
+ qotm save # favorite the last quote ("saved to favorites")
33
+ qotm save q_8f2k1c # or one by id
34
+ qotm unsave # take the last quote (or <id>) out again
35
+ qotm favorites # list them (--json for a list of objects)
36
+ qotm add "Name things twice." --author Ada # keep a private quote
37
+ qotm --personal # a quote from your private quotes
38
+ ```
24
39
 
25
- # Colorize text with lolcat (or lolcatjs, if you installed via npm)
26
- > qotm | lolcat
40
+ Saving a quote twice changes nothing. Signed in, favorites are shared with
41
+ your account: a save or unsave goes up straight away, or, offline, waits for
42
+ the next `qotm sync`, which also brings down the favorites you added on
43
+ qotm.dev.
27
44
 
28
- # Text with cowsay
29
- > qotm | cowsay
45
+ ## Updating the quotes
30
46
 
31
- # Combined
32
- > qotm | cowsay | lolcat
47
+ ```sh
48
+ qotm sync # fetch the latest dataset release
33
49
  ```
34
- You can also add the command to your shell's `*rc` file (.bashrc, .zshrc, etc. or whatever file the shell loads on startup) so it outputs a quote everytime you open a new shell.
35
50
 
36
- ### Updates
37
- This Repo will be frequently updated with new quotes. Simply run `npm i -g qotm` to get the latest updates. Expect an update notifier to be added in future updates so as to prompt you when new updates are ready.
51
+ `qotm sync` checks the download against the release manifest (size and
52
+ sha256) and replaces your copy in one step: an interrupted or mismatched
53
+ download leaves your quotes as they were. It asks with the version it holds,
54
+ so an up-to-date copy costs one small request.
38
55
 
39
- ## Contributing
40
- There are thousands of tech and programming quotes out there. You have your favorites right? Add them to the `contributing.json` file using the specified format and submit a pull request to the `qotm-cli` branch. I'll be happy to pull them in and make them available in subsequent updates. You can also help in any other way you can, be it code refactoring, typo fixes, etc. <br>
41
- *NB*: I may need to verify the quote and it's author. Please do check as well before adding quotes.
56
+ ## Your account
42
57
 
43
58
  ```sh
44
- > qotm
59
+ qotm login # sign in: approve the printed code at qotm.dev/device
60
+ qotm logout # sign out and revoke this terminal
61
+ ```
45
62
 
46
- Vision without execution is daydreaming
63
+ Signing in lists this terminal under Settings › Terminals on qotm.dev.
64
+ Signing out keeps your local quotes, favorites and dataset.
47
65
 
48
- -- Bill Gates
66
+ ## Submitting
49
67
 
68
+ ```sh
69
+ qotm submit "Premature optimization is the root of all evil." \
70
+ --author "Donald E. Knuth" --source "Structured Programming with go to Statements" \
71
+ --year 1974 --topic programming # a canonical quote: a verifier checks the source
72
+ qotm submit --original "Ship the smallest thing that teaches you something." \
73
+ --topic software-engineering --rights # your own words
74
+ qotm submit p_ab12cd34 --topic learning --rights # one of your private quotes, as your original
75
+ qotm submit --check "Make it work, make it right, make it fast." # does qotm have it already?
76
+ ```
77
+
78
+ Submitting needs `qotm login`. Every missing or invalid field is listed at
79
+ once; the match against quotes already on qotm is shown before sending.
80
+ Signed in, `qotm add` also keeps the quote in your account's private quotes.
81
+
82
+ ## More
83
+
84
+ ```sh
85
+ qotm open # the last quote's page on qotm.dev ("opening q/1t7c4e in your browser")
86
+ qotm search complexity # search your dataset, offline (--web: on qotm.dev; --json)
87
+ qotm status # dataset version, last sync, account, counts (--json)
88
+ qotm config # settings: api, site, color, style, history (get / set / unset; --json)
89
+ qotm doctor # check Node, folders, the dataset's sha256 and the API (--json)
50
90
  ```
91
+
92
+ `qotm doctor` exits 1 and names the problem when a check fails.
93
+ `QOTM_API_URL` and `QOTM_SITE_URL` override the api and site settings for
94
+ one run.
95
+
96
+ ### How a quote looks
97
+
98
+ On a terminal, a quote is drawn in one of four styles: box-drawing and block
99
+ characters, no extra tools.
100
+
101
+ ```sh
102
+ qotm config set style pull # the default: clay quote marks beside the words
103
+ qotm config set style bubble # a speech bubble with the qotm "q" (cowsay's heir)
104
+ qotm config set style card # a centred card, its id and status in the edge
105
+ qotm config set style slab # a lighter panel with a clay edge (best in colour)
106
+ qotm --style card # one style, this once
107
+ ```
108
+
109
+ The shape fits the quote: lines wrap at 60 columns at most, never past the
110
+ terminal, and are balanced so no word sits alone on the last line. Narrower
111
+ than 40 columns, the quote prints without a shape.
112
+
113
+ Output is coloured on a terminal and plain when piped (the words and the
114
+ credit, for scripts and for `qotm | cowsay`). `--plain` forces that plain
115
+ text. `NO_COLOR` and `TERM=dumb` drop the colour but keep the shape.
116
+
117
+ ### `--json`
118
+
119
+ `qotm --json` and `qotm last --json` print one object:
120
+
121
+ ```json
122
+ {
123
+ "id": "q_8f2k1c",
124
+ "text": "Simplicity is prerequisite for reliability.",
125
+ "type": "canonical",
126
+ "author": { "name": "Edsger W. Dijkstra", "slug": "dijkstra" },
127
+ "contributor": "kofi",
128
+ "work": "EWD 498",
129
+ "year": 1975,
130
+ "source": "EWD 498: How do we tell truths that might hurt?",
131
+ "sourceUrl": "https://www.cs.utexas.edu/~EWD/transcriptions/EWD04xx/EWD498.html",
132
+ "topics": ["simplicity"],
133
+ "url": "https://qotm.dev/q/8f2k1c",
134
+ "dataset": "v2026.09.1"
135
+ }
136
+ ```
137
+
138
+ - `type`: `canonical` (attributed to an author), `original` (a member's own
139
+ words; `author` is null and `contributor` is the member's handle, or null
140
+ for a former member) or `personal` (one of your private quotes: `url` and
141
+ `dataset` are null).
142
+ - `work`, `year`, `source`, `sourceUrl` are null when not on record.
143
+
144
+ ## Where qotm keeps things
145
+
146
+ | | Linux | macOS | Windows |
147
+ | --------------------------- | --------------------- | ------------------------------------ | -------------------------- |
148
+ | settings, session | `~/.config/qotm` | `~/Library/Preferences/qotm` | `%APPDATA%\qotm\Config` |
149
+ | dataset, favorites, history | `~/.local/share/qotm` | `~/Library/Application Support/qotm` | `%LOCALAPPDATA%\qotm\Data` |
150
+
151
+ `XDG_CONFIG_HOME` and `XDG_DATA_HOME` are honoured; `QOTM_HOME` puts both
152
+ under one folder.
153
+
154
+ ## License
155
+
156
+ MIT
Binary file
@@ -0,0 +1,9 @@
1
+ {
2
+ "version": "v2026.10.1",
3
+ "schemaVersion": 1,
4
+ "builtAt": "2026-10-14T00:03:11.444Z",
5
+ "publishedAt": "2026-10-14T00:03:49.836Z",
6
+ "quotes": 500,
7
+ "size": 352256,
8
+ "sha256": "aa01263935e9b42a5ebcda9b8b0bc0b69815514410180174a18e507e17ceed88"
9
+ }