Skip to content

fix(cli): which azionabile, help completo, link repo aggiornati a ondata#48

Merged
aborruso merged 6 commits into
mainfrom
fix/cli-discoverability-and-repo-links
Jul 10, 2026
Merged

fix(cli): which azionabile, help completo, link repo aggiornati a ondata#48
aborruso merged 6 commits into
mainfrom
fix/cli-discoverability-and-repo-links

Conversation

@aborruso

Copy link
Copy Markdown
Member

Cosa fa

Tre fix di UX/coerenza emersi dall'uso reale della CLI:

  1. which ora è azionabile. Prima restituiva forme combinate non incollabili (bill-text links / fetch, votes list / vote-detail show) senza indicare come usarle. Ora: una voce per comando, un esempio pronto da eseguire per ciascuna, riga finale che rimanda a <comando> --help. Il JSON espone il campo example. Aggiunte anche capacità mancanti dal catalogo (camera-amendments, audizioni, bill-text fetch come voce distinta con nota "solo CLI locale").

    Prima:

    ❯ italianparliament which "testo ddl"
    bill-text links / fetch
      Link al testo di un DDL e download/conversione (Senato)
    

    Dopo:

    ❯ italianparliament which "testo ddl"
    bill-text links — Link al testo di un DDL (Camera o Senato)
      es.: italianparliament bill-text links --uri http://dati.senato.it/ddl/55479
    bill-text fetch — Scarica e converte il testo di un DDL Senato (solo CLI locale: supera il WAF con un browser reale)
      es.: italianparliament bill-text fetch --did 56784
    
    Dettagli e altre opzioni: italianparliament <comando> --help
    
  2. Help completo sui flag comuni. --format, --limit e --offset non avevano descrizione in decine di comandi (92 occorrenze totali): l'help mostrava solo --format="csv" senza dire quali valori sono ammessi. Ora --format documenta csv | jsonl ovunque.

  3. Link repo aggiornati a ondata. Rimasti al vecchio path github.com/aborruso/...: git clone e npx skills add nel README, manifest.json (author/repository del DXT), User-Agent di camera-amendments, 5 citation del wiki LOD. Aggiunti anche repository/homepage/bugs in package.json (la pagina npm non aveva alcun link al repo). Il nome del pacchetto npm resta @aborruso/italianparliament-mcp (registro separato, invariato).

Test

Gli esempi emessi da which provengono dagli examples reali dei tool (già esercitati dai test). 123/123 test verdi, tsc pulito, verifica live dei tre esempi dell'help di which.

🤖 Generated with Claude Code

- which: una voce per comando (niente piu' forme combinate "a / b" non
  incollabili), esempio pronto da eseguire per ogni risultato, riga
  finale che rimanda a <comando> --help; JSON con campo example;
  aggiunte capacita' mancanti (camera-amendments, audizioni,
  bill-text fetch come voce propria)
- help: descrizione su tutti i flag --format (csv | jsonl), --limit e
  --offset (41+31+20 occorrenze, prima senza testo)
- link repo: github.com/aborruso/... -> github.com/ondata/... in
  README (git clone, npx skills add), manifest.json, User-Agent di
  camera-amendments, citations del wiki LOD; aggiunti repository/
  homepage/bugs in package.json (la pagina npm non linkava il repo)

123/123 test verdi, tsc pulito.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings July 10, 2026 18:50
@greptile-apps

greptile-apps Bot commented Jul 10, 2026

Copy link
Copy Markdown

Greptile Summary

This PR improves CLI discoverability and updates project links. The main changes are:

  • which now returns one runnable command per result with examples.
  • Common CLI flags now include clearer help text.
  • The SPARQL query help now documents the accepted output formats.
  • Repository links and package metadata now point to ondata.

Confidence Score: 5/5

This looks safe to merge.

  • No blocking issues found in the changed code.
  • The previously reported SPARQL help issue appears fixed at the shared argument definition.

Important Files Changed

Filename Overview
src/cli.ts Updates CLI help text, wires in the extracted capability catalog, and fixes the SPARQL format help text.
src/core/capabilities.ts Adds the shared which capability catalog and scoring helper.
src/core/capabilities.test.ts Adds tests that keep which examples runnable and scoring behavior stable.
src/tools/camera-amendments.ts Updates the Camera amendments User-Agent repository URL.
package.json Adds repository, homepage, and issue tracker metadata.
manifest.json Updates DXT author and repository URLs.
README.md Updates install examples to use the new repository path.

Reviews (5): Last reviewed commit: "fix(cli): capabilityScore si difende da ..." | Re-trigger Greptile

Comment thread src/cli.ts Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Aggiorna la UX della CLI e la coerenza dei riferimenti al repository per rendere più “incollabili” i comandi suggeriti e allineare la documentazione/link dopo lo spostamento sotto l’org ondata.

Changes:

  • Migliora which rendendo l’output azionabile (un comando per riga + esempio eseguibile) e aggiunge il campo example anche nell’output JSON.
  • Completa l’help dei flag comuni (--format, --limit, --offset) in molti comandi della CLI.
  • Aggiorna URL del repo (README/manifest/docs/User-Agent) e aggiunge metadati repository/homepage/bugs in package.json.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/tools/camera-amendments.ts Aggiorna lo User-Agent con il nuovo URL repo ondata.
src/cli.ts Migliora which (output + JSON) e aggiunge descrizioni ai flag comuni su molti comandi.
README.md Aggiorna i comandi di installazione/skill al nuovo path GitHub.
package.json Aggiunge metadati npm (repository/homepage/bugs) puntando a ondata.
manifest.json Aggiorna repository/author URL per il DXT manifest.
docs/lod-wiki/senato/votazione-ddl-link.md Aggiorna link issue GitHub a ondata.
docs/lod-wiki/senato/trappole.md Aggiorna link issue GitHub a ondata.
docs/lod-wiki/senato/corrispondenza-webmaster.md Aggiorna link issue GitHub a ondata.
docs/lod-wiki/camera/votazioni-ricerca-html.md Aggiorna link issue GitHub a ondata.
docs/lod-wiki/camera/assenti.md Aggiorna link issue GitHub a ondata.

Comment thread src/cli.ts
Comment thread src/cli.ts
…which aggiornata

Da review Greptile+Copilot su PR #48: sparqlArgs aveva una definizione
separata sfuggita alla passata sulle 41 occorrenze inline; la
description di which --json non menzionava il nuovo campo example.

123/123 test verdi, tsc pulito.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.

Comment thread src/cli.ts
Da review Copilot su PR #48: which "   " (solo spazi) superava il
positional required, ma dopo il trim la query vuota matchava l'intero
catalogo ("".includes vale per ogni stringa) con exit 0 - fuorviante.
Ora: messaggio d'uso esplicito + exit 2 (stesso codice del no-match).

123/123 test verdi, tsc pulito. Verificato: which "   " -> exit 2,
which carriera invariato.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.

Comment thread src/cli.ts Outdated
Da review Copilot: la convenzione del repo richiede LOG.md aggiornato
per ogni modifica significativa.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 11 out of 11 changed files in this pull request and generated 2 comments.

Comment thread src/cli.ts
Comment thread src/cli.ts Outdated
…tato

Da review Copilot su PR #48:
- il messaggio per query vuota usciva su stdout: incoerente con la
  convenzione della CLI (stdout per risultati/JSON, hint su stderr)
- gli esempi del catalogo which sono curati a mano e rischiavano drift:
  CAPABILITIES+capabilityScore estratti in src/core/capabilities.ts
  (cli.ts esegue runMain all'import, non era testabile) con test di
  coerenza strutturale (example inizia con "italianparliament <cmd>",
  niente forme combinate, cmd unici); allineato l'esempio di search
  find a una forma presente negli examples reali del tool

128/128 test verdi (+5), tsc pulito.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 13 out of 13 changed files in this pull request and generated 2 comments.

Comment thread src/core/capabilities.ts Outdated
Comment thread src/cli.ts
Da review Copilot su PR #48 (estensioni coerenti dei fix precedenti):
- capabilityScore e' esportata: normalizza e valida la query
  internamente (vuota -> 0, trim+lowercase, match case-insensitive
  sui terms) invece di affidarsi alla guardia del solo chiamante which
- il messaggio "nessun comando trovato" usciva su stdout: spostato su
  stderr come il messaggio d'uso (stdout riservato a risultati/JSON)

+2 test (query vuota/spazi -> 0, case-insensitive). 130/130 verdi,
tsc pulito. Verificato: which zzz-inesistente 2>/dev/null -> stdout
vuoto, exit 2.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 13 out of 13 changed files in this pull request and generated no new comments.

@aborruso
aborruso merged commit 73ea81e into main Jul 10, 2026
2 checks passed
@aborruso
aborruso deleted the fix/cli-discoverability-and-repo-links branch July 10, 2026 19:45
aborruso added a commit that referenced this pull request Jul 10, 2026
Patch release con i fix della PR #48. Versione allineata nei 5 punti.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants