@getrefino/cli 0.1.0-rc.1 → 0.1.0-rc.2
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 +42 -3
- package/dist/cli.js +36 -9
- package/dist/format.js +6 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -32,7 +32,38 @@ components.
|
|
|
32
32
|
|
|
33
33
|
## Install into a site
|
|
34
34
|
|
|
35
|
-
|
|
35
|
+
The order matters, and it starts on the Refino dashboard rather than in the
|
|
36
|
+
repository.
|
|
37
|
+
|
|
38
|
+
1. **Connect the site in the Refino dashboard (<https://app.refino.dev>).** You
|
|
39
|
+
give it the repository, the branch, where the copy file will live, and the
|
|
40
|
+
URL the site is served from. Refino gives you a **site id** (`site_…`).
|
|
41
|
+
- The branch must be **the branch that will contain the Refino files and be
|
|
42
|
+
deployed**. Refino reads and commits the copy file on that branch and
|
|
43
|
+
nowhere else.
|
|
44
|
+
- The copy file **does not have to exist yet.** `init` writes it in step 2.
|
|
45
|
+
Until the site is installed and deployed, the dashboard shows it as
|
|
46
|
+
*awaiting install*; that is the expected state, not a fault.
|
|
47
|
+
2. **Install into the repository**, passing that site id:
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
npx @getrefino/cli init --agent --yes --refino-site site_…
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
3. **Hand `.refino/AGENT_INSTRUCTIONS.md` and `.refino/plan.json` to your
|
|
54
|
+
coding agent** and let it do exactly what they say.
|
|
55
|
+
4. **Verify**: `npx @getrefino/cli verify`, fixing only what it reports.
|
|
56
|
+
5. **Commit and merge** that work onto the branch the site is configured to
|
|
57
|
+
use, and deploy it.
|
|
58
|
+
6. **Open `/edit`** on the deployed site.
|
|
59
|
+
|
|
60
|
+
If the site was connected to Refino again later — disconnected and reconnected,
|
|
61
|
+
or moved to another account — it has a new site id, and step 2 is how the
|
|
62
|
+
repository learns it. Re-run `init --agent --yes --refino-site <new id>`,
|
|
63
|
+
commit and deploy.
|
|
64
|
+
|
|
65
|
+
Without `--refino-site` the same command sets up a **self-hosted** site, which
|
|
66
|
+
holds its own editor password and repository token instead:
|
|
36
67
|
|
|
37
68
|
```bash
|
|
38
69
|
npx @getrefino/cli init --agent
|
|
@@ -55,7 +86,11 @@ npx @getrefino/cli verify
|
|
|
55
86
|
|
|
56
87
|
## If you are a coding agent
|
|
57
88
|
|
|
58
|
-
1. Run `npx @getrefino/cli init --agent
|
|
89
|
+
1. Run `npx @getrefino/cli init --agent --refino-site <site id>` in the
|
|
90
|
+
repository (the owner gets the site id from the Refino dashboard; without
|
|
91
|
+
one, `init --agent` sets up a self-hosted site instead). Add
|
|
92
|
+
`--via claude|codex|gemini|grok|other` so Refino knows which installation
|
|
93
|
+
routes work.
|
|
59
94
|
2. Read `.refino/AGENT_INSTRUCTIONS.md` and `.refino/plan.json` and do exactly
|
|
60
95
|
what they say. **They are authoritative.** They were generated from an
|
|
61
96
|
inspection of this specific repository — do not invent integration steps,
|
|
@@ -75,7 +110,11 @@ npx @getrefino/cli verify
|
|
|
75
110
|
|
|
76
111
|
Every command takes `--json` for machine-readable output and `--cwd <dir>` to
|
|
77
112
|
operate on another directory. `refino init --dry-run` shows what would be
|
|
78
|
-
written without writing anything
|
|
113
|
+
written without writing anything. No command overwrites an existing file, with
|
|
114
|
+
one exception: `init --refino-site <id>` updates the generated `refino/`
|
|
115
|
+
constants module and the `refino` block of `refino.config.json` when they still
|
|
116
|
+
name a different site, which is how a site reconnected in the Refino dashboard
|
|
117
|
+
is re-recorded. Nothing you wrote by hand is touched.
|
|
79
118
|
|
|
80
119
|
## Packages
|
|
81
120
|
|
package/dist/cli.js
CHANGED
|
@@ -6,7 +6,7 @@ import { writeFileSync } from "node:fs";
|
|
|
6
6
|
import { resolve } from "node:path";
|
|
7
7
|
import { createInterface } from "node:readline/promises";
|
|
8
8
|
import { parseArgs } from "node:util";
|
|
9
|
-
import { INSTRUCTIONS_FILE, PLAN_FILE, TOOL_VERSION, appDirectory, applyPlan, inspectRepository, planMigration, renderAgentInstructions, scanCopy, verifyIntegration, } from "@getrefino/onboarding";
|
|
9
|
+
import { INSTRUCTIONS_FILE, PLAN_FILE, TOOL_VERSION, appDirectory, applyPlan, inspectRepository, planMigration, renderAgentInstructions, resolveInstallMethod, scanCopy, verifyIntegration, } from "@getrefino/onboarding";
|
|
10
10
|
import { bold, cyan, dim, formatApply, formatCandidates, formatInspection, formatPlanSummary, formatVerification, red, yellow } from "./format.js";
|
|
11
11
|
const TAGLINE = "Refino lets site owners edit visible website copy in the browser while the repository stays the source of truth.";
|
|
12
12
|
const HELP = `refino ${TOOL_VERSION} (@getrefino/cli)
|
|
@@ -16,13 +16,25 @@ ${TAGLINE}
|
|
|
16
16
|
It is not a CMS: the copy lives in one JSON file in the repository, an edit is a
|
|
17
17
|
commit, and removing Refino leaves the content exactly where it was.
|
|
18
18
|
|
|
19
|
-
Install into a site
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
19
|
+
Install into a site, in this order
|
|
20
|
+
1. Connect the site in the Refino dashboard (https://app.refino.dev) and copy
|
|
21
|
+
its site id. You give it the repository, the branch that will carry the
|
|
22
|
+
Refino files and be deployed, and where the copy file will live. The copy
|
|
23
|
+
file does not have to exist yet.
|
|
24
|
+
2. npx @getrefino/cli init --agent --yes --refino-site <site_id>
|
|
25
|
+
inspects the repo and writes the setup files, .refino/plan.json and
|
|
26
|
+
.refino/AGENT_INSTRUCTIONS.md.
|
|
27
|
+
3. Hand those two files to your coding agent and let it do exactly what they say.
|
|
28
|
+
4. npx @getrefino/cli verify fix only what it reports; repeat until it passes
|
|
29
|
+
5. Commit and merge that work onto the branch the site is configured to use, then
|
|
30
|
+
deploy it. Refino reads and commits the copy file on that branch.
|
|
31
|
+
6. Open /edit on the deployed site.
|
|
32
|
+
|
|
33
|
+
Without --refino-site the same steps set up a self-hosted site, which holds its
|
|
34
|
+
own password and repository token instead.
|
|
23
35
|
|
|
24
36
|
Usage
|
|
25
|
-
refino init [--refino-site <id> [--refino-url <origin>]] [--route <path>]... [--all] [--agent | --dry-run | --plan] [--yes]
|
|
37
|
+
refino init [--refino-site <id> [--refino-url <origin>]] [--via <installer>] [--route <path>]... [--all] [--agent | --dry-run | --plan] [--yes]
|
|
26
38
|
refino inspect [--json]
|
|
27
39
|
refino scan [--route <path>]... [--all] [--no-shared] [--json] [--include-excluded]
|
|
28
40
|
refino plan [--route <path>]... [--all] [--format text|json|agent] [--out <file>]
|
|
@@ -38,6 +50,11 @@ Options
|
|
|
38
50
|
--refino-site <id> Connect to Refino (hosted mode): the site id from the Refino dashboard.
|
|
39
51
|
The site then needs no editor password, secret, repository token or server code.
|
|
40
52
|
--refino-url <origin> Refino app origin (default: https://app.refino.dev)
|
|
53
|
+
--via <installer> Who is doing the installation: claude, codex, gemini, grok, cli,
|
|
54
|
+
manual or other. Recorded as a public constant in the site and
|
|
55
|
+
told to Refino so it knows which installation routes work. It is
|
|
56
|
+
never guessed: without this flag (or REFINO_INSTALL_METHOD) it
|
|
57
|
+
stays "unknown".
|
|
41
58
|
--agent Write safe setup files + .refino/AGENT_INSTRUCTIONS.md
|
|
42
59
|
--dry-run Show what --agent would write without writing
|
|
43
60
|
--plan Print the plan only
|
|
@@ -46,7 +63,8 @@ Options
|
|
|
46
63
|
--run verify: also run the repository's typecheck/lint/test/build
|
|
47
64
|
|
|
48
65
|
If you are a coding agent
|
|
49
|
-
1. npx @getrefino/cli init --agent
|
|
66
|
+
1. npx @getrefino/cli init --agent --via <your name: claude, codex, gemini, grok or other>
|
|
67
|
+
(inspect, plan, write setup files + instructions)
|
|
50
68
|
2. Read .refino/AGENT_INSTRUCTIONS.md and .refino/plan.json and do exactly what they say.
|
|
51
69
|
They are authoritative: do not invent integration steps of your own.
|
|
52
70
|
3. npx @getrefino/cli verify (fix only what it reports, then run it again)
|
|
@@ -65,6 +83,7 @@ function parse(argv) {
|
|
|
65
83
|
"content-file": { type: "string" },
|
|
66
84
|
"refino-site": { type: "string" },
|
|
67
85
|
"refino-url": { type: "string" },
|
|
86
|
+
via: { type: "string" },
|
|
68
87
|
agent: { type: "boolean", default: false },
|
|
69
88
|
"dry-run": { type: "boolean", default: false },
|
|
70
89
|
plan: { type: "boolean", default: false },
|
|
@@ -88,6 +107,7 @@ function parse(argv) {
|
|
|
88
107
|
contentFile: values["content-file"],
|
|
89
108
|
refinoSite: values["refino-site"],
|
|
90
109
|
refinoUrl: values["refino-url"],
|
|
110
|
+
via: values.via,
|
|
91
111
|
agent: values.agent,
|
|
92
112
|
dryRun: values["dry-run"],
|
|
93
113
|
plan: values.plan,
|
|
@@ -110,10 +130,17 @@ function planOptions(args) {
|
|
|
110
130
|
options.includeShared = args.shared;
|
|
111
131
|
if (args.contentFile)
|
|
112
132
|
options.contentFile = args.contentFile;
|
|
113
|
-
if (args.refinoSite)
|
|
114
|
-
|
|
133
|
+
if (args.refinoSite) {
|
|
134
|
+
// Whatever the installer said, or nothing. Never inferred from the environment.
|
|
135
|
+
const installMethod = resolveInstallMethod(args.via, process.env);
|
|
136
|
+
options.refino = args.refinoUrl
|
|
137
|
+
? { siteId: args.refinoSite, appUrl: args.refinoUrl, installMethod }
|
|
138
|
+
: { siteId: args.refinoSite, installMethod };
|
|
139
|
+
}
|
|
115
140
|
else if (args.refinoUrl)
|
|
116
141
|
throw new Error("--refino-url needs --refino-site.");
|
|
142
|
+
else if (args.via)
|
|
143
|
+
throw new Error("--via needs --refino-site: it is recorded on the site connected to Refino.");
|
|
117
144
|
return options;
|
|
118
145
|
}
|
|
119
146
|
function inspect(args) {
|
package/dist/format.js
CHANGED
|
@@ -76,7 +76,12 @@ export function formatPlanSummary(plan) {
|
|
|
76
76
|
rows.push(line("Provider", `${plan.integration.provider.file ?? "?"} [${plan.integration.provider.strategy}]`));
|
|
77
77
|
rows.push(line("Endpoint", `${plan.integration.endpoint.path} [${plan.integration.endpoint.kind}]`));
|
|
78
78
|
rows.push(line("Auth", `${plan.integration.auth.strategy}${plan.integration.auth.existing.length > 0 ? ` (existing: ${plan.integration.auth.existing.join(", ")})` : ""}`));
|
|
79
|
-
|
|
79
|
+
// A connected site has no adapter and no variables of its own: Refino holds
|
|
80
|
+
// the credential and commits. Naming environment variables it will never set
|
|
81
|
+
// (the self-hosted list is empty here) read as a truncated sentence.
|
|
82
|
+
rows.push(line("Persistence", plan.refino
|
|
83
|
+
? "Refino commits to the repository (no adapter, no variables in this site)"
|
|
84
|
+
: `local file in development; GitHub via ${plan.integration.persistence.github.envVars.join(", ")}`));
|
|
80
85
|
rows.push("");
|
|
81
86
|
rows.push(bold("Copy"));
|
|
82
87
|
rows.push(line("Selected", green(String(plan.summary.selected))));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@getrefino/cli",
|
|
3
|
-
"version": "0.1.0-rc.
|
|
3
|
+
"version": "0.1.0-rc.2",
|
|
4
4
|
"description": "Refino installer. Run `npx @getrefino/cli init` in a website's repository to let its owner edit visible copy in the browser while Git remains the source of truth. Inspects the repo, writes an authoritative migration plan and instructions for a coding agent, then verifies the result.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"refino",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"./package.json": "./package.json"
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"@getrefino/onboarding": "0.1.0-rc.
|
|
48
|
+
"@getrefino/onboarding": "0.1.0-rc.2"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
51
|
"@types/node": "22.20.2",
|