naro-cli 0.12.0 → 0.14.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 CHANGED
@@ -69,6 +69,19 @@ naro logs <deployment-id> Build logs of a deployment
69
69
  naro logs --type build --follow Stream build logs until READY/FAILED
70
70
  naro logs --env preview Preview-surface runtime logs
71
71
 
72
+ naro analytics Web Analytics: visitors, page views, top pages, referrers, countries, devices, browsers, operating systems (--range 7d)
73
+ naro analytics --country KR --os ios Narrow it: --path, --referrer, --country, --device, --browser, --os (one value each, all must match)
74
+
75
+ naro insights Speed Insights: Web Vitals p75, and the page load's p75 and the mean of each step (--metric lcp, --range 7d)
76
+ naro insights --route '/posts/[id]' The paths under one route
77
+ naro insights --env preview The same for the preview worker
78
+ naro insights --country KR --device mobile Narrow it: --path, --country, --device, --browser, --os (no --referrer: Speed Insights has none)
79
+ naro insights enable | disable Turn measuring on or off
80
+
81
+ naro protection Preview protection: on or off, and whether a bypass secret is set
82
+ naro protection enable | disable Protect the preview URL (members only) or open it to anyone with the link (disable asks first; --yes in CI)
83
+ naro protection bypass [remove] Create (shown once) or remove the secret automation sends as x-naro-protection-bypass (replacing or removing asks first; --yes in CI)
84
+
72
85
  naro env list [--reveal] Secrets masked unless --reveal
73
86
  naro env add DATABASE_URL production
74
87
  naro env remove DATABASE_URL
@@ -160,6 +173,18 @@ naro policy set posts --from-file policy.json
160
173
  Shorthand: writes the policies naro_select … naro_delete
161
174
  naro policy remove todos Drop every policy on the table: back to deny (asks first)
162
175
 
176
+ naro storage Naro Storage: on or off, limits, usage, buckets
177
+ naro storage enable Turn it on: the project's R2 bucket, bound to the backend
178
+ naro storage bucket create avatars --public --file-size-limit 5MiB --allowed-mime-types image/png,image/jpeg
179
+ naro storage bucket update avatars --private | --file-size-limit none | --allowed-mime-types any
180
+ naro storage bucket update docs --public (asks first: anyone with an object's URL can download it)
181
+ naro storage bucket list | empty <name> | remove <name> [--empty] (empty and remove ask first)
182
+ naro storage ls naro://avatars/u1 [--recursive]
183
+ naro storage cp ./me.png naro://avatars/u1/me.png [--upsert] Up to 50 MiB, with the service key
184
+ naro storage cp naro://docs/team-1/plan.pdf ./ Replaces a local file of the same name
185
+ naro storage rm naro://avatars/u1/old.png [--recursive] (asks first)
186
+ naro storage rm naro://avatars/u1/ --recursive Everything under u1/; written u1, an object u1 too
187
+
163
188
  naro promote <deployment-id> Publish a build to production
164
189
  naro rollback [deployment-id] Back to the previous production build
165
190
  ```
@@ -768,6 +793,83 @@ An `--update-check` you give replaces the default: without
768
793
 
769
794
  ## Release notes
770
795
 
796
+ ### 0.14.0
797
+
798
+ - `naro analytics` shows the project's Web Analytics from the terminal: the
799
+ range's visitors and page views (`--range 24h|7d|30d`, 7d by default), then
800
+ the top pages, referrers, countries, devices, browsers and operating systems
801
+ by page views, and `--json` prints the whole report, trend included. The
802
+ same six filters as on the dashboard narrow it, one value each, all of them
803
+ at once: `naro analytics --country KR --os ios`. The first line names the
804
+ filters that applied; filters that leave no visit print one line under it,
805
+ `No visits match these filters. Drop a filter to see more.`, instead of six
806
+ empty tables. The CLI does not check the values; the server answers
807
+ `400 VALIDATION_FAILED` with the rule the value broke (`--country` is an
808
+ uppercase two-letter code like `KR`, `--referrer` a lowercase host like
809
+ `t.co`; `kr` and `T.co` are refused). It reads the
810
+ production worker only, so `--env` is refused with `VALIDATION_FAILED` and
811
+ nothing is sent. An API token (`--token`, `NARO_TOKEN`) can read it.
812
+ - `naro insights` takes the same filters: `--path`, `--country`, `--device`,
813
+ `--browser` and `--os` narrow it to one value each (`--referrer` is refused
814
+ with `VALIDATION_FAILED` and nothing is sent: a vitals row has no referrer).
815
+ The first line names the filters that applied
816
+ (`· filtered by country=KR, os=ios`); filters that leave no measurement print
817
+ `No measurements match these filters. Drop a filter to see more.` instead of
818
+ waiting advice.
819
+ The filters narrow a report only: `naro insights enable | disable` refuses
820
+ them (`Filters only narrow a report; drop --country.`) and sends nothing, and
821
+ an empty value (`--referrer=`) is no filter.
822
+ - `naro insights` prints a `Page load p75 … · mean per step: …` line under the
823
+ metrics table: the p75 of how long visits took to load the page, to the end
824
+ of the load event, then the mean of each step (wait, DNS, connect, server,
825
+ download, processing, onload), so the steps need not add up to the p75. It is
826
+ left out until a visit has sent a page load. The dashboard's Speed Insights
827
+ tab has the same Page load card.
828
+
829
+ ### 0.13.0
830
+
831
+ - `naro insights` shows the project's Speed Insights from the terminal: each
832
+ Web Vital's p75 with its good, needs-improvement and poor shares, then the
833
+ selected metric (`--metric`, `--range`) by page, device, the elements
834
+ behind slow visits and deployment. Production by default; `--env preview`
835
+ reads the preview worker. `--route '/posts/[id]'` lists the paths under
836
+ one route, `--json` prints the whole report, and
837
+ `naro insights enable | disable` turns measuring on or off for production
838
+ and preview together (one switch, so `--env` is refused there).
839
+ - `naro protection` shows whether the project's preview URL is protected and
840
+ whether a bypass secret is set. Protection is on by default: only members
841
+ of the project can open `<name>-preview.naro.sh`, after signing in to naro.
842
+ A GET or HEAD that is a page navigation (`Sec-Fetch-Mode: navigate`), or that
843
+ sends no `Sec-Fetch-Mode` and an `Accept` including `text/html`, is
844
+ redirected to the naro sign-in; every other request gets
845
+ `401 PREVIEW_PROTECTED`. A request the browser sends without cookies (a
846
+ `<link rel="manifest">` without `crossorigin="use-credentials"`) gets 401
847
+ too.
848
+ `naro protection enable` and `naro protection disable` switch it (the edge
849
+ picks the change up within about a minute). `naro protection bypass`
850
+ creates the secret CI or a monitor sends as the `x-naro-protection-bypass`
851
+ header (shown once; it replaces any earlier one) and
852
+ `naro protection bypass remove` deletes it. `disable`, a `bypass` that
853
+ replaces a secret and `bypass remove` ask first; without a terminal they need
854
+ `--yes` and exit 1 with `CONFIRMATION_REQUIRED` otherwise, nothing written.
855
+ The Naro backend API (`/_naro/v1`) and production are never protected.
856
+ - `naro storage` manages the project's Naro Storage: `enable` turns it on,
857
+ `bucket list | create | update | empty | remove` manage the buckets
858
+ (public or private, the largest file, the types taken), and `ls`, `cp`
859
+ and `rm` work on `naro://<bucket>/<path>` with the project's service key
860
+ (`NARO_SERVICE_KEY`, or fetched with a warning) — the bytes go to the
861
+ project's backend, not through naro. One upload is 50 MiB at most.
862
+ `bucket update --public`, `empty`, `remove` and `rm` ask first; without a
863
+ terminal they need `--yes` (`CONFIRMATION_REQUIRED` otherwise, nothing
864
+ sent).
865
+ - `naro policy create` and `naro policy set` take `storage.objects`, as
866
+ migrations already did. A backend from before Storage answers
867
+ `409 BACKEND_OUTDATED`.
868
+ - `naro db push --dry-run`, `naro db reset` and `naro db lint` read
869
+ `CREATE POLICY … ON storage.objects`. 0.12.0 refused such a file on this
870
+ machine (`schema storage does not exist`), and its `db lint` and
871
+ `db reset` did not know Storage's policies.
872
+
771
873
  ### 0.12.0
772
874
 
773
875
  - Migrations and `naro db query` take Postgres's `CREATE POLICY`,
@@ -837,7 +939,9 @@ command run non-interactively without `--yes` fails with
837
939
 
838
940
  `--yes` (or `-y`) suppresses every prompt — destructive actions
839
941
  (production rollback/promote, env/domain removal, database reset, backend key
840
- rotation, policy removal and drop) run unconfirmed, so use it deliberately in
942
+ rotation, policy removal and drop, opening the preview with
943
+ `naro protection disable`, replacing or removing the bypass secret) run
944
+ unconfirmed, so use it deliberately in
841
945
  automation.
842
946
 
843
947
  ## CI authentication
@@ -864,4 +968,5 @@ NARO_TOKEN=$(naro token) npx naro-cli deploy --prod --yes --json
864
968
  | ------------------------ | ---------------------------------------------- |
865
969
  | `NARO_TOKEN` | CI/agent access token (skips `naro login`) |
866
970
  | `NARO_CONTROL_PLANE_URL` | Custom control plane (default https://naro.sh) |
971
+ | `NARO_SERVICE_KEY` | Service key for `naro storage ls\|cp\|rm` |
867
972
  | `NARO_SUPABASE_URL/KEY` | Auth backend override (self-hosted setups) |