notedux 1.0.11 → 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 +98 -52
  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
@@ -60,13 +60,21 @@ check_compatibility() {
60
60
  CLIPBOARD_CMD="pbcopy"
61
61
  fi
62
62
  else
63
- if command -v xclip &>/dev/null; then
64
- CLIPBOARD_CMD="xclip -selection clipboard"
65
- elif command -v xsel &>/dev/null; then
66
- CLIPBOARD_CMD="xsel --clipboard --input"
67
- elif command -v wl-copy &>/dev/null; then
63
+ # Linux: proveri da li X11 radi
64
+ if [ -n "$DISPLAY" ] && [ "$DISPLAY" != ":0" ]; then
65
+ # X11 je aktivan
66
+ if command -v xclip &>/dev/null; then
67
+ CLIPBOARD_CMD="xclip -selection clipboard"
68
+ elif command -v xsel &>/dev/null; then
69
+ CLIPBOARD_CMD="xsel --clipboard --input"
70
+ elif command -v wl-copy &>/dev/null; then
71
+ CLIPBOARD_CMD="wl-copy"
72
+ fi
73
+ elif command -v wl-copy &>/dev/null && [ -n "$WAYLAND_DISPLAY" ]; then
74
+ # Wayland
68
75
  CLIPBOARD_CMD="wl-copy"
69
76
  fi
77
+ # Ako nema X11 ili Wayland, CLIPBOARD_CMD ostaje prazan
70
78
  fi
71
79
 
72
80
  # No clipboard tool found - warn once, don't block usage.
@@ -75,16 +83,19 @@ check_compatibility() {
75
83
  if [ "$PLATFORM" = "mac" ]; then
76
84
  echo "Warning: 'pbcopy' not found. Links will not be copied to clipboard."
77
85
  else
78
- echo "Warning: no clipboard tool found (xclip, xsel, or wl-copy)."
79
- echo "Links will not be copied to clipboard. Install one with, e.g.:"
80
- echo " sudo apt install xclip (Debian/Ubuntu, X11)"
81
- echo " sudo dnf install xclip (Fedora, X11)"
82
- echo " sudo pacman -S xclip (Arch, X11)"
83
- echo " sudo apt install wl-clipboard (Wayland)"
86
+ if [ -z "$DISPLAY" ]; then
87
+ echo "Info: No X11 display detected. Clipboard disabled."
88
+ else
89
+ echo "Warning: no clipboard tool found (xclip, xsel, or wl-copy)."
90
+ echo "Links will not be copied to clipboard. Install one with, e.g.:"
91
+ echo " sudo apt install xclip (Debian/Ubuntu, X11)"
92
+ echo " sudo dnf install xclip (Fedora, X11)"
93
+ echo " sudo pacman -S xclip (Arch, X11)"
94
+ echo " sudo apt install wl-clipboard (Wayland)"
95
+ fi
84
96
  fi
85
97
  fi
86
98
  }
87
-
88
99
  # Copies stdin to the clipboard using whatever tool was detected.
89
100
  # Silently does nothing if no clipboard tool is available.
90
101
  copy_to_clipboard() {
@@ -100,7 +111,7 @@ show_help() {
100
111
  cat <<EOF
101
112
 
102
113
  Notedux CLI - Command-line client for the Notedux service (notedux.com).
103
- Version 1.0.11
114
+ Version 1.0.13
104
115
  Copyright (C) 2026 Dejan Sabados
105
116
  Licensed under the GNU GPL v3 or later.
106
117
  This program comes with ABSOLUTELY NO WARRANTY.
@@ -113,13 +124,15 @@ Commands:
113
124
  show Show current note
114
125
  add <text> Add new line
115
126
  set <text> Replace note content
127
+ add Add text from stdin / pipeline
128
+ set Replace note content from stdin / pipeline
116
129
  generate Generate new token
117
130
  deltoken Delete saved token
118
131
  settoken <token> Set token
119
132
  delall Delete all note content
120
133
  dellast Delete last line
121
134
  del <number> Delete line by number
122
-
135
+
123
136
  Options:
124
137
 
125
138
  -h, --help Show this help
@@ -129,7 +142,9 @@ Examples:
129
142
  notedux generate
130
143
  notedux add "Do one thing and do it well."
131
144
  notedux show
132
- notedux del 3
145
+ notedux del 1
146
+ ls -la | notedux add
147
+ cat report.txt | notedux set
133
148
 
134
149
  EOF
135
150
  }
@@ -252,10 +267,26 @@ show_note() {
252
267
 
253
268
  }
254
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
+ }
255
285
 
256
286
  add_note() {
257
287
 
258
- TEXT="$*"
288
+ TEXT=$(read_text_input "$@") || exit 1
289
+
259
290
 
260
291
  if [ -z "$TEXT" ]; then
261
292
  echo "Error: text missing."
@@ -291,43 +322,58 @@ add_note() {
291
322
 
292
323
  set_note() {
293
324
 
294
- read -p "The content of the note will be overwritten. Are you sure ? [y/N] " answer
325
+ TEXT=$(read_text_input "$@") || exit 1
295
326
 
296
- case "$answer" in
297
- [Yy]|[Yy][Ee][Ss])
298
- TEXT="$*"
299
- if [ -z "$TEXT" ]; then
300
- echo "Error: text missing."
301
- exit 1
302
- fi
303
- HEADERS=$(mktemp)
304
- RESPONSE=$(curl -s -D "$HEADERS" \
305
- -w "\n%{http_code}" \
306
- -X POST \
307
- "$API/set" \
308
- --data-urlencode "token=$TOKEN" \
309
- --data-urlencode "text=$TEXT")
310
- HTTP_CODE=$(echo "$RESPONSE" | tail -n1)
311
- RESPONSE=$(echo "$RESPONSE" | sed '$d')
312
- echo ""
313
- echo "$RESPONSE"
314
- echo ""
315
- LINK="https://notedux.com/n/$TOKEN"
316
- if [ "$HTTP_CODE" = "200" ]; then
317
- echo "$LINK" | copy_to_clipboard
318
- if [ -n "$CLIPBOARD_CMD" ]; then
319
- echo -e "Link: \033[1;34m$LINK\033[0m (Copied to clipboard.)"
320
- else
321
- echo -e "Link: \033[1;34m$LINK\033[0m"
322
- fi
323
- fi
324
- ;;
325
- *)
326
- echo "Operation cancelled."
327
- ;;
328
- esac
329
- }
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
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")
330
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
+ }
331
377
 
332
378
 
333
379
  delete_all() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "notedux",
3
- "version": "1.0.11",
3
+ "version": "1.0.13",
4
4
  "description": "Take notes from terminal",
5
5
  "bin": {
6
6
  "notedux": "notedux"