ezhst 1.3.2 → 1.3.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.
@@ -76,9 +76,9 @@ export const setDockerfile = async (options) => {
76
76
  export const dockerfileTemplate = async (id, options) => {
77
77
  const templates = await listTemplates();
78
78
  if (!id) {
79
- output({ templates: templates.map((template) => ({ id: template.id, label: template.label })) }, () => {
79
+ output({ templates: templates.map((template) => ({ id: template.id, group: template.group, label: template.label })) }, () => {
80
80
  for (const template of templates) {
81
- log.info(`${template.id.padEnd(8)} ${template.label}`);
81
+ log.info(`${template.id.padEnd(14)} ${template.group.padEnd(9)} ${template.label}`);
82
82
  }
83
83
  });
84
84
  return;
@@ -99,20 +99,32 @@ export const ensureDockerfile = async (project) => {
99
99
  if (project.dockerfile) {
100
100
  return project;
101
101
  }
102
- const hint = "This app has no Dockerfile. Write one and run `ezhst build dockerfile set -f Dockerfile`, or start from a template with `ezhst build dockerfile template <id> --apply`.";
102
+ const hint = "This app has no Dockerfile. Pipe one in with `ezhst build dockerfile set -f -`, or start from a template with `ezhst build dockerfile template <id> --apply`.";
103
103
  if (!isInteractive()) {
104
104
  fail(hint);
105
105
  }
106
106
  const templates = await listTemplates();
107
- const choice = await select({
107
+ const groups = [...new Set(templates.map((template) => template.group))];
108
+ const group = await select({
108
109
  message: "This app has no Dockerfile. Start from a template?",
109
- choices: [...templates.map((template) => ({ name: template.label, value: template.id })), { name: "Cancel", value: "" }],
110
+ choices: [...groups.map((name) => ({ name, value: name })), { name: "Cancel", value: "" }],
110
111
  });
112
+ const options = templates.filter((item) => item.group === group);
113
+ let choice = "";
114
+ if (options.length === 1) {
115
+ choice = options[0].id;
116
+ }
117
+ else if (options.length > 1) {
118
+ choice = await select({
119
+ message: "Which framework?",
120
+ choices: options.map((template) => ({ name: template.label, value: template.id })),
121
+ });
122
+ }
111
123
  const template = templates.find((item) => item.id === choice);
112
124
  if (!template) {
113
125
  return fail(hint);
114
126
  }
115
127
  const app = await saveSettings(project, { dockerfile: template.content });
116
- log.success(`${template.label} Dockerfile saved. Edit it later with \`ezhst build dockerfile set -f <file>\`.`);
128
+ log.success(`${template.label} Dockerfile saved. Edit it later in the Build tab or with \`ezhst build dockerfile set -f -\`.`);
117
129
  return app;
118
130
  };
@@ -25,7 +25,7 @@ const IGNORED_DIRS = new Set([
25
25
  ".zig-cache",
26
26
  "zig-cache",
27
27
  ]);
28
- const IGNORED_FILES = new Set([".DS_Store", ".easyhost.json"]);
28
+ const IGNORED_FILES = new Set([".DS_Store", ".reverhost.json"]);
29
29
  const isIgnored = (entry) => {
30
30
  const parts = entry.replace(/^\.\//, "").split("/");
31
31
  if (parts.some((part) => IGNORED_DIRS.has(part))) {
@@ -38,7 +38,7 @@ const isIgnored = (entry) => {
38
38
  return name.startsWith(".env") && name !== ".env.example";
39
39
  };
40
40
  const packSource = async (cwd) => {
41
- const stage = mkdtempSync(path.join(tmpdir(), "easyhost-"));
41
+ const stage = mkdtempSync(path.join(tmpdir(), "reverhost-"));
42
42
  const archive = path.join(stage, "app.tgz");
43
43
  await tar.create({ gzip: true, cwd, file: archive, portable: true, filter: (entry) => !isIgnored(entry) }, ["."]);
44
44
  return { stage, archive };
@@ -41,7 +41,7 @@ export const installSkill = async (options) => {
41
41
  if (scope === "global") {
42
42
  base = homedir();
43
43
  }
44
- const directory = path.join(base, agent.folder, "skills", "easyhost");
44
+ const directory = path.join(base, agent.folder, "skills", "reverhost");
45
45
  const target = path.join(directory, "SKILL.md");
46
46
  mkdirSync(directory, { recursive: true });
47
47
  copyFileSync(SKILL_SOURCE, target);
@@ -1,9 +1,9 @@
1
1
  import { existsSync, mkdirSync, readFileSync, rmSync, writeFileSync } from "node:fs";
2
2
  import { homedir } from "node:os";
3
3
  import path from "node:path";
4
- const CONFIG_DIR = path.join(homedir(), ".easyhost");
4
+ const CONFIG_DIR = path.join(homedir(), ".reverhost");
5
5
  const CONFIG_FILE = path.join(CONFIG_DIR, "config.json");
6
- const PROJECT_FILE = ".easyhost.json";
6
+ const PROJECT_FILE = ".reverhost.json";
7
7
  const PRODUCTION_API_URL = "https://api.reverhost.com";
8
8
  export const readConfig = () => {
9
9
  let config = { apiUrl: PRODUCTION_API_URL };
@@ -37,7 +37,7 @@ export const linkProject = async (slug) => {
37
37
  return fail("Missing --project <slug>. List projects with `ezhst projects list`.");
38
38
  }
39
39
  writeLinkedProject({ projectId: project.id, slug: project.slug });
40
- log.dim("Saved project link in .easyhost.json");
40
+ log.dim("Saved project link in .reverhost.json");
41
41
  return project;
42
42
  };
43
43
  export const resolveProject = async (options) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ezhst",
3
- "version": "1.3.2",
3
+ "version": "1.3.4",
4
4
  "description": "Reverhost CLI: agent-first hosting for Node.js apps with storage and databases",
5
5
  "type": "module",
6
6
  "bin": {
package/skill/SKILL.md CHANGED
@@ -1,5 +1,5 @@
1
1
  ---
2
- name: easyhost
2
+ name: reverhost
3
3
  description: Deploy and manage apps on Reverhost (free hosting) with the ezhst CLI. Use when the user asks to deploy, host, publish or ship an app (any language, built from a Dockerfile) to Reverhost, or to manage its environment variables, build settings, logs, custom domains, S3 storage or Postgres database.
4
4
  ---
5
5
 
@@ -11,7 +11,7 @@ Reverhost is free hosting for apps in any language, built from a Dockerfile you
11
11
 
12
12
  - Always pass `--json` and parse stdout. Progress and hints go to stderr. On failure the process exits with code 1 and prints `{"error": "..."}`.
13
13
  - The CLI never prompts without a TTY. Pass every value as a flag.
14
- - Commands that act on a project use the project linked in `.easyhost.json`, or `--project <slug>`. App commands also use `--app <slug-or-id>` or the linked app. With multiple apps, select one explicitly.
14
+ - Commands that act on a project use the project linked in `.reverhost.json`, or `--project <slug>`. App commands also use `--app <slug-or-id>` or the linked app. With multiple apps, select one explicitly.
15
15
  - Destructive commands (`projects delete`, `apps delete`, `storage delete`, `db delete`) need `--yes`. Only run them when the user explicitly asks.
16
16
  - Never print secrets (passwords, S3 secret keys, connection strings) back to the user unless they ask. Put them in env vars with `ezhst env set` instead.
17
17
  - `.env` files are never uploaded. Environment variables must be set with `ezhst env set` or `ezhst env import .env`.
@@ -36,19 +36,23 @@ npx ezhst link --project <slug> --json
36
36
 
37
37
  ## 3. Deploy
38
38
 
39
- Every app builds from a Dockerfile stored on the app (a Dockerfile in the repo is ignored, so upload it explicitly). Run inside the app folder:
39
+ Every app builds from a Dockerfile stored on the app, not from a file in the repo. Never create, edit or upload a `Dockerfile` file in the user's project. Always write the Dockerfile straight to the app through the CLI. Run inside the app folder:
40
40
 
41
- 1. Inspect the repo and write a `Dockerfile` (start from `npx ezhst build dockerfile template <id>`; ids: node, bun, python, go, ruby, php, rust, zig).
42
- 2. The app must listen on `0.0.0.0` and `$PORT` (3000).
43
- 3. Env vars are runtime env. If the build step needs them, use `RUN --mount=type=secret,id=appenv,target=/run/secrets/appenv sh -c 'set -a; . /run/secrets/appenv; set +a; <build command>'`. Never put secrets in `ARG` or `ENV`.
44
- 4. Keep the image under 1 GB (slim bases, multi-stage builds for compiled languages). Containers get 256 MB of memory and half a CPU.
45
- 5. Do not use `# syntax=` lines or images from the Reverhost registry; they are rejected.
41
+ 1. Inspect the repo and pick a template: `npx ezhst build dockerfile template --json` lists them, `npx ezhst build dockerfile template <id> --json` returns one. Ids include node, express, nestjs, nextjs, nuxt, sveltekit, react-router, astro, bun, elysia, fastapi, flask, django, streamlit, rails, ruby, laravel, php, go, rust, zig, vite, static. A Dockerfile already in the repo is only a reference: read it, adapt it, and send the result through the CLI like any other.
42
+ 2. Adapt the template to the repo, then save it to the app by piping it through stdin with a quoted heredoc (`<<'EOF'`, so the shell does not expand `$PORT` or `$(...)`). If the template fits unchanged, `npx ezhst build dockerfile template <id> --apply --json` saves it directly.
43
+ 3. The app must listen on `0.0.0.0` and `$PORT` (3000).
44
+ 4. Env vars are runtime env. If the build step needs them, use `RUN --mount=type=secret,id=appenv,target=/run/secrets/appenv sh -c 'set -a; . /run/secrets/appenv; set +a; <build command>'`. Never put secrets in `ARG` or `ENV`.
45
+ 5. Keep the image under 1 GB (slim bases, multi-stage builds for compiled languages). Containers get 256 MB of memory and half a CPU. Download toolchains from fast sources (package managers, official images); a slow download is billed build time and builds stop after 20 minutes.
46
+ 6. Do not use `# syntax=` lines or images from the Reverhost registry; they are rejected.
46
47
 
47
48
  ```
48
49
  npx ezhst apps create <name> --project <project-slug> --json
49
50
  npx ezhst link --project <project-slug> --app <app-slug> --json
50
51
  npx ezhst env import .env --json
51
- npx ezhst build dockerfile set -f Dockerfile --json
52
+ npx ezhst build dockerfile set -f - --json <<'EOF'
53
+ FROM node:22-alpine
54
+ ...
55
+ EOF
52
56
  npx ezhst deploy --json
53
57
  ```
54
58
 
@@ -62,7 +66,7 @@ Common fixes:
62
66
  - Missing env var at build time: `ezhst env set KEY=VALUE`, then `ezhst redeploy`.
63
67
  - `npm ci` says the lockfile is out of sync: delete `node_modules` and `package-lock.json`, run `npm install`, deploy again.
64
68
  - Monorepo: `ezhst build set --root-dir apps/web`.
65
- - Build fails: fix the Dockerfile, `ezhst build dockerfile set -f Dockerfile`, then `ezhst redeploy` (rebuilds the last upload, even a failed one).
69
+ - Build fails: read the stored Dockerfile with `ezhst build dockerfile show --json`, fix it, send it back with `ezhst build dockerfile set -f - <<'EOF'`, then `ezhst redeploy` (rebuilds the last upload, even a failed one).
66
70
  - App starts but the URL fails: it is not listening on `0.0.0.0:$PORT`.
67
71
  - Daily build limit reached (10 per day on Free, 50 on Pro): wait or upgrade; do not loop deploys.
68
72
 
@@ -80,7 +84,7 @@ Projects and runtime:
80
84
  Environment and build:
81
85
  - `env list | set KEY=VALUE... | unset KEY... | import <file>`
82
86
  - `build show`, `build set --root-dir <dir>` (build context, `""` for the project root), `build reset`
83
- - `build dockerfile show`, `build dockerfile set -f <file>` (`-` reads stdin), `build dockerfile template [id] [--apply]`
87
+ - `build dockerfile show`, `build dockerfile set -f -` (reads stdin; agents always use this), `build dockerfile template [id] [--apply]`
84
88
 
85
89
  Custom domains:
86
90
  - `domains list | add <hostname> | verify <hostname> | remove <hostname>`