naro-cli 0.2.1 → 0.4.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,124 @@
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
+ links the directory via `.naro/project.json` (gitignored automatically) and
17
+ prints the live URL. No Cloudflare credentials are ever needed.
18
+
19
+ Local `.env` files are never uploaded on their own. Every deploy scans your
20
+ source for the env vars it references (`process.env.X`, `import.meta.env.X`,
21
+ plus anything listed in `.env.example`), compares that with the project, and
22
+ asks before opening a dotenv file to fill what is missing. Decline and it
23
+ prints the `naro env add` commands instead. With `--yes`, `--json` or outside
24
+ a TTY it never asks — it just lists what is missing and deploys.
25
+
26
+ Values you register are encrypted at rest, and `naro env pull` /
27
+ `naro env list --reveal` can read them back — your account credentials are
28
+ effectively your env credentials.
29
+
30
+ ## Commands
31
+
32
+ ```text
33
+ naro login | logout | whoami
34
+ naro token Print an access token for CI (NARO_TOKEN)
35
+
36
+ naro link | init Link this directory to a Naro project
37
+ naro unlink Remove the link
38
+ naro projects [--team <slug>] List projects
39
+ naro project inspect Show the linked project
40
+
41
+ naro deploy [--prod] Build locally and deploy
42
+ naro deployments List deployments
43
+ naro inspect <deployment-id> One deployment + build logs
44
+
45
+ naro logs Runtime logs (production)
46
+ naro logs <deployment-id> Build logs of a deployment
47
+ naro logs --type build --follow Stream build logs until READY/FAILED
48
+ naro logs --env preview Preview-surface runtime logs
49
+
50
+ naro env list [--reveal] Secrets masked unless --reveal
51
+ naro env add DATABASE_URL production
52
+ naro env remove DATABASE_URL
53
+ naro env pull [.env.local]
54
+
55
+ naro domains list
56
+ naro domains add www.example.com Prints the DNS records to create
57
+ naro domains remove www.example.com
58
+
59
+ naro promote <deployment-id> Publish a build to production
60
+ naro rollback [deployment-id] Back to the previous production build
61
+ ```
62
+
63
+ ## Machine-readable output (CI / AI agents)
64
+
65
+ Every command supports `--json`: stdout carries exactly one JSON object,
66
+ human logs move to stderr.
67
+
68
+ ```bash
69
+ $ naro deploy --prod --yes --json
70
+ {
71
+ "success": true,
72
+ "deploymentId": "…",
73
+ "projectId": "…",
74
+ "status": "READY",
75
+ "url": "https://my-app.naro.sh",
76
+ "target": "production"
77
+ }
78
+ ```
79
+
80
+ Failures carry stable codes (`NOT_LOGGED_IN`, `PROJECT_NOT_LINKED`,
81
+ `FRAMEWORK_UNSUPPORTED`, `BUILD_FAILED`, `DEPLOYMENT_NOT_FOUND`,
82
+ `ENV_NOT_FOUND`, `VALIDATION_FAILED`, `CONFIRMATION_REQUIRED`,
83
+ `CANCELED`, …). A destructive command run non-interactively without
84
+ `--yes` fails with `CONFIRMATION_REQUIRED` instead of silently doing
85
+ nothing:
86
+
87
+ ```json
88
+ {
89
+ "success": false,
90
+ "code": "BUILD_FAILED",
91
+ "message": "…",
92
+ "deploymentId": "…"
93
+ }
94
+ ```
95
+
96
+ `--yes` (or `-y`) suppresses every prompt — destructive actions
97
+ (production rollback/promote, env/domain removal) run unconfirmed, so use it
98
+ deliberately in automation.
99
+
100
+ ## CI authentication
101
+
102
+ ```bash
103
+ NARO_TOKEN=$(naro token) npx naro-cli deploy --prod --yes --json
104
+ ```
105
+
106
+ `naro token` prints a short-lived (~1h) access token; generate one per run.
107
+ `--token <t>` works too. Locally, credentials live in
108
+ `~/.naro/credentials.json` (0600).
109
+
110
+ ## Environment variables
111
+
112
+ - Values are entered via hidden prompt or stdin — never as an argument:
113
+ `echo "$DATABASE_URL" | naro env add DATABASE_URL production --yes`
114
+ - Targets: `production`, `preview`, `all` (default).
115
+ - `naro env pull` writes `.env.local` (preview + all vars by default,
116
+ `--env production` for production values).
117
+
118
+ ## Configuration
119
+
120
+ | Variable | Purpose |
121
+ | ------------------------ | ---------------------------------------------- |
122
+ | `NARO_TOKEN` | CI/agent access token (skips `naro login`) |
123
+ | `NARO_CONTROL_PLANE_URL` | Custom control plane (default https://naro.sh) |
124
+ | `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 {