newsline-cli 0.1.5 → 0.1.8

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 ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 itdar
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -10,20 +10,26 @@
10
10
  A rotating regional headline sits at the bottom of your session — so a long wait turns into a
11
11
  quick news check. It shows *below* your existing status line (your HUD stays).
12
12
 
13
+ <p align="center"><img src="docs/demo.gif" alt="newsline — rotating regional headlines in the Claude Code status line" width="720"></p>
14
+
13
15
  ## Install & run — one line
14
16
 
15
17
  ```sh
16
18
  # curl (macOS / Linux / WSL) — installs and sets up right away
17
- curl -fsSL https://raw.githubusercontent.com/itdar/cc-plugin/master/install.sh | sh
19
+ curl -fsSL https://raw.githubusercontent.com/itdar/newsline/master/install.sh | sh
18
20
 
19
21
  # Homebrew
20
22
  brew install itdar/tap/newsline && newsline init
21
23
 
22
24
  # npm
23
25
  npm i -g newsline-cli && newsline init
26
+
27
+ # Claude Code plugin — run inside Claude Code, then /newsline:setup
28
+ /plugin marketplace add itdar/newsline
29
+ /plugin install newsline@itdar
24
30
  ```
25
31
 
26
- The news line appears on your **next message** — no restart. Setup asks for a language & topic
32
+ The news line appears on your **next message** — no restart. Setup asks for a language, topic & headline color
27
33
  and keeps your existing status line.
28
34
 
29
35
  ## What it does
@@ -34,6 +40,24 @@ and keeps your existing status line.
34
40
  stay fresh without reinstalling. If it's unreachable, newsline **falls back to built-in feeds**.
35
41
  - The status line is instant (served from a cache); refreshes run in the background.
36
42
 
43
+ ## Privacy
44
+
45
+ Everything that runs on your machine is in this repo — and this is the complete list of
46
+ what ever leaves it:
47
+
48
+ - **Feed curation** (at most once per hour): `lang`, coarse country, local time, day of
49
+ week, timezone offset, `topic`, and the plugin version go to the edge service so it can
50
+ pick fresh regional sources. No tracking ID, no personal data.
51
+ - **Headline clicks**: links open through a small redirect (it sees the article URL plus
52
+ `lang`/`topic`/version), so dead sources can be swapped server-side and clicks counted
53
+ in aggregate. There is no per-user identifier.
54
+ - **Never sent, never read**: your code, prompts, files, or Claude conversations. The
55
+ status line renders from a local cache and never blocks on the network.
56
+
57
+ **Fully local mode**: set `"api": "off"` and `"endpoint": "off"` in
58
+ `~/.config/newsline/config.json` — feeds come from the bundled `feeds.json` and headlines
59
+ link straight to the articles. Nothing is contacted except the news feeds themselves.
60
+
37
61
  ## Configure
38
62
 
39
63
  Re-run `newsline init`, or edit `~/.config/newsline/config.json`:
@@ -46,6 +70,10 @@ Re-run `newsline init`, or edit `~/.config/newsline/config.json`:
46
70
  | `count` | `15` | headlines in rotation |
47
71
  | `maxlen` | `120` | max characters (`max` = no cut) |
48
72
  | `icon` | `📰` | leading glyph (`none` to hide) |
73
+ | `color` | `white` | headline color: `default` `white` `cyan` `yellow` `green` `blue` `magenta` `red` |
74
+
75
+ Or run `newsline color` — each run steps to the next color (default(gray) → white →
76
+ cyan → yellow → green → blue → magenta → red), shown on the next status-line tick.
49
77
 
50
78
  ## Uninstall
51
79
 
package/fetch.py CHANGED
@@ -124,7 +124,8 @@ def render(title, link, endpoint, lang):
124
124
  ver = (os.environ.get("NEWSLINE_VERSION") or "").strip()
125
125
  if ver:
126
126
  q["v"] = ver
127
- wrapped = endpoint + "?" + urllib.parse.urlencode(q)
127
+ # fully-local mode: no endpoint -> link straight to the article, no redirect
128
+ wrapped = endpoint + "?" + urllib.parse.urlencode(q) if endpoint else link
128
129
  if len(title) > MAX_TITLE:
129
130
  title = title[: MAX_TITLE - 1] + "…"
130
131
  label = f"{ICON} {title}" if ICON else title
@@ -137,6 +138,8 @@ def main():
137
138
  if len(sys.argv) < 4:
138
139
  return 2
139
140
  lang, feeds_path, endpoint = sys.argv[1], sys.argv[2], sys.argv[3]
141
+ if endpoint.strip().lower() in ("off", "none", "direct", "local"):
142
+ endpoint = ""
140
143
  count = int(sys.argv[4]) if len(sys.argv) > 4 else 5
141
144
 
142
145
  with open(feeds_path, encoding="utf-8") as f:
package/install.sh CHANGED
@@ -1,11 +1,11 @@
1
1
  #!/usr/bin/env sh
2
2
  # newsline · installer — works from a local checkout OR piped from the web:
3
3
  # ./install.sh
4
- # curl -fsSL https://raw.githubusercontent.com/itdar/cc-plugin/master/install.sh | sh
4
+ # curl -fsSL https://raw.githubusercontent.com/itdar/newsline/master/install.sh | sh
5
5
  # No build step; copies the scripts onto your PATH. Idempotent (safe to re-run).
6
6
  set -eu
7
7
 
8
- REPO="${NEWSLINE_REPO:-itdar/cc-plugin}"
8
+ REPO="${NEWSLINE_REPO:-itdar/newsline}"
9
9
  REF="${NEWSLINE_REF:-master}"
10
10
  PREFIX="${NEWSLINE_PREFIX:-$HOME/.local}"
11
11
  SHARE="$PREFIX/share/newsline"
package/newsline CHANGED
@@ -77,8 +77,8 @@ load_config() {
77
77
  import json,sys,shlex
78
78
  env={"lang":"NEWSLINE_LANG","topic":"NEWSLINE_TOPIC","rotate":"NEWSLINE_ROTATE",
79
79
  "count":"NEWSLINE_COUNT","maxlen":"NEWSLINE_MAXLEN","icon":"NEWSLINE_ICON",
80
- "linkhint":"NEWSLINE_LINKHINT","api":"NEWSLINE_API","endpoint":"NEWSLINE_ENDPOINT",
81
- "base_statusline":"NEWSLINE_BASE"}
80
+ "color":"NEWSLINE_COLOR","linkhint":"NEWSLINE_LINKHINT","api":"NEWSLINE_API",
81
+ "endpoint":"NEWSLINE_ENDPOINT","base_statusline":"NEWSLINE_BASE"}
82
82
  try: d=json.load(open(sys.argv[1]))
83
83
  except Exception: d={}
84
84
  for k,name in env.items():
@@ -152,7 +152,7 @@ cmd_once() {
152
152
  }
153
153
 
154
154
  cmd_init() {
155
- local lang="" topic="" api="" endpoint="" rotate="6" count="15" compose="auto" yes="0" base_override="" a
155
+ local lang="" topic="" color="" api="" endpoint="" rotate="6" count="15" compose="auto" yes="0" base_override="" a
156
156
  while [ $# -gt 0 ]; do
157
157
  case "$1" in
158
158
  --lang) lang="$2"; shift 2;; --topic) topic="$2"; shift 2;;
@@ -189,8 +189,16 @@ cmd_init() {
189
189
  sports "Sports" science "Science" health "Health" entertainment "Entertainment"
190
190
  topic="$CHOICE"
191
191
  fi
192
+ local cur_color; cur_color=$(cfg_get color)
193
+ echo "Select headline color (change anytime: newsline color):" >&2
194
+ choose "${cur_color:-white}" \
195
+ default "Terminal default (gray)" white "White" cyan "Cyan" yellow "Yellow" \
196
+ green "Green" blue "Blue" magenta "Magenta" red "Red"
197
+ color="$CHOICE"
192
198
  else
199
+ # --yes: keep a color previously set via init/`newsline color`; white on first run
193
200
  lang="${lang:-$detected}"; topic="${topic:-general}"
201
+ color=$(cfg_get color); [ -n "$color" ] || color="white"
194
202
  fi
195
203
 
196
204
  # Always KEEP an existing status line and show newsline below it (no prompt).
@@ -210,13 +218,14 @@ cmd_init() {
210
218
  fi
211
219
 
212
220
  mkdir -p "$CONFIG_DIR"
213
- python3 - "$CONFIG" "$lang" "$topic" "$rotate" "$count" "$api" "$endpoint" "$base" "$base_obj" <<'PY' || { echo "✗ could not write $CONFIG" >&2; return 1; }
221
+ python3 - "$CONFIG" "$lang" "$topic" "$rotate" "$count" "$api" "$endpoint" "$base" "$base_obj" "$color" <<'PY' || { echo "✗ could not write $CONFIG" >&2; return 1; }
214
222
  import json,os,sys
215
- _,path,lang,topic,rotate,count,api,endpoint,base,base_obj=sys.argv
223
+ _,path,lang,topic,rotate,count,api,endpoint,base,base_obj,color=sys.argv
216
224
  try:
217
225
  d={"lang":lang,"topic":topic,"rotate":int(rotate),"count":int(count)}
218
226
  except ValueError:
219
227
  sys.stderr.write("newsline: --rotate/--count must be integers\n"); sys.exit(3)
228
+ if color and color not in ("default","none","off"): d["color"]=color
220
229
  if api: d["api"]=api
221
230
  if endpoint: d["endpoint"]=endpoint
222
231
  if base: d["base_statusline"]=base
@@ -257,6 +266,32 @@ PY
257
266
  echo " It appears on your next message to Claude — no restart needed."
258
267
  }
259
268
 
269
+ cmd_color() { # newsline color — each run steps to the next color (wraps around)
270
+ local cur new; cur=$(cfg_get color)
271
+ new=$(python3 - "${cur:-default}" <<'PY'
272
+ import sys
273
+ p=["default","white","cyan","yellow","green","blue","magenta","red"]
274
+ c=sys.argv[1]
275
+ print(p[(p.index(c)+1)%len(p)] if c in p else "default")
276
+ PY
277
+ )
278
+ mkdir -p "$CONFIG_DIR"
279
+ python3 - "$CONFIG" "$new" <<'PY' || { echo "✗ could not write $CONFIG" >&2; return 1; }
280
+ import json,os,sys
281
+ path,color=sys.argv[1],sys.argv[2]
282
+ try: d=json.load(open(path))
283
+ except Exception: d={}
284
+ if color in ("default","none","off"): d.pop("color",None)
285
+ else: d["color"]=color
286
+ tmp=path+".tmp"
287
+ with open(tmp,"w") as f: json.dump(d,f,indent=2,ensure_ascii=False)
288
+ os.replace(tmp,path)
289
+ PY
290
+ echo "✔ headline color: $new — preview:"
291
+ load_config
292
+ "$HERE/statusline.sh"; echo
293
+ }
294
+
260
295
  cmd_uninstall() {
261
296
  local base base_obj
262
297
  base=$(cfg_get base_statusline)
@@ -299,7 +334,11 @@ PY
299
334
  usage() {
300
335
  cat <<'EOF'
301
336
  newsline — local news status-line utility
302
- newsline init [--lang ko] [--topic tech] set up & wire the status line
337
+ newsline init [--lang ko] [--topic tech] set up & wire the status line
338
+ (asks language / topic / color)
339
+ newsline color next headline color: default(gray) → white
340
+ → cyan → yellow → green → blue → magenta
341
+ → red → back to default
303
342
  newsline uninstall remove & restore previous status line
304
343
  EOF
305
344
  if [ "${1:-}" = "--all" ]; then
@@ -318,6 +357,7 @@ case "${1:-help}" in
318
357
  refresh) shift; cmd_refresh "$@";;
319
358
  once) shift; cmd_once "$@";;
320
359
  init) shift; cmd_init "$@";;
360
+ color) shift; cmd_color;;
321
361
  uninstall) shift; cmd_uninstall "$@";;
322
362
  help|-h|--help) shift; usage "$@";;
323
363
  *) usage; exit 1;;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "newsline-cli",
3
- "version": "0.1.5",
3
+ "version": "0.1.8",
4
4
  "description": "Locale-aware one-line news in your Claude Code status line — local, composes with your existing status line.",
5
5
  "bin": {
6
6
  "newsline": "newsline"
@@ -28,8 +28,8 @@
28
28
  ],
29
29
  "repository": {
30
30
  "type": "git",
31
- "url": "git+https://github.com/itdar/cc-plugin.git"
31
+ "url": "git+https://github.com/itdar/newsline.git"
32
32
  },
33
- "homepage": "https://github.com/itdar/cc-plugin",
33
+ "homepage": "https://github.com/itdar/newsline",
34
34
  "license": "MIT"
35
35
  }
package/readme/de.md CHANGED
@@ -11,21 +11,27 @@ Eine rotierende regionale Schlagzeile sitzt am unteren Rand deiner Sitzung – s
11
11
  ein schneller Blick in die Nachrichten. Sie erscheint *unter* deiner bestehenden Statusleiste (dein HUD
12
12
  bleibt erhalten).
13
13
 
14
+ <p align="center"><img src="../docs/demo.gif" alt="newsline — rotierende regionale Schlagzeilen in der Claude-Code-Statusleiste" width="720"></p>
15
+
14
16
  ## Installieren & starten — eine Zeile
15
17
 
16
18
  ```sh
17
19
  # curl (macOS / Linux / WSL) — installiert und richtet sofort ein
18
- curl -fsSL https://raw.githubusercontent.com/itdar/cc-plugin/master/install.sh | sh
20
+ curl -fsSL https://raw.githubusercontent.com/itdar/newsline/master/install.sh | sh
19
21
 
20
22
  # Homebrew
21
23
  brew install itdar/tap/newsline && newsline init
22
24
 
23
25
  # npm
24
26
  npm i -g newsline-cli && newsline init
27
+
28
+ # Claude-Code-Plugin — in Claude Code ausführen, danach /newsline:setup
29
+ /plugin marketplace add itdar/newsline
30
+ /plugin install newsline@itdar
25
31
  ```
26
32
 
27
33
  Die News-Zeile erscheint bei deiner **nächsten Nachricht** – kein Neustart nötig. Die Einrichtung fragt
28
- nach Sprache und Thema und behält deine bestehende Statusleiste bei.
34
+ nach Sprache, Thema und Schlagzeilenfarbe und behält deine bestehende Statusleiste bei.
29
35
 
30
36
  ## Was es macht
31
37
 
@@ -36,6 +42,25 @@ nach Sprache und Thema und behält deine bestehende Statusleiste bei.
36
42
  newsline auf die integrierten Feeds zurück**.
37
43
  - Die Statusleiste ist sofort da (aus einem Cache); Aktualisierungen laufen im Hintergrund.
38
44
 
45
+ ## Datenschutz
46
+
47
+ Alles, was auf deinem Rechner läuft, steht in diesem Repository — und das ist die
48
+ vollständige Liste dessen, was ihn je verlässt:
49
+
50
+ - **Feed-Kuratierung** (höchstens einmal pro Stunde): `lang`, grobes Land, Ortszeit,
51
+ Wochentag, Zeitzone, `topic` und die Plugin-Version gehen an den Edge-Dienst, damit er
52
+ aktuelle regionale Quellen auswählen kann. Keine Tracking-ID, keine persönlichen Daten.
53
+ - **Klicks auf Schlagzeilen**: Links öffnen sich über eine kleine Weiterleitung (sie sieht
54
+ die Artikel-URL plus `lang`/`topic`/Version), damit tote Quellen serverseitig ersetzt und
55
+ Klicks aggregiert gezählt werden können. Es gibt keine nutzerbezogene Kennung.
56
+ - **Nie gesendet, nie gelesen**: dein Code, deine Prompts, Dateien oder
57
+ Claude-Unterhaltungen. Die Statusleiste wird aus einem lokalen Cache gezeichnet und wartet
58
+ nie auf das Netzwerk.
59
+
60
+ **Vollständig lokaler Modus**: setze `"api": "off"` und `"endpoint": "off"` in
61
+ `~/.config/newsline/config.json` — die Feeds kommen aus der mitgelieferten `feeds.json`, und
62
+ Schlagzeilen verlinken direkt auf die Artikel. Außer den Feeds selbst wird nichts kontaktiert.
63
+
39
64
  ## Konfigurieren
40
65
 
41
66
  Führe `newsline init` erneut aus oder bearbeite `~/.config/newsline/config.json`:
@@ -48,6 +73,11 @@ Führe `newsline init` erneut aus oder bearbeite `~/.config/newsline/config.json
48
73
  | `count` | `15` | Schlagzeilen im Wechsel |
49
74
  | `maxlen` | `120` | maximale Zeichen (`max` = kein Abschneiden) |
50
75
  | `icon` | `📰` | vorangestelltes Symbol (`none` zum Ausblenden) |
76
+ | `color` | `white` | Farbe der Schlagzeile: `default` `white` `cyan` `yellow` `green` `blue` `magenta` `red` |
77
+
78
+ Oder `newsline color` verwenden — jeder Aufruf wechselt zur nächsten Farbe (default(gray) →
79
+ white → cyan → yellow → green → blue → magenta → red), sichtbar beim nächsten
80
+ Statuszeilen-Refresh.
51
81
 
52
82
  ## Deinstallieren
53
83
 
package/readme/es.md CHANGED
@@ -10,21 +10,27 @@
10
10
  Un titular regional rotativo aparece en la parte inferior de tu sesión, así una larga espera se convierte
11
11
  en un vistazo rápido a las noticias. Se muestra *debajo* de tu barra de estado actual (tu HUD se mantiene).
12
12
 
13
+ <p align="center"><img src="../docs/demo.gif" alt="newsline — titulares regionales rotativos en la barra de estado de Claude Code" width="720"></p>
14
+
13
15
  ## Instalar y ejecutar — una línea
14
16
 
15
17
  ```sh
16
18
  # curl (macOS / Linux / WSL) — instala y configura al instante
17
- curl -fsSL https://raw.githubusercontent.com/itdar/cc-plugin/master/install.sh | sh
19
+ curl -fsSL https://raw.githubusercontent.com/itdar/newsline/master/install.sh | sh
18
20
 
19
21
  # Homebrew
20
22
  brew install itdar/tap/newsline && newsline init
21
23
 
22
24
  # npm
23
25
  npm i -g newsline-cli && newsline init
26
+
27
+ # Plugin de Claude Code — ejecútalo dentro de Claude Code y luego /newsline:setup
28
+ /plugin marketplace add itdar/newsline
29
+ /plugin install newsline@itdar
24
30
  ```
25
31
 
26
32
  La línea de noticias aparece en tu **próximo mensaje**, sin reiniciar. La configuración te pregunta el
27
- idioma y el tema, y conserva tu barra de estado actual.
33
+ idioma, el tema y el color del titular, y conserva tu barra de estado actual.
28
34
 
29
35
  ## Qué hace
30
36
 
@@ -36,6 +42,24 @@ idioma y el tema, y conserva tu barra de estado actual.
36
42
  - La barra de estado es instantánea (servida desde una caché); las actualizaciones se ejecutan en
37
43
  segundo plano.
38
44
 
45
+ ## Privacidad
46
+
47
+ Todo lo que se ejecuta en tu equipo está en este repositorio — y esta es la lista completa
48
+ de lo que sale de él:
49
+
50
+ - **Curación de feeds** (como máximo una vez por hora): `lang`, país aproximado, hora local,
51
+ día de la semana, zona horaria, `topic` y la versión del plugin se envían al servicio edge
52
+ para elegir fuentes regionales actualizadas. Sin ID de seguimiento, sin datos personales.
53
+ - **Clics en titulares**: los enlaces se abren a través de una pequeña redirección (ve la URL
54
+ del artículo más `lang`/`topic`/versión), para poder reemplazar fuentes caídas en el
55
+ servidor y contar los clics de forma agregada. No hay identificador por usuario.
56
+ - **Nunca se envía ni se lee**: tu código, prompts, archivos o conversaciones con Claude. La
57
+ barra de estado se dibuja desde una caché local y nunca espera a la red.
58
+
59
+ **Modo totalmente local**: pon `"api": "off"` y `"endpoint": "off"` en
60
+ `~/.config/newsline/config.json` — los feeds vienen del `feeds.json` incluido y los titulares
61
+ enlazan directamente a los artículos. No se contacta con nada salvo los propios feeds.
62
+
39
63
  ## Configurar
40
64
 
41
65
  Vuelve a ejecutar `newsline init` o edita `~/.config/newsline/config.json`:
@@ -48,6 +72,11 @@ Vuelve a ejecutar `newsline init` o edita `~/.config/newsline/config.json`:
48
72
  | `count` | `15` | titulares en rotación |
49
73
  | `maxlen` | `120` | caracteres máximos (`max` = sin recorte) |
50
74
  | `icon` | `📰` | icono inicial (`none` para ocultarlo) |
75
+ | `color` | `white` | color del titular: `default` `white` `cyan` `yellow` `green` `blue` `magenta` `red` |
76
+
77
+ O usa `newsline color` — cada ejecución pasa al siguiente color (default(gray) → white →
78
+ cyan → yellow → green → blue → magenta → red), visible en el próximo refresco de la
79
+ línea de estado.
51
80
 
52
81
  ## Desinstalar
53
82
 
package/readme/fr.md CHANGED
@@ -10,21 +10,27 @@
10
10
  Un titre régional défile en bas de votre session : une longue attente se transforme en un coup d'œil
11
11
  rapide à l'actualité. Il s'affiche *sous* votre barre d'état existante (votre HUD reste en place).
12
12
 
13
+ <p align="center"><img src="../docs/demo.gif" alt="newsline — titres régionaux défilants dans la barre d'état de Claude Code" width="720"></p>
14
+
13
15
  ## Installer et lancer — une ligne
14
16
 
15
17
  ```sh
16
18
  # curl (macOS / Linux / WSL) — installe et configure immédiatement
17
- curl -fsSL https://raw.githubusercontent.com/itdar/cc-plugin/master/install.sh | sh
19
+ curl -fsSL https://raw.githubusercontent.com/itdar/newsline/master/install.sh | sh
18
20
 
19
21
  # Homebrew
20
22
  brew install itdar/tap/newsline && newsline init
21
23
 
22
24
  # npm
23
25
  npm i -g newsline-cli && newsline init
26
+
27
+ # Plugin Claude Code — à lancer dans Claude Code, puis /newsline:setup
28
+ /plugin marketplace add itdar/newsline
29
+ /plugin install newsline@itdar
24
30
  ```
25
31
 
26
32
  La ligne d'actualité apparaît dès votre **prochain message** — sans redémarrage. La configuration vous
27
- demande une langue et un thème, et conserve votre barre d'état existante.
33
+ demande une langue, un thème et une couleur de titre, et conserve votre barre d'état existante.
28
34
 
29
35
  ## Ce que ça fait
30
36
 
@@ -36,6 +42,25 @@ demande une langue et un thème, et conserve votre barre d'état existante.
36
42
  - La barre d'état est instantanée (servie depuis un cache) ; les rafraîchissements s'exécutent en
37
43
  arrière-plan.
38
44
 
45
+ ## Confidentialité
46
+
47
+ Tout ce qui s'exécute sur votre machine se trouve dans ce dépôt — et voici la liste complète
48
+ de ce qui en sort :
49
+
50
+ - **Curation des flux** (au plus une fois par heure) : `lang`, pays approximatif, heure
51
+ locale, jour de la semaine, fuseau horaire, `topic` et la version du plugin sont envoyés au
52
+ service edge pour choisir des sources régionales à jour. Pas d'ID de suivi, pas de données
53
+ personnelles.
54
+ - **Clics sur les titres** : les liens s'ouvrent via une petite redirection (elle voit l'URL
55
+ de l'article plus `lang`/`topic`/version), afin de remplacer côté serveur les sources mortes
56
+ et de compter les clics de façon agrégée. Aucun identifiant par utilisateur.
57
+ - **Jamais envoyé, jamais lu** : votre code, vos prompts, vos fichiers ou vos conversations
58
+ avec Claude. La barre d'état s'affiche depuis un cache local et n'attend jamais le réseau.
59
+
60
+ **Mode entièrement local** : mettez `"api": "off"` et `"endpoint": "off"` dans
61
+ `~/.config/newsline/config.json` — les flux viennent du `feeds.json` embarqué et les titres
62
+ pointent directement vers les articles. Rien d'autre que les flux eux-mêmes n'est contacté.
63
+
39
64
  ## Configurer
40
65
 
41
66
  Relancez `newsline init`, ou modifiez `~/.config/newsline/config.json` :
@@ -48,6 +73,11 @@ Relancez `newsline init`, ou modifiez `~/.config/newsline/config.json` :
48
73
  | `count` | `15` | titres en rotation |
49
74
  | `maxlen` | `120` | caractères maximum (`max` = sans coupure) |
50
75
  | `icon` | `📰` | icône de tête (`none` pour masquer) |
76
+ | `color` | `white` | couleur du titre : `default` `white` `cyan` `yellow` `green` `blue` `magenta` `red` |
77
+
78
+ Ou utilisez `newsline color` — chaque exécution passe à la couleur suivante (default(gray) →
79
+ white → cyan → yellow → green → blue → magenta → red), visible au prochain
80
+ rafraîchissement de la ligne d'état.
51
81
 
52
82
  ## Désinstaller
53
83
 
package/readme/ja.md CHANGED
@@ -10,20 +10,26 @@
10
10
  地域のヘッドラインがセッション下部で切り替わり表示され、長い待ち時間がサッとニュースをチェックする
11
11
  時間に変わります。既存のステータスライン(HUD)の **下の行に** 表示されるので、HUD はそのまま残ります。
12
12
 
13
+ <p align="center"><img src="../docs/demo.gif" alt="newsline — Claude Code のステータスラインで切り替わる地域ヘッドライン" width="720"></p>
14
+
13
15
  ## インストールと実行 — 一行で
14
16
 
15
17
  ```sh
16
18
  # curl (macOS / Linux / WSL) — インストールとセットアップを一気に
17
- curl -fsSL https://raw.githubusercontent.com/itdar/cc-plugin/master/install.sh | sh
19
+ curl -fsSL https://raw.githubusercontent.com/itdar/newsline/master/install.sh | sh
18
20
 
19
21
  # Homebrew
20
22
  brew install itdar/tap/newsline && newsline init
21
23
 
22
24
  # npm
23
25
  npm i -g newsline-cli && newsline init
26
+
27
+ # Claude Code プラグイン — Claude Code 内で実行し、その後 /newsline:setup
28
+ /plugin marketplace add itdar/newsline
29
+ /plugin install newsline@itdar
24
30
  ```
25
31
 
26
- ニュース行は **次のメッセージ** で表示されます — 再起動は不要です。セットアップで言語とトピックを
32
+ ニュース行は **次のメッセージ** で表示されます — 再起動は不要です。セットアップで言語・トピック・文字色を
27
33
  尋ね、既存のステータスラインはそのまま保持します。
28
34
 
29
35
  ## 何をするか
@@ -35,6 +41,24 @@ npm i -g newsline-cli && newsline init
35
41
  フォールバック** します。
36
42
  - ステータスラインはキャッシュから **即座に** 表示され、更新はバックグラウンドで実行されます。
37
43
 
44
+ ## プライバシー
45
+
46
+ あなたのマシンで動くコードはすべてこのリポジトリで公開されており、外部に送られる情報は以下が
47
+ すべてです:
48
+
49
+ - **フィードのキュレーション**(最大 1 時間に 1 回): 地域に合った最新ソースを選ぶため、`lang`、
50
+ おおまかな国、現地時刻、曜日、タイムゾーン、`topic`、プラグインのバージョンをエッジサービスに
51
+ 送ります。トラッキング ID や個人情報はありません。
52
+ - **ヘッドラインのクリック時**: 停止したソースをサーバー側で差し替え、クリックを集計カウント
53
+ できるよう、小さなリダイレクトを経由します(記事 URL + `lang`/`topic`/バージョンのみ)。
54
+ ユーザーごとの識別子はありません。
55
+ - **決して送信・閲覧しないもの**: コード、プロンプト、ファイル、Claude との会話。ステータス
56
+ ラインはネットワークを待たず、ローカルキャッシュから描画されます。
57
+
58
+ **完全ローカルモード**: `~/.config/newsline/config.json` に `"api": "off"` と
59
+ `"endpoint": "off"` を設定すると、フィードは同梱の `feeds.json` のみを使い、ヘッドラインは記事に
60
+ 直接リンクします。ニュースフィード以外にはどこにも接続しません。
61
+
38
62
  ## 設定
39
63
 
40
64
  `newsline init` を再実行するか、`~/.config/newsline/config.json` を編集します:
@@ -47,6 +71,10 @@ npm i -g newsline-cli && newsline init
47
71
  | `count` | `15` | 切り替えるヘッドライン数 |
48
72
  | `maxlen` | `120` | 最大文字数(`max` = 無制限) |
49
73
  | `icon` | `📰` | 先頭アイコン(`none` で非表示) |
74
+ | `color` | `white` | 見出しの文字色:`default` `white` `cyan` `yellow` `green` `blue` `magenta` `red` |
75
+
76
+ `newsline color` を実行するたびに次の色へ進みます(default(gray) → white → cyan → yellow →
77
+ green → blue → magenta → red の順で循環、次のステータスライン更新で反映)。
50
78
 
51
79
  ## アンインストール
52
80
 
package/readme/ko.md CHANGED
@@ -10,20 +10,26 @@
10
10
  긴 작업을 기다리는 시간이 뉴스 한 번 훑는 시간이 됩니다 — 세션 하단에 지역 맞춤 헤드라인이
11
11
  회전 표시됩니다. 기존 상태줄(HUD) **아래 줄에** 붙어서, HUD는 그대로 보입니다.
12
12
 
13
+ <p align="center"><img src="../docs/demo.gif" alt="newsline — Claude Code 상태줄에 회전하는 지역 헤드라인" width="720"></p>
14
+
13
15
  ## 설치 & 실행 — 한 줄
14
16
 
15
17
  ```sh
16
18
  # curl (macOS / Linux / WSL) — 설치 + 셋업까지 바로
17
- curl -fsSL https://raw.githubusercontent.com/itdar/cc-plugin/master/install.sh | sh
19
+ curl -fsSL https://raw.githubusercontent.com/itdar/newsline/master/install.sh | sh
18
20
 
19
21
  # Homebrew
20
22
  brew install itdar/tap/newsline && newsline init
21
23
 
22
24
  # npm
23
25
  npm i -g newsline-cli && newsline init
26
+
27
+ # Claude Code 플러그인 — Claude Code 안에서 실행 후 /newsline:setup
28
+ /plugin marketplace add itdar/newsline
29
+ /plugin install newsline@itdar
24
30
  ```
25
31
 
26
- 뉴스 줄은 **다음 메시지 때** 나타납니다 — 재시작 불필요. 셋업은 언어·분야를 물어보고, 기존
32
+ 뉴스 줄은 **다음 메시지 때** 나타납니다 — 재시작 불필요. 셋업은 언어·분야·글자 색을 물어보고, 기존
27
33
  상태줄은 유지합니다.
28
34
 
29
35
  ## 무엇을 하나
@@ -33,6 +39,22 @@ npm i -g newsline-cli && newsline init
33
39
  재설치 없이 소스가 최신으로 유지되고, 엣지가 불통이면 **내장 피드로 자동 폴백**합니다.
34
40
  - 상태줄은 캐시에서 **즉시** 표시되고, 갱신은 백그라운드에서 돕니다.
35
41
 
42
+ ## 프라이버시
43
+
44
+ 내 컴퓨터에서 도는 코드는 전부 이 저장소에 공개돼 있고, 밖으로 나가는 정보는 아래가 전부입니다:
45
+
46
+ - **피드 큐레이션** (최대 1시간에 1번): 지역에 맞는 최신 소스를 고르기 위해 `lang`, 대략적인
47
+ 국가, 현지 시각, 요일, 타임존, `topic`, 플러그인 버전을 엣지 서비스로 보냅니다. 추적 ID·개인정보
48
+ 없음.
49
+ - **헤드라인 클릭 시**: 죽은 소스를 서버에서 교체하고 클릭을 집계 카운트할 수 있도록 작은
50
+ 리다이렉트를 경유합니다(기사 URL + `lang`/`topic`/버전만 전달). 사용자별 식별자는 없습니다.
51
+ - **절대 전송·열람하지 않는 것**: 코드, 프롬프트, 파일, Claude 대화. 상태줄은 네트워크를 기다리지
52
+ 않고 로컬 캐시에서 그립니다.
53
+
54
+ **완전 로컬 모드**: `~/.config/newsline/config.json`에 `"api": "off"`, `"endpoint": "off"`를 넣으면
55
+ 피드는 내장 `feeds.json`만 쓰고 헤드라인은 기사로 바로 연결됩니다. 뉴스 피드 외에는 아무 곳에도
56
+ 접속하지 않습니다.
57
+
36
58
  ## 설정
37
59
 
38
60
  `newsline init` 재실행 또는 `~/.config/newsline/config.json` 편집:
@@ -45,6 +67,10 @@ npm i -g newsline-cli && newsline init
45
67
  | `count` | `15` | 회전 헤드라인 수 |
46
68
  | `maxlen` | `120` | 최대 글자수 (`max`=무제한) |
47
69
  | `icon` | `📰` | 앞 아이콘 (`none`이면 제거) |
70
+ | `color` | `white` | 뉴스 글자 색: `default` `white` `cyan` `yellow` `green` `blue` `magenta` `red` |
71
+
72
+ `newsline color`를 실행할 때마다 다음 색으로 넘어갑니다 (default(gray) → white → cyan →
73
+ yellow → green → blue → magenta → red 순환, 다음 상태줄 갱신 때 반영).
48
74
 
49
75
  ## 제거
50
76
 
package/readme/pt.md CHANGED
@@ -10,21 +10,27 @@
10
10
  Uma manchete regional rotativa fica na parte de baixo da sua sessão — então uma longa espera vira uma
11
11
  olhada rápida nas notícias. Ela aparece *abaixo* da sua barra de status atual (seu HUD permanece).
12
12
 
13
+ <p align="center"><img src="../docs/demo.gif" alt="newsline — manchetes regionais rotativas na barra de status do Claude Code" width="720"></p>
14
+
13
15
  ## Instalar e executar — uma linha
14
16
 
15
17
  ```sh
16
18
  # curl (macOS / Linux / WSL) — instala e configura na hora
17
- curl -fsSL https://raw.githubusercontent.com/itdar/cc-plugin/master/install.sh | sh
19
+ curl -fsSL https://raw.githubusercontent.com/itdar/newsline/master/install.sh | sh
18
20
 
19
21
  # Homebrew
20
22
  brew install itdar/tap/newsline && newsline init
21
23
 
22
24
  # npm
23
25
  npm i -g newsline-cli && newsline init
26
+
27
+ # Plugin do Claude Code — execute dentro do Claude Code e depois /newsline:setup
28
+ /plugin marketplace add itdar/newsline
29
+ /plugin install newsline@itdar
24
30
  ```
25
31
 
26
32
  A linha de notícias aparece na sua **próxima mensagem** — sem reiniciar. A configuração pergunta o
27
- idioma e o tema, e mantém a sua barra de status atual.
33
+ idioma, o tema e a cor da manchete, e mantém a sua barra de status atual.
28
34
 
29
35
  ## O que faz
30
36
 
@@ -35,6 +41,24 @@ idioma e o tema, e mantém a sua barra de status atual.
35
41
  integrados como alternativa**.
36
42
  - A barra de status é instantânea (servida de um cache); as atualizações rodam em segundo plano.
37
43
 
44
+ ## Privacidade
45
+
46
+ Tudo o que roda na sua máquina está neste repositório — e esta é a lista completa do que
47
+ sai dela:
48
+
49
+ - **Curadoria de feeds** (no máximo uma vez por hora): `lang`, país aproximado, hora local,
50
+ dia da semana, fuso horário, `topic` e a versão do plugin são enviados ao serviço edge para
51
+ escolher fontes regionais atualizadas. Sem ID de rastreamento, sem dados pessoais.
52
+ - **Cliques nas manchetes**: os links abrem por um pequeno redirecionamento (ele vê a URL do
53
+ artigo mais `lang`/`topic`/versão), para trocar fontes mortas no servidor e contar cliques
54
+ de forma agregada. Não há identificador por usuário.
55
+ - **Nunca enviado, nunca lido**: seu código, prompts, arquivos ou conversas com o Claude. A
56
+ barra de status é desenhada de um cache local e nunca espera pela rede.
57
+
58
+ **Modo totalmente local**: defina `"api": "off"` e `"endpoint": "off"` em
59
+ `~/.config/newsline/config.json` — os feeds vêm do `feeds.json` incluído e as manchetes
60
+ apontam direto para os artigos. Nada além dos próprios feeds é contatado.
61
+
38
62
  ## Configurar
39
63
 
40
64
  Execute `newsline init` novamente ou edite `~/.config/newsline/config.json`:
@@ -47,6 +71,11 @@ Execute `newsline init` novamente ou edite `~/.config/newsline/config.json`:
47
71
  | `count` | `15` | manchetes na rotação |
48
72
  | `maxlen` | `120` | máximo de caracteres (`max` = sem corte) |
49
73
  | `icon` | `📰` | ícone inicial (`none` para ocultar) |
74
+ | `color` | `white` | cor da manchete: `default` `white` `cyan` `yellow` `green` `blue` `magenta` `red` |
75
+
76
+ Ou use `newsline color` — cada execução avança para a próxima cor (default(gray) → white →
77
+ cyan → yellow → green → blue → magenta → red), visível no próximo refresh da linha
78
+ de status.
50
79
 
51
80
  ## Desinstalar
52
81
 
package/readme/zh.md CHANGED
@@ -10,20 +10,26 @@
10
10
  一条轮播的区域头条位于会话底部——漫长的等待就变成了快速浏览新闻的时间。它显示在你现有状态栏的
11
11
  *下方*(你的 HUD 保持不变)。
12
12
 
13
+ <p align="center"><img src="../docs/demo.gif" alt="newsline — 在 Claude Code 状态栏中轮播的区域头条" width="720"></p>
14
+
13
15
  ## 安装并运行 — 一行搞定
14
16
 
15
17
  ```sh
16
18
  # curl (macOS / Linux / WSL) — 安装并立即完成设置
17
- curl -fsSL https://raw.githubusercontent.com/itdar/cc-plugin/master/install.sh | sh
19
+ curl -fsSL https://raw.githubusercontent.com/itdar/newsline/master/install.sh | sh
18
20
 
19
21
  # Homebrew
20
22
  brew install itdar/tap/newsline && newsline init
21
23
 
22
24
  # npm
23
25
  npm i -g newsline-cli && newsline init
26
+
27
+ # Claude Code 插件 — 在 Claude Code 内执行,然后运行 /newsline:setup
28
+ /plugin marketplace add itdar/newsline
29
+ /plugin install newsline@itdar
24
30
  ```
25
31
 
26
- 新闻行会在你的 **下一条消息** 时出现——无需重启。设置会询问语言和主题,并保留你现有的状态栏。
32
+ 新闻行会在你的 **下一条消息** 时出现——无需重启。设置会询问语言、主题和文字颜色,并保留你现有的状态栏。
27
33
 
28
34
  ## 它做什么
29
35
 
@@ -32,6 +38,21 @@ npm i -g newsline-cli && newsline init
32
38
  若无法连接,newsline 会 **回退到内置源**。
33
39
  - 状态栏即时显示(来自缓存);刷新在后台进行。
34
40
 
41
+ ## 隐私
42
+
43
+ 在你电脑上运行的所有代码都在这个仓库里——以下就是会离开你机器的全部信息:
44
+
45
+ - **新闻源筛选**(每小时最多一次):`lang`、粗略的国家、当地时间、星期、时区、`topic` 和插件
46
+ 版本会发送到边缘服务,以便挑选最新的区域新闻源。没有跟踪 ID,没有个人数据。
47
+ - **点击头条时**:链接经由一个小型重定向打开(它只看到文章 URL 加 `lang`/`topic`/版本),以便在
48
+ 服务器端替换失效的新闻源并做聚合点击统计。没有任何按用户区分的标识符。
49
+ - **绝不发送、绝不读取**:你的代码、提示词、文件或与 Claude 的对话。状态栏从本地缓存渲染,
50
+ 从不等待网络。
51
+
52
+ **完全本地模式**:在 `~/.config/newsline/config.json` 中设置 `"api": "off"` 和
53
+ `"endpoint": "off"` —— 新闻源只使用内置的 `feeds.json`,头条直接链接到文章。除了新闻源本身,
54
+ 不会联系任何服务。
55
+
35
56
  ## 配置
36
57
 
37
58
  重新运行 `newsline init`,或编辑 `~/.config/newsline/config.json`:
@@ -44,6 +65,10 @@ npm i -g newsline-cli && newsline init
44
65
  | `count` | `15` | 轮播头条数量 |
45
66
  | `maxlen` | `120` | 最大字符数(`max` = 不截断) |
46
67
  | `icon` | `📰` | 前置图标(`none` 为隐藏) |
68
+ | `color` | `white` | 新闻文字颜色:`default` `white` `cyan` `yellow` `green` `blue` `magenta` `red` |
69
+
70
+ 也可以运行 `newsline color` — 每次执行切换到下一种颜色(default(gray) → white → cyan →
71
+ yellow → green → blue → magenta → red,下次状态栏刷新即生效)。
47
72
 
48
73
  ## 卸载
49
74
 
package/refresh.sh CHANGED
@@ -15,10 +15,15 @@ FEEDS="${NEWSLINE_FEEDS:-$HERE/feeds.json}"
15
15
  # The redirect wrapper you control. This is the ONE remote piece — clicks pass
16
16
  # through it so monetization can be switched on later WITHOUT re-shipping.
17
17
  ENDPOINT="${NEWSLINE_ENDPOINT:-https://newsline.thesockerrr.workers.dev/r}"
18
+ # "off" (also none/direct/local) links headlines straight to the article — no redirect
19
+ case "$ENDPOINT" in off|OFF|none|direct|local) ENDPOINT="" ;; esac
20
+ # Curation API base; "off" (also none/local) skips it entirely — bundled feeds only
21
+ API="${NEWSLINE_API:-https://newsline.thesockerrr.workers.dev}"
22
+ case "$API" in off|OFF|none|local) API="" ;; esac
18
23
  COUNT="${NEWSLINE_COUNT:-15}" # how many headlines to cache for rotation
19
24
  # Client version, sent to /feed as ?v= for the server-side update nudge.
20
25
  # Bump together with package.json when tagging a release.
21
- export NEWSLINE_VERSION="${NEWSLINE_VERSION:-0.1.5}"
26
+ export NEWSLINE_VERSION="${NEWSLINE_VERSION:-0.1.8}"
22
27
  LOCK="$CACHE_DIR/refresh.lock"
23
28
  mkdir -p "$CACHE_DIR" 2>/dev/null
24
29
 
@@ -75,7 +80,7 @@ if [ -s "$RESOLVED" ] && [ -f "$RESOLVE_STAMP" ]; then
75
80
  [ $((now - smt)) -lt "$RESOLVE_TTL" ] && need_resolve=0
76
81
  fi
77
82
  if [ "$need_resolve" = "1" ]; then
78
- if python3 "$HERE/resolve.py" "$lang" "$FEEDS" "${NEWSLINE_API:-https://newsline.thesockerrr.workers.dev}" > "$RESOLVED.tmp" 2>/dev/null \
83
+ if python3 "$HERE/resolve.py" "$lang" "$FEEDS" "$API" > "$RESOLVED.tmp" 2>/dev/null \
79
84
  && [ -s "$RESOLVED.tmp" ]; then
80
85
  mv -f "$RESOLVED.tmp" "$RESOLVED"
81
86
  touch "$RESOLVE_STAMP"
@@ -105,7 +110,7 @@ if [ -n "$msg" ]; then
105
110
  case "$HERE" in # install channel by where we live
106
111
  *"/node_modules/"*) ucmd="npm i -g newsline-cli" ;;
107
112
  *[Cc]ellar*|*linuxbrew*) ucmd="brew upgrade newsline" ;;
108
- *) ucmd="curl -fsSL https://raw.githubusercontent.com/itdar/cc-plugin/master/install.sh | sh" ;;
113
+ *) ucmd="curl -fsSL https://raw.githubusercontent.com/itdar/newsline/master/install.sh | sh" ;;
109
114
  esac
110
115
  # yellow line, command in bold bright yellow — mirrors Claude Code's own update nudge
111
116
  printf '\033[33m[%s] Run: \033[1;93m%s\033[0m\n' "$msg" "$ucmd" > "$NOTICE.tmp" && mv -f "$NOTICE.tmp" "$NOTICE"
package/statusline.sh CHANGED
@@ -24,6 +24,24 @@ if [ "$needs_refresh" = "1" ]; then
24
24
  ( "$HERE/refresh.sh" >/dev/null 2>&1 & ) 2>/dev/null
25
25
  fi
26
26
 
27
+ # --- optional headline color (NEWSLINE_COLOR: a name, or raw SGR params) ---
28
+ # Applied at PRINT time, not baked into the cache, so `newsline color` shows up
29
+ # on the next status-line tick without waiting for a refresh.
30
+ SGR=""
31
+ case "$(printf '%s' "${NEWSLINE_COLOR:-}" | tr '[:upper:]' '[:lower:]')" in
32
+ ''|default|none|off) SGR="" ;;
33
+ dim) SGR="2" ;;
34
+ gray|grey) SGR="90" ;;
35
+ red) SGR="31" ;; green) SGR="32" ;; yellow) SGR="33" ;;
36
+ blue) SGR="34" ;; magenta) SGR="35" ;; cyan) SGR="36" ;;
37
+ white) SGR="37" ;; orange) SGR="38;5;208" ;;
38
+ *[!0-9\;]*) SGR="" ;; # unknown name — ignore, print plain
39
+ *) SGR="${NEWSLINE_COLOR}" ;; # raw SGR params, e.g. "38;5;245"
40
+ esac
41
+ colorize() { # wrap text in the configured color (no-op when unset); no newline
42
+ if [ -n "$SGR" ]; then printf '\033[%sm%s\033[0m' "$SGR" "$1"; else printf '%s' "$1"; fi
43
+ }
44
+
27
45
  # --- print one headline, rotating across the cached set by wall-clock time ---
28
46
  # The cache holds N headlines (one per line). We show a different one every
29
47
  # NEWSLINE_ROTATE seconds — a ticker feel with zero stored state.
@@ -35,12 +53,12 @@ if [ -s "$CACHE_FILE" ]; then
35
53
  [ "$rot" -ge 1 ] || rot=6 # 0 would divide by zero below
36
54
  now="${NEWSLINE_NOW:-$(date +%s)}" # NEWSLINE_NOW overrides clock (tests/debug)
37
55
  idx=$(( (now / rot) % n + 1 ))
38
- sed -n "${idx}p" "$CACHE_FILE"
56
+ colorize "$(sed -n "${idx}p" "$CACHE_FILE")"; printf '\n'
39
57
  else
40
- printf '📰 …'
58
+ colorize '📰 …'
41
59
  fi
42
60
  else
43
- printf '📰 …' # first run, before the first refresh lands
61
+ colorize '📰 …' # first run, before the first refresh lands
44
62
  fi
45
63
 
46
64
  # --- server-driven update nudge (written/cleared by refresh.sh), below the news ---