notedux 1.0.12 → 1.0.13

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.
Files changed (3) hide show
  1. package/README.md +34 -8
  2. package/notedux +75 -40
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -1,17 +1,43 @@
1
1
  # Notedux CLI
2
2
 
3
- A fast command-line client for the Notedux note-taking service.
3
+ A command-line tool that turns terminal output into editable notes with Notedux (https://notedux.com).
4
4
 
5
- Create, read, update, delete, and list your notes directly from your terminal.
5
+ Pipe command output directly to Notedux, create notes from scripts, or manage your notes from the terminal. No login required.
6
6
 
7
7
  ## Features
8
8
 
9
- - Create notes in seconds
10
- - View note content
11
- - Edit existing notes
12
- - Delete content of notes
13
- - No login required
14
- - Works on macOS and Linux
9
+ - **Terminal pipelines** – Pipe output from any command directly into Notedux.
10
+ - **Script integration** – Generate and update notes automatically from shell scripts.
11
+ - **Create notes** – Create notes directly from your terminal.
12
+ - **Read and update notes** – View and modify existing notes.
13
+ - **No login required** – No accounts, passwords, or registration.
14
+ - **Cross-platform** – Works on macOS and Linux.
15
+
16
+ ## Turn terminal output into formatted notes
17
+
18
+ Notedux CLI supports Unix pipelines, allowing you to send the output of virtually any command directly to Notedux.
19
+
20
+ For example, generate a server report and turn it into a shareable online note:
21
+
22
+ ```bash
23
+ hostnamectl | notedux add
24
+ ```
25
+
26
+ Or capture running Docker containers:
27
+
28
+ ```bash
29
+ docker ps -a | notedux add
30
+ ```
31
+
32
+ You can also pipe output from scripts, system commands, or other tools:
33
+
34
+ ```bash
35
+ df -h | notedux add
36
+ ```
37
+
38
+ Notedux creates or updates your note and returns a unique URL. Open that link in your browser to edit, format, organize, or export the content as a PDF.
39
+
40
+ **Your terminal output becomes a shareable document in seconds.**
15
41
 
16
42
  ## Installation
17
43
 
package/notedux CHANGED
@@ -9,7 +9,7 @@
9
9
  # (at your option) any later version.
10
10
 
11
11
  CONFIG_FILE="$HOME/.notedux.conf"
12
- API="https://notedux.com/api/note"
12
+ API="http://notedux.com/api/note"
13
13
 
14
14
  # -------------------------
15
15
  # Platform / dependency check
@@ -111,7 +111,7 @@ show_help() {
111
111
  cat <<EOF
112
112
 
113
113
  Notedux CLI - Command-line client for the Notedux service (notedux.com).
114
- Version 1.0.12
114
+ Version 1.0.13
115
115
  Copyright (C) 2026 Dejan Sabados
116
116
  Licensed under the GNU GPL v3 or later.
117
117
  This program comes with ABSOLUTELY NO WARRANTY.
@@ -124,13 +124,15 @@ Commands:
124
124
  show Show current note
125
125
  add <text> Add new line
126
126
  set <text> Replace note content
127
+ add Add text from stdin / pipeline
128
+ set Replace note content from stdin / pipeline
127
129
  generate Generate new token
128
130
  deltoken Delete saved token
129
131
  settoken <token> Set token
130
132
  delall Delete all note content
131
133
  dellast Delete last line
132
134
  del <number> Delete line by number
133
-
135
+
134
136
  Options:
135
137
 
136
138
  -h, --help Show this help
@@ -140,7 +142,9 @@ Examples:
140
142
  notedux generate
141
143
  notedux add "Do one thing and do it well."
142
144
  notedux show
143
- notedux del 3
145
+ notedux del 1
146
+ ls -la | notedux add
147
+ cat report.txt | notedux set
144
148
 
145
149
  EOF
146
150
  }
@@ -263,10 +267,26 @@ show_note() {
263
267
 
264
268
  }
265
269
 
270
+ read_text_input() {
271
+
272
+ if [ $# -gt 0 ]; then
273
+ # Text passed as command arguments
274
+ printf '%s' "$*"
275
+
276
+ elif [ ! -t 0 ]; then
277
+ # Text received through stdin / pipe
278
+ cat
279
+
280
+ else
281
+ echo "Error: no input provided." >&2
282
+ return 1
283
+ fi
284
+ }
266
285
 
267
286
  add_note() {
268
287
 
269
- TEXT="$*"
288
+ TEXT=$(read_text_input "$@") || exit 1
289
+
270
290
 
271
291
  if [ -z "$TEXT" ]; then
272
292
  echo "Error: text missing."
@@ -302,43 +322,58 @@ add_note() {
302
322
 
303
323
  set_note() {
304
324
 
305
- read -p "The content of the note will be overwritten. Are you sure ? [y/N] " answer
325
+ TEXT=$(read_text_input "$@") || exit 1
306
326
 
307
- case "$answer" in
308
- [Yy]|[Yy][Ee][Ss])
309
- TEXT="$*"
310
- if [ -z "$TEXT" ]; then
311
- echo "Error: text missing."
312
- exit 1
313
- fi
314
- HEADERS=$(mktemp)
315
- RESPONSE=$(curl -s -D "$HEADERS" \
316
- -w "\n%{http_code}" \
317
- -X POST \
318
- "$API/set" \
319
- --data-urlencode "token=$TOKEN" \
320
- --data-urlencode "text=$TEXT")
321
- HTTP_CODE=$(echo "$RESPONSE" | tail -n1)
322
- RESPONSE=$(echo "$RESPONSE" | sed '$d')
323
- echo ""
324
- echo "$RESPONSE"
325
- echo ""
326
- LINK="https://notedux.com/n/$TOKEN"
327
- if [ "$HTTP_CODE" = "200" ]; then
328
- echo "$LINK" | copy_to_clipboard
329
- if [ -n "$CLIPBOARD_CMD" ]; then
330
- echo -e "Link: \033[1;34m$LINK\033[0m (Copied to clipboard.)"
331
- else
332
- echo -e "Link: \033[1;34m$LINK\033[0m"
333
- fi
334
- fi
335
- ;;
336
- *)
337
- echo "Operation cancelled."
338
- ;;
339
- esac
340
- }
327
+ if [ -z "$TEXT" ]; then
328
+ echo "Error: text missing."
329
+ exit 1
330
+ fi
331
+
332
+ if [ -e /dev/tty ]; then
333
+ read -p "The content of the note will be overwritten. Are you sure? [y/N] " answer </dev/tty
341
334
 
335
+ case "$answer" in
336
+ [Yy]|[Yy][Ee][Ss])
337
+ ;;
338
+ *)
339
+ echo "Operation cancelled."
340
+ return 1
341
+ ;;
342
+ esac
343
+ else
344
+ echo "Error: cannot request confirmation without a terminal."
345
+ echo "Run this command interactively."
346
+ return 1
347
+ fi
348
+
349
+ HEADERS=$(mktemp)
350
+
351
+ RESPONSE=$(curl -s -D "$HEADERS" \
352
+ -w "\n%{http_code}" \
353
+ -X POST \
354
+ "$API/set" \
355
+ --data-urlencode "token=$TOKEN" \
356
+ --data-urlencode "text=$TEXT")
357
+
358
+ HTTP_CODE=$(echo "$RESPONSE" | tail -n1)
359
+ RESPONSE=$(echo "$RESPONSE" | sed '$d')
360
+
361
+ echo ""
362
+ echo "$RESPONSE"
363
+ echo ""
364
+
365
+ LINK="https://notedux.com/n/$TOKEN"
366
+
367
+ if [ "$HTTP_CODE" = "200" ]; then
368
+ echo "$LINK" | copy_to_clipboard
369
+
370
+ if [ -n "$CLIPBOARD_CMD" ]; then
371
+ echo -e "Link: \033[1;34m$LINK\033[0m (Copied to clipboard.)"
372
+ else
373
+ echo -e "Link: \033[1;34m$LINK\033[0m"
374
+ fi
375
+ fi
376
+ }
342
377
 
343
378
 
344
379
  delete_all() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "notedux",
3
- "version": "1.0.12",
3
+ "version": "1.0.13",
4
4
  "description": "Take notes from terminal",
5
5
  "bin": {
6
6
  "notedux": "notedux"