naro-cli 0.2.1 → 0.3.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
@@ -1,8 +1,116 @@
1
1
  # naro-cli
2
2
 
3
- Deploy Next.js apps to naro from your terminal.
3
+ Deploy Next.js apps to [Naro](https://naro.sh) from your terminal — a
4
+ Vercel-style workflow on Cloudflare Workers for Platforms.
4
5
 
5
- npx naro-cli login
6
- npx naro-cli deploy --name my-app
6
+ ```bash
7
+ npm install -g naro-cli
7
8
 
8
- Auth is via `naro login` (GitHub). No Cloudflare credentials needed.
9
+ naro login # GitHub sign-in (browser)
10
+ cd my-nextjs-app
11
+ naro deploy # preview deployment
12
+ naro deploy --prod # production deployment
13
+ ```
14
+
15
+ The first `naro deploy` creates the project (named after `package.json`),
16
+ seeds it with your local `.env` values, links the directory via
17
+ `.naro/project.json` (gitignored automatically) and prints the live URL.
18
+ From then on the platform owns env vars (`naro env add/remove/pull`) —
19
+ later deploys do not re-upload local dotenv files. No Cloudflare
20
+ credentials are ever needed.
21
+
22
+ ## Commands
23
+
24
+ ```text
25
+ naro login | logout | whoami
26
+ naro token Print an access token for CI (NARO_TOKEN)
27
+
28
+ naro link | init Link this directory to a Naro project
29
+ naro unlink Remove the link
30
+ naro projects [--team <slug>] List projects
31
+ naro project inspect Show the linked project
32
+
33
+ naro deploy [--prod] Build locally and deploy
34
+ naro deployments List deployments
35
+ naro inspect <deployment-id> One deployment + build logs
36
+
37
+ naro logs Runtime logs (production)
38
+ naro logs <deployment-id> Build logs of a deployment
39
+ naro logs --type build --follow Stream build logs until READY/FAILED
40
+ naro logs --env preview Preview-surface runtime logs
41
+
42
+ naro env list [--reveal] Secrets masked unless --reveal
43
+ naro env add DATABASE_URL production
44
+ naro env remove DATABASE_URL
45
+ naro env pull [.env.local]
46
+
47
+ naro domains list
48
+ naro domains add www.example.com Prints the DNS records to create
49
+ naro domains remove www.example.com
50
+
51
+ naro promote <deployment-id> Publish a build to production
52
+ naro rollback [deployment-id] Back to the previous production build
53
+ ```
54
+
55
+ ## Machine-readable output (CI / AI agents)
56
+
57
+ Every command supports `--json`: stdout carries exactly one JSON object,
58
+ human logs move to stderr.
59
+
60
+ ```bash
61
+ $ naro deploy --prod --yes --json
62
+ {
63
+ "success": true,
64
+ "deploymentId": "…",
65
+ "projectId": "…",
66
+ "status": "READY",
67
+ "url": "https://my-app.naro.sh",
68
+ "target": "production"
69
+ }
70
+ ```
71
+
72
+ Failures carry stable codes (`NOT_LOGGED_IN`, `PROJECT_NOT_LINKED`,
73
+ `FRAMEWORK_UNSUPPORTED`, `BUILD_FAILED`, `DEPLOYMENT_NOT_FOUND`,
74
+ `ENV_NOT_FOUND`, `VALIDATION_FAILED`, `CONFIRMATION_REQUIRED`,
75
+ `CANCELED`, …). A destructive command run non-interactively without
76
+ `--yes` fails with `CONFIRMATION_REQUIRED` instead of silently doing
77
+ nothing:
78
+
79
+ ```json
80
+ {
81
+ "success": false,
82
+ "code": "BUILD_FAILED",
83
+ "message": "…",
84
+ "deploymentId": "…"
85
+ }
86
+ ```
87
+
88
+ `--yes` (or `-y`) suppresses every prompt — destructive actions
89
+ (production rollback/promote, env/domain removal) run unconfirmed, so use it
90
+ deliberately in automation.
91
+
92
+ ## CI authentication
93
+
94
+ ```bash
95
+ NARO_TOKEN=$(naro token) npx naro-cli deploy --prod --yes --json
96
+ ```
97
+
98
+ `naro token` prints a short-lived (~1h) access token; generate one per run.
99
+ `--token <t>` works too. Locally, credentials live in
100
+ `~/.naro/credentials.json` (0600).
101
+
102
+ ## Environment variables
103
+
104
+ - Values are entered via hidden prompt or stdin — never as an argument:
105
+ `echo "$DATABASE_URL" | naro env add DATABASE_URL production --yes`
106
+ - Targets: `production`, `preview`, `all` (default).
107
+ - `naro env pull` writes `.env.local` (preview + all vars by default,
108
+ `--env production` for production values).
109
+
110
+ ## Configuration
111
+
112
+ | Variable | Purpose |
113
+ | ------------------------ | ---------------------------------------------- |
114
+ | `NARO_TOKEN` | CI/agent access token (skips `naro login`) |
115
+ | `NARO_CONTROL_PLANE_URL` | Custom control plane (default https://naro.sh) |
116
+ | `NARO_SUPABASE_URL/KEY` | Auth backend override (self-hosted setups) |
@@ -18,6 +18,9 @@ export interface DeploymentArtifact {
18
18
  compatibilityDate: string;
19
19
  compatibilityFlags: string[];
20
20
  assetsBinding: string;
21
+ assetsConfig?: {
22
+ notFoundHandling: "single-page-application" | "404-page";
23
+ };
21
24
  }
22
25
  /** Mirrors the build log shape from the internal build package. */
23
26
  export interface BuildLog {