newsline-cli 0.1.8 → 1.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/README.md +23 -3
- package/newsline +71 -19
- package/package.json +1 -1
- package/readme/de.md +23 -4
- package/readme/es.md +23 -4
- package/readme/fr.md +23 -4
- package/readme/ja.md +23 -3
- package/readme/ko.md +23 -3
- package/readme/pt.md +23 -4
- package/readme/zh.md +22 -3
- package/refresh.sh +1 -1
package/README.md
CHANGED
|
@@ -70,10 +70,30 @@ Re-run `newsline init`, or edit `~/.config/newsline/config.json`:
|
|
|
70
70
|
| `count` | `15` | headlines in rotation |
|
|
71
71
|
| `maxlen` | `120` | max characters (`max` = no cut) |
|
|
72
72
|
| `icon` | `📰` | leading glyph (`none` to hide) |
|
|
73
|
-
| `color` | `
|
|
73
|
+
| `color` | `cyan` | headline color: `default` `gray` `white` `cyan` `yellow` `green` `blue` `magenta` `red` |
|
|
74
74
|
|
|
75
|
-
|
|
76
|
-
|
|
75
|
+
Set one directly with `newsline color <name>` (e.g. `newsline color gray`), or run
|
|
76
|
+
`newsline color` with no name to step to the next color (default → gray → white → cyan →
|
|
77
|
+
yellow → green → blue → magenta → red). `newsline colorlist` lists them all with a live
|
|
78
|
+
preview. Changes show on the next status-line tick.
|
|
79
|
+
|
|
80
|
+
## Update
|
|
81
|
+
|
|
82
|
+
Update the same way you installed — your language/topic/color settings are kept:
|
|
83
|
+
|
|
84
|
+
```sh
|
|
85
|
+
# curl — re-run the installer (skips setup, just refreshes the CLI)
|
|
86
|
+
curl -fsSL https://raw.githubusercontent.com/itdar/newsline/master/install.sh | NEWSLINE_NO_INIT=1 sh
|
|
87
|
+
|
|
88
|
+
# Homebrew
|
|
89
|
+
brew update && brew upgrade newsline
|
|
90
|
+
|
|
91
|
+
# npm
|
|
92
|
+
npm i -g newsline-cli@latest
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
Claude Code plugin: run `/plugin marketplace update itdar`, then `/reload-plugins`
|
|
96
|
+
(or restart). You can also enable background auto-update under `/plugin` → **Marketplaces**.
|
|
77
97
|
|
|
78
98
|
## Uninstall
|
|
79
99
|
|
package/newsline
CHANGED
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
# newsline init interactive setup: language, topic, status-line wiring.
|
|
5
5
|
# COMPOSES with an existing status line (e.g. your HUD),
|
|
6
6
|
# so rate-limit / context info stays visible.
|
|
7
|
+
# newsline color [c] set the headline color (or cycle to the next when no name).
|
|
8
|
+
# newsline colorlist list the available headline colors with a live preview.
|
|
7
9
|
# newsline render what settings.json runs each refresh (base HUD + news).
|
|
8
10
|
# newsline refresh force a cache refresh now.
|
|
9
11
|
# newsline once fetch + print headlines once (debug).
|
|
@@ -191,14 +193,14 @@ cmd_init() {
|
|
|
191
193
|
fi
|
|
192
194
|
local cur_color; cur_color=$(cfg_get color)
|
|
193
195
|
echo "Select headline color (change anytime: newsline color):" >&2
|
|
194
|
-
choose "${cur_color:-
|
|
195
|
-
default "Terminal default
|
|
196
|
-
green "Green" blue "Blue" magenta "Magenta" red "Red"
|
|
196
|
+
choose "${cur_color:-cyan}" \
|
|
197
|
+
default "Terminal default" cyan "Cyan" gray "Gray" white "White" \
|
|
198
|
+
yellow "Yellow" green "Green" blue "Blue" magenta "Magenta" red "Red"
|
|
197
199
|
color="$CHOICE"
|
|
198
200
|
else
|
|
199
|
-
# --yes: keep a color previously set via init/`newsline color`;
|
|
201
|
+
# --yes: keep a color previously set via init/`newsline color`; cyan on first run
|
|
200
202
|
lang="${lang:-$detected}"; topic="${topic:-general}"
|
|
201
|
-
color=$(cfg_get color); [ -n "$color" ] || color="
|
|
203
|
+
color=$(cfg_get color); [ -n "$color" ] || color="cyan"
|
|
202
204
|
fi
|
|
203
205
|
|
|
204
206
|
# Always KEEP an existing status line and show newsline below it (no prompt).
|
|
@@ -266,17 +268,25 @@ PY
|
|
|
266
268
|
echo " It appears on your next message to Claude — no restart needed."
|
|
267
269
|
}
|
|
268
270
|
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
)
|
|
271
|
+
# canonical headline palette — single source of truth for cycling, listing, and
|
|
272
|
+
# validation. "default" means the terminal's own color (no SGR); the rest map to
|
|
273
|
+
# the SGR codes in statusline.sh (nl_sgr below mirrors that mapping).
|
|
274
|
+
NL_PALETTE="default gray white cyan yellow green blue magenta red"
|
|
275
|
+
|
|
276
|
+
nl_sgr() { # color name -> SGR params (empty = terminal default). Mirrors statusline.sh.
|
|
277
|
+
case "$1" in
|
|
278
|
+
dim) echo "2" ;;
|
|
279
|
+
gray|grey) echo "90" ;;
|
|
280
|
+
red) echo "31" ;; green) echo "32" ;; yellow) echo "33" ;;
|
|
281
|
+
blue) echo "34" ;; magenta) echo "35" ;; cyan) echo "36" ;;
|
|
282
|
+
white) echo "37" ;; orange) echo "38;5;208" ;;
|
|
283
|
+
*) echo "" ;;
|
|
284
|
+
esac
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
nl_write_color() { # nl_write_color <name> — persist the chosen color to config
|
|
278
288
|
mkdir -p "$CONFIG_DIR"
|
|
279
|
-
python3 - "$CONFIG" "$
|
|
289
|
+
python3 - "$CONFIG" "$1" <<'PY' || { echo "✗ could not write $CONFIG" >&2; return 1; }
|
|
280
290
|
import json,os,sys
|
|
281
291
|
path,color=sys.argv[1],sys.argv[2]
|
|
282
292
|
try: d=json.load(open(path))
|
|
@@ -287,6 +297,45 @@ tmp=path+".tmp"
|
|
|
287
297
|
with open(tmp,"w") as f: json.dump(d,f,indent=2,ensure_ascii=False)
|
|
288
298
|
os.replace(tmp,path)
|
|
289
299
|
PY
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
cmd_colorlist() { # newsline colorlist — list the palette, each shown in its own color
|
|
303
|
+
local cur c sgr mark; cur=$(cfg_get color); [ -n "$cur" ] || cur=default
|
|
304
|
+
echo "Headline colors (set with: newsline color <name>):"
|
|
305
|
+
for c in $NL_PALETTE; do
|
|
306
|
+
[ "$c" = "$cur" ] && mark=" ← current" || mark=""
|
|
307
|
+
sgr=$(nl_sgr "$c")
|
|
308
|
+
if [ -n "$sgr" ]; then
|
|
309
|
+
printf ' \033[%sm%-8s 📰 sample headline\033[0m%s\n' "$sgr" "$c" "$mark"
|
|
310
|
+
else
|
|
311
|
+
printf ' %-8s 📰 sample headline%s\n' "$c" "$mark"
|
|
312
|
+
fi
|
|
313
|
+
done
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
cmd_color() { # newsline color [name] — set a color; with no name, step to the next one
|
|
317
|
+
local cur new arg; arg="${1:-}"
|
|
318
|
+
case "$arg" in list|ls|--list) cmd_colorlist; return $? ;; esac
|
|
319
|
+
if [ -n "$arg" ]; then
|
|
320
|
+
new="$(printf '%s' "$arg" | tr '[:upper:]' '[:lower:]')"
|
|
321
|
+
case "$new" in grey) new=gray ;; none|off) new=default ;; esac
|
|
322
|
+
case " $NL_PALETTE " in
|
|
323
|
+
*" $new "*) ;;
|
|
324
|
+
*) echo "✗ unknown color: $arg" >&2
|
|
325
|
+
echo " choose from: $NL_PALETTE (see: newsline colorlist)" >&2
|
|
326
|
+
return 1 ;;
|
|
327
|
+
esac
|
|
328
|
+
else # no name: cycle to the next color, wrapping
|
|
329
|
+
cur=$(cfg_get color)
|
|
330
|
+
new=$(NL_PALETTE="$NL_PALETTE" python3 - "${cur:-default}" <<'PY'
|
|
331
|
+
import os,sys
|
|
332
|
+
p=os.environ["NL_PALETTE"].split()
|
|
333
|
+
c=sys.argv[1]
|
|
334
|
+
print(p[(p.index(c)+1)%len(p)] if c in p else p[0])
|
|
335
|
+
PY
|
|
336
|
+
)
|
|
337
|
+
fi
|
|
338
|
+
nl_write_color "$new" || return 1
|
|
290
339
|
echo "✔ headline color: $new — preview:"
|
|
291
340
|
load_config
|
|
292
341
|
"$HERE/statusline.sh"; echo
|
|
@@ -336,9 +385,11 @@ usage() {
|
|
|
336
385
|
newsline — local news status-line utility
|
|
337
386
|
newsline init [--lang ko] [--topic tech] set up & wire the status line
|
|
338
387
|
(asks language / topic / color)
|
|
339
|
-
newsline color
|
|
340
|
-
|
|
341
|
-
→
|
|
388
|
+
newsline color [name] set headline color (e.g. cyan, gray); with
|
|
389
|
+
no name, step to the next: default → gray →
|
|
390
|
+
white → cyan → yellow → green → blue →
|
|
391
|
+
magenta → red → back to default
|
|
392
|
+
newsline colorlist list the available colors with a preview
|
|
342
393
|
newsline uninstall remove & restore previous status line
|
|
343
394
|
EOF
|
|
344
395
|
if [ "${1:-}" = "--all" ]; then
|
|
@@ -357,7 +408,8 @@ case "${1:-help}" in
|
|
|
357
408
|
refresh) shift; cmd_refresh "$@";;
|
|
358
409
|
once) shift; cmd_once "$@";;
|
|
359
410
|
init) shift; cmd_init "$@";;
|
|
360
|
-
color) shift; cmd_color;;
|
|
411
|
+
color) shift; cmd_color "$@";;
|
|
412
|
+
colorlist|colors) shift; cmd_colorlist;;
|
|
361
413
|
uninstall) shift; cmd_uninstall "$@";;
|
|
362
414
|
help|-h|--help) shift; usage "$@";;
|
|
363
415
|
*) usage; exit 1;;
|
package/package.json
CHANGED
package/readme/de.md
CHANGED
|
@@ -73,11 +73,30 @@ Führe `newsline init` erneut aus oder bearbeite `~/.config/newsline/config.json
|
|
|
73
73
|
| `count` | `15` | Schlagzeilen im Wechsel |
|
|
74
74
|
| `maxlen` | `120` | maximale Zeichen (`max` = kein Abschneiden) |
|
|
75
75
|
| `icon` | `📰` | vorangestelltes Symbol (`none` zum Ausblenden) |
|
|
76
|
-
| `color` | `
|
|
76
|
+
| `color` | `cyan` | Farbe der Schlagzeile: `default` `gray` `white` `cyan` `yellow` `green` `blue` `magenta` `red` |
|
|
77
77
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
78
|
+
Eine direkt setzen mit `newsline color <name>` (z. B. `newsline color gray`), oder
|
|
79
|
+
`newsline color` ohne Namen ausführen, um zur nächsten Farbe zu wechseln (default → gray →
|
|
80
|
+
white → cyan → yellow → green → blue → magenta → red). `newsline colorlist` listet alle mit
|
|
81
|
+
Vorschau auf; Änderungen erscheinen beim nächsten Statuszeilen-Refresh.
|
|
82
|
+
|
|
83
|
+
## Aktualisieren
|
|
84
|
+
|
|
85
|
+
Aktualisiere so, wie du installiert hast — deine Sprache/Thema/Farbe bleiben erhalten:
|
|
86
|
+
|
|
87
|
+
```sh
|
|
88
|
+
# curl — Installer erneut ausführen (überspringt die Einrichtung, aktualisiert nur die CLI)
|
|
89
|
+
curl -fsSL https://raw.githubusercontent.com/itdar/newsline/master/install.sh | NEWSLINE_NO_INIT=1 sh
|
|
90
|
+
|
|
91
|
+
# Homebrew
|
|
92
|
+
brew update && brew upgrade newsline
|
|
93
|
+
|
|
94
|
+
# npm
|
|
95
|
+
npm i -g newsline-cli@latest
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
Claude-Code-Plugin: `/plugin marketplace update itdar`, dann `/reload-plugins`
|
|
99
|
+
(oder neu starten). Aktiviere die automatische Aktualisierung unter `/plugin` → **Marketplaces**.
|
|
81
100
|
|
|
82
101
|
## Deinstallieren
|
|
83
102
|
|
package/readme/es.md
CHANGED
|
@@ -72,11 +72,30 @@ Vuelve a ejecutar `newsline init` o edita `~/.config/newsline/config.json`:
|
|
|
72
72
|
| `count` | `15` | titulares en rotación |
|
|
73
73
|
| `maxlen` | `120` | caracteres máximos (`max` = sin recorte) |
|
|
74
74
|
| `icon` | `📰` | icono inicial (`none` para ocultarlo) |
|
|
75
|
-
| `color` | `
|
|
75
|
+
| `color` | `cyan` | color del titular: `default` `gray` `white` `cyan` `yellow` `green` `blue` `magenta` `red` |
|
|
76
76
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
77
|
+
Fija uno directamente con `newsline color <nombre>` (p. ej. `newsline color gray`), o usa
|
|
78
|
+
`newsline color` sin nombre para pasar al siguiente color (default → gray → white → cyan →
|
|
79
|
+
yellow → green → blue → magenta → red). `newsline colorlist` los muestra todos con una
|
|
80
|
+
vista previa; los cambios se ven en el próximo refresco de la línea de estado.
|
|
81
|
+
|
|
82
|
+
## Actualizar
|
|
83
|
+
|
|
84
|
+
Actualiza igual que instalaste — se conservan tus ajustes de idioma/tema/color:
|
|
85
|
+
|
|
86
|
+
```sh
|
|
87
|
+
# curl — vuelve a ejecutar el instalador (omite la configuración, solo actualiza la CLI)
|
|
88
|
+
curl -fsSL https://raw.githubusercontent.com/itdar/newsline/master/install.sh | NEWSLINE_NO_INIT=1 sh
|
|
89
|
+
|
|
90
|
+
# Homebrew
|
|
91
|
+
brew update && brew upgrade newsline
|
|
92
|
+
|
|
93
|
+
# npm
|
|
94
|
+
npm i -g newsline-cli@latest
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
Plugin de Claude Code: ejecuta `/plugin marketplace update itdar` y luego `/reload-plugins`
|
|
98
|
+
(o reinicia). También puedes activar la actualización automática en `/plugin` → **Marketplaces**.
|
|
80
99
|
|
|
81
100
|
## Desinstalar
|
|
82
101
|
|
package/readme/fr.md
CHANGED
|
@@ -73,11 +73,30 @@ Relancez `newsline init`, ou modifiez `~/.config/newsline/config.json` :
|
|
|
73
73
|
| `count` | `15` | titres en rotation |
|
|
74
74
|
| `maxlen` | `120` | caractères maximum (`max` = sans coupure) |
|
|
75
75
|
| `icon` | `📰` | icône de tête (`none` pour masquer) |
|
|
76
|
-
| `color` | `
|
|
76
|
+
| `color` | `cyan` | couleur du titre : `default` `gray` `white` `cyan` `yellow` `green` `blue` `magenta` `red` |
|
|
77
77
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
78
|
+
Définissez-en une directement avec `newsline color <nom>` (p. ex. `newsline color gray`), ou
|
|
79
|
+
utilisez `newsline color` sans nom pour passer à la couleur suivante (default → gray → white →
|
|
80
|
+
cyan → yellow → green → blue → magenta → red). `newsline colorlist` les liste toutes avec un
|
|
81
|
+
aperçu ; les changements sont visibles au prochain rafraîchissement de la ligne d'état.
|
|
82
|
+
|
|
83
|
+
## Mettre à jour
|
|
84
|
+
|
|
85
|
+
Mettez à jour comme vous avez installé — vos réglages de langue/thème/couleur sont conservés :
|
|
86
|
+
|
|
87
|
+
```sh
|
|
88
|
+
# curl — relancez l'installateur (ignore la configuration, met juste à jour la CLI)
|
|
89
|
+
curl -fsSL https://raw.githubusercontent.com/itdar/newsline/master/install.sh | NEWSLINE_NO_INIT=1 sh
|
|
90
|
+
|
|
91
|
+
# Homebrew
|
|
92
|
+
brew update && brew upgrade newsline
|
|
93
|
+
|
|
94
|
+
# npm
|
|
95
|
+
npm i -g newsline-cli@latest
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
Plugin Claude Code : `/plugin marketplace update itdar`, puis `/reload-plugins`
|
|
99
|
+
(ou redémarrez). Activez la mise à jour automatique dans `/plugin` → **Marketplaces**.
|
|
81
100
|
|
|
82
101
|
## Désinstaller
|
|
83
102
|
|
package/readme/ja.md
CHANGED
|
@@ -71,10 +71,30 @@ npm i -g newsline-cli && newsline init
|
|
|
71
71
|
| `count` | `15` | 切り替えるヘッドライン数 |
|
|
72
72
|
| `maxlen` | `120` | 最大文字数(`max` = 無制限) |
|
|
73
73
|
| `icon` | `📰` | 先頭アイコン(`none` で非表示) |
|
|
74
|
-
| `color` | `
|
|
74
|
+
| `color` | `cyan` | 見出しの文字色:`default` `gray` `white` `cyan` `yellow` `green` `blue` `magenta` `red` |
|
|
75
75
|
|
|
76
|
-
`newsline color
|
|
77
|
-
|
|
76
|
+
`newsline color <名前>` で色を直接指定でき(例:`newsline color gray`)、名前なしで
|
|
77
|
+
`newsline color` を実行すると次の色へ進みます(default → gray → white → cyan → yellow →
|
|
78
|
+
green → blue → magenta → red)。`newsline colorlist` で全色をプレビュー付きで一覧でき、
|
|
79
|
+
変更は次のステータスライン更新で反映されます。
|
|
80
|
+
|
|
81
|
+
## アップデート
|
|
82
|
+
|
|
83
|
+
インストールした方法と同じ手順で更新できます — 言語・トピック・色の設定は保持されます:
|
|
84
|
+
|
|
85
|
+
```sh
|
|
86
|
+
# curl — インストーラを再実行(セットアップはスキップし、CLI のみ更新)
|
|
87
|
+
curl -fsSL https://raw.githubusercontent.com/itdar/newsline/master/install.sh | NEWSLINE_NO_INIT=1 sh
|
|
88
|
+
|
|
89
|
+
# Homebrew
|
|
90
|
+
brew update && brew upgrade newsline
|
|
91
|
+
|
|
92
|
+
# npm
|
|
93
|
+
npm i -g newsline-cli@latest
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
Claude Code プラグイン: `/plugin marketplace update itdar` を実行後、`/reload-plugins`
|
|
97
|
+
(または再起動)。`/plugin` → **Marketplaces** でバックグラウンド自動更新も有効にできます。
|
|
78
98
|
|
|
79
99
|
## アンインストール
|
|
80
100
|
|
package/readme/ko.md
CHANGED
|
@@ -67,10 +67,30 @@ npm i -g newsline-cli && newsline init
|
|
|
67
67
|
| `count` | `15` | 회전 헤드라인 수 |
|
|
68
68
|
| `maxlen` | `120` | 최대 글자수 (`max`=무제한) |
|
|
69
69
|
| `icon` | `📰` | 앞 아이콘 (`none`이면 제거) |
|
|
70
|
-
| `color` | `
|
|
70
|
+
| `color` | `cyan` | 뉴스 글자 색: `default` `gray` `white` `cyan` `yellow` `green` `blue` `magenta` `red` |
|
|
71
71
|
|
|
72
|
-
`newsline color
|
|
73
|
-
|
|
72
|
+
`newsline color <이름>`으로 색을 바로 지정하거나(예: `newsline color gray`), 이름 없이
|
|
73
|
+
`newsline color`를 실행하면 다음 색으로 넘어갑니다 (default → gray → white → cyan →
|
|
74
|
+
yellow → green → blue → magenta → red). `newsline colorlist`로 전체 색 목록을 미리보기와
|
|
75
|
+
함께 확인할 수 있고, 변경은 다음 상태줄 갱신 때 반영됩니다.
|
|
76
|
+
|
|
77
|
+
## 업데이트
|
|
78
|
+
|
|
79
|
+
설치했던 방식 그대로 업데이트하면 됩니다 — 언어·분야·색 설정은 유지됩니다:
|
|
80
|
+
|
|
81
|
+
```sh
|
|
82
|
+
# curl — 설치 스크립트 재실행 (셋업은 건너뛰고 CLI만 갱신)
|
|
83
|
+
curl -fsSL https://raw.githubusercontent.com/itdar/newsline/master/install.sh | NEWSLINE_NO_INIT=1 sh
|
|
84
|
+
|
|
85
|
+
# Homebrew
|
|
86
|
+
brew update && brew upgrade newsline
|
|
87
|
+
|
|
88
|
+
# npm
|
|
89
|
+
npm i -g newsline-cli@latest
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
Claude Code 플러그인: `/plugin marketplace update itdar` 실행 후 `/reload-plugins`
|
|
93
|
+
(또는 재시작). `/plugin` → **Marketplaces**에서 백그라운드 자동 업데이트도 켤 수 있습니다.
|
|
74
94
|
|
|
75
95
|
## 제거
|
|
76
96
|
|
package/readme/pt.md
CHANGED
|
@@ -71,11 +71,30 @@ Execute `newsline init` novamente ou edite `~/.config/newsline/config.json`:
|
|
|
71
71
|
| `count` | `15` | manchetes na rotação |
|
|
72
72
|
| `maxlen` | `120` | máximo de caracteres (`max` = sem corte) |
|
|
73
73
|
| `icon` | `📰` | ícone inicial (`none` para ocultar) |
|
|
74
|
-
| `color` | `
|
|
74
|
+
| `color` | `cyan` | cor da manchete: `default` `gray` `white` `cyan` `yellow` `green` `blue` `magenta` `red` |
|
|
75
75
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
76
|
+
Defina uma diretamente com `newsline color <nome>` (ex.: `newsline color gray`), ou use
|
|
77
|
+
`newsline color` sem nome para avançar para a próxima cor (default → gray → white → cyan →
|
|
78
|
+
yellow → green → blue → magenta → red). `newsline colorlist` mostra todas com uma prévia;
|
|
79
|
+
as mudanças aparecem no próximo refresh da linha de status.
|
|
80
|
+
|
|
81
|
+
## Atualizar
|
|
82
|
+
|
|
83
|
+
Atualize da mesma forma que instalou — suas configurações de idioma/tema/cor são mantidas:
|
|
84
|
+
|
|
85
|
+
```sh
|
|
86
|
+
# curl — execute o instalador de novo (pula a configuração, só atualiza a CLI)
|
|
87
|
+
curl -fsSL https://raw.githubusercontent.com/itdar/newsline/master/install.sh | NEWSLINE_NO_INIT=1 sh
|
|
88
|
+
|
|
89
|
+
# Homebrew
|
|
90
|
+
brew update && brew upgrade newsline
|
|
91
|
+
|
|
92
|
+
# npm
|
|
93
|
+
npm i -g newsline-cli@latest
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
Plugin do Claude Code: `/plugin marketplace update itdar` e depois `/reload-plugins`
|
|
97
|
+
(ou reinicie). Ative a atualização automática em `/plugin` → **Marketplaces**.
|
|
79
98
|
|
|
80
99
|
## Desinstalar
|
|
81
100
|
|
package/readme/zh.md
CHANGED
|
@@ -65,10 +65,29 @@ npm i -g newsline-cli && newsline init
|
|
|
65
65
|
| `count` | `15` | 轮播头条数量 |
|
|
66
66
|
| `maxlen` | `120` | 最大字符数(`max` = 不截断) |
|
|
67
67
|
| `icon` | `📰` | 前置图标(`none` 为隐藏) |
|
|
68
|
-
| `color` | `
|
|
68
|
+
| `color` | `cyan` | 新闻文字颜色:`default` `gray` `white` `cyan` `yellow` `green` `blue` `magenta` `red` |
|
|
69
69
|
|
|
70
|
-
|
|
71
|
-
|
|
70
|
+
用 `newsline color <名称>` 直接设置颜色(如 `newsline color gray`),或不带名称运行
|
|
71
|
+
`newsline color` 切换到下一种颜色(default → gray → white → cyan → yellow → green → blue →
|
|
72
|
+
magenta → red)。`newsline colorlist` 会列出所有颜色并附带预览,更改在下次状态栏刷新时生效。
|
|
73
|
+
|
|
74
|
+
## 更新
|
|
75
|
+
|
|
76
|
+
按你安装的方式更新即可 — 语言/主题/颜色设置会保留:
|
|
77
|
+
|
|
78
|
+
```sh
|
|
79
|
+
# curl — 重新运行安装脚本(跳过设置,仅更新 CLI)
|
|
80
|
+
curl -fsSL https://raw.githubusercontent.com/itdar/newsline/master/install.sh | NEWSLINE_NO_INIT=1 sh
|
|
81
|
+
|
|
82
|
+
# Homebrew
|
|
83
|
+
brew update && brew upgrade newsline
|
|
84
|
+
|
|
85
|
+
# npm
|
|
86
|
+
npm i -g newsline-cli@latest
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
Claude Code 插件:运行 `/plugin marketplace update itdar`,然后 `/reload-plugins`
|
|
90
|
+
(或重启)。也可在 `/plugin` → **Marketplaces** 中启用后台自动更新。
|
|
72
91
|
|
|
73
92
|
## 卸载
|
|
74
93
|
|
package/refresh.sh
CHANGED
|
@@ -23,7 +23,7 @@ case "$API" in off|OFF|none|local) API="" ;; esac
|
|
|
23
23
|
COUNT="${NEWSLINE_COUNT:-15}" # how many headlines to cache for rotation
|
|
24
24
|
# Client version, sent to /feed as ?v= for the server-side update nudge.
|
|
25
25
|
# Bump together with package.json when tagging a release.
|
|
26
|
-
export NEWSLINE_VERSION="${NEWSLINE_VERSION:-0.
|
|
26
|
+
export NEWSLINE_VERSION="${NEWSLINE_VERSION:-1.0.0}"
|
|
27
27
|
LOCK="$CACHE_DIR/refresh.lock"
|
|
28
28
|
mkdir -p "$CACHE_DIR" 2>/dev/null
|
|
29
29
|
|