layero 0.5.3 → 0.5.4
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 +1 -1
- package/dist/commands/init.js +48 -8
- package/package.json +1 -1
- package/scripts/postinstall.cjs +11 -5
package/README.md
CHANGED
|
@@ -31,7 +31,7 @@ Requires Node.js ≥ 20.
|
|
|
31
31
|
## Quick start
|
|
32
32
|
|
|
33
33
|
```bash
|
|
34
|
-
layero login #
|
|
34
|
+
layero login # device-flow: prints a URL + code, you sign in once (GitHub / Yandex)
|
|
35
35
|
cd my-site
|
|
36
36
|
layero deploy # auto-detects framework, packs, uploads, builds, ships
|
|
37
37
|
```
|
package/dist/commands/init.js
CHANGED
|
@@ -9,20 +9,60 @@ function agentDocBlock(framework) {
|
|
|
9
9
|
return `${AGENT_BLOCK_MARKER_START}
|
|
10
10
|
## Deploying with Layero
|
|
11
11
|
|
|
12
|
-
This project
|
|
12
|
+
This project deploys to https://layero.ru. To ship local changes:
|
|
13
13
|
|
|
14
14
|
\`\`\`bash
|
|
15
|
-
npx layero deploy
|
|
15
|
+
npx layero@latest deploy
|
|
16
16
|
\`\`\`
|
|
17
17
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
- Detected framework: **${framework}**.
|
|
21
|
-
- No git repository or GitHub connection is required — Layero ships the local directory directly.
|
|
18
|
+
Detected framework: **${framework}**. No git repository or GitHub connection
|
|
19
|
+
is required — Layero packs and uploads the local directory directly.
|
|
22
20
|
|
|
23
|
-
|
|
21
|
+
### First-time auth (one-click device flow)
|
|
24
22
|
|
|
25
|
-
|
|
23
|
+
The first run emits a JSON line:
|
|
24
|
+
|
|
25
|
+
\`\`\`json
|
|
26
|
+
{"event":"auth_required","url":"https://app.layero.ru/cli?code=ABCD-1234","user_code":"ABCD-1234"}
|
|
27
|
+
\`\`\`
|
|
28
|
+
|
|
29
|
+
Render the \`url\` as a clickable link in chat. The user opens it, signs in
|
|
30
|
+
(GitHub or Yandex — Layero creates the account automatically on first OAuth),
|
|
31
|
+
clicks "Разрешить доступ", and the CLI's poll loop picks up the token within
|
|
32
|
+
2 seconds. No localhost server is involved — the browser can be on a
|
|
33
|
+
different machine than the CLI.
|
|
34
|
+
|
|
35
|
+
### JSON-lines events
|
|
36
|
+
|
|
37
|
+
When run inside an agent (\`CURSOR_AGENT\`, \`CLAUDECODE\`, or any non-TTY
|
|
38
|
+
stdout), the CLI auto-switches to JSON-lines. Key events to watch:
|
|
39
|
+
|
|
40
|
+
| event | meaning |
|
|
41
|
+
|---|---|
|
|
42
|
+
| \`auth_required\` | render \`url\` as a link, keep waiting |
|
|
43
|
+
| \`detected\` | framework auto-detection result |
|
|
44
|
+
| \`project_created\` / \`project_linked\` | project bound for this directory |
|
|
45
|
+
| \`build_log\` | forward only if it contains errors |
|
|
46
|
+
| \`ready\` | \`url\` field is the live site — show to user, stop |
|
|
47
|
+
| \`error\` | follow \`next_action\` field verbatim |
|
|
48
|
+
|
|
49
|
+
Common error codes and remediation:
|
|
50
|
+
|
|
51
|
+
- \`not_logged_in\` → run \`npx layero@latest login\`
|
|
52
|
+
- \`auth_expired\` / \`auth_timeout\` → user did not approve in time, re-run login
|
|
53
|
+
- \`invalid_type\` → drop \`--type\`, rely on auto-detect
|
|
54
|
+
- \`cli_deploys_disabled\` → user must enable CLI deploys in project settings
|
|
55
|
+
- \`deploy_failed\` / \`deploy_error\` → check the dashboard URL in the message
|
|
56
|
+
|
|
57
|
+
### Re-deploys and production
|
|
58
|
+
|
|
59
|
+
Each \`npx layero deploy\` produces a new preview URL like
|
|
60
|
+
\`https://<org>-<project>-cli.layero.ru\` — safe to run repeatedly.
|
|
61
|
+
|
|
62
|
+
Add \`--prod\` only when the user explicitly asks; without it, deploys go to
|
|
63
|
+
an isolated preview branch and never replace the apex domain.
|
|
64
|
+
|
|
65
|
+
Full reference: https://docs.layero.ru/cli/agents
|
|
26
66
|
${AGENT_BLOCK_MARKER_END}
|
|
27
67
|
`;
|
|
28
68
|
}
|
package/package.json
CHANGED
package/scripts/postinstall.cjs
CHANGED
|
@@ -28,16 +28,22 @@ const c = {
|
|
|
28
28
|
green: "\x1b[32m",
|
|
29
29
|
};
|
|
30
30
|
|
|
31
|
+
// Whether the user installed globally (-g). With local/-D installs the
|
|
32
|
+
// `layero` binary isn't on PATH, so we prefix every command with `npx`
|
|
33
|
+
// in the banner so it copy-pastes correctly in both modes.
|
|
34
|
+
const useNpx = !isGlobal;
|
|
35
|
+
const cmd = (s) => (useNpx ? `npx ${s}` : s);
|
|
36
|
+
|
|
31
37
|
const lines = [
|
|
32
38
|
"",
|
|
33
39
|
`${c.green}${c.bold}✨ Layero CLI installed${c.reset}`,
|
|
34
40
|
"",
|
|
35
|
-
` ${c.cyan}layero login${c.reset} ${c.dim}
|
|
36
|
-
` ${c.cyan}layero init${c.reset} ${c.dim}scaffold .layero/ + agent docs
|
|
37
|
-
` ${c.cyan}layero deploy${c.reset} ${c.dim}
|
|
41
|
+
` ${c.cyan}${cmd("layero login")}${c.reset} ${c.dim}sign in (GitHub or Yandex)${c.reset}`,
|
|
42
|
+
` ${c.cyan}${cmd("layero init")}${c.reset} ${c.dim}scaffold .layero/ + agent docs${c.reset}`,
|
|
43
|
+
` ${c.cyan}${cmd("layero deploy")}${c.reset} ${c.dim}ship the current directory${c.reset}`,
|
|
38
44
|
"",
|
|
39
|
-
` ${c.dim}Docs:
|
|
40
|
-
` ${c.dim}
|
|
45
|
+
` ${c.dim}Docs: https://docs.layero.ru${c.reset}`,
|
|
46
|
+
` ${c.dim}Agents: https://docs.layero.ru/cli/agents${c.reset}`,
|
|
41
47
|
"",
|
|
42
48
|
];
|
|
43
49
|
const banner = lines.join("\n");
|