ezhst 1.3.4 → 1.3.5

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.
@@ -1,6 +1,7 @@
1
1
  import { json, request } from "../lib/api.js";
2
+ import { readLinkedProject, writeLinkedProject } from "../lib/config.js";
2
3
  import { resolveApp, resolveProject } from "../lib/project.js";
3
- import { confirmed, log, output } from "../lib/ui.js";
4
+ import { confirmed, fail, log, output } from "../lib/ui.js";
4
5
  export const listApps = async (options) => {
5
6
  await resolveProject(options);
6
7
  const result = await request("/apps");
@@ -22,3 +23,23 @@ export const deleteApp = async (options) => {
22
23
  const result = await request(`/apps/${app.id}`, { method: "DELETE" });
23
24
  output(result, () => log.success(`Deleted ${app.slug}`));
24
25
  };
26
+ export const renameApp = async (name, options) => {
27
+ const current = await resolveApp(options);
28
+ const { app } = await request(`/apps/${current.id}`, json("PUT", { name }));
29
+ output({ app }, () => log.success(`Renamed to ${app.name}`));
30
+ };
31
+ export const transferApp = async (options) => {
32
+ const app = await resolveApp(options);
33
+ const { projects } = await request("/projects");
34
+ const target = projects.find((project) => project.slug === options.to || project.id === options.to);
35
+ if (!target) {
36
+ return fail(`Project ${options.to} not found. List projects with \`ezhst projects list\`.`);
37
+ }
38
+ confirmed(options.yes, `Transferring ${app.slug} moves it, its deployments, environment variables and domains to ${target.slug}.`);
39
+ const result = await request(`/apps/${app.id}/transfer`, json("POST", { projectId: target.id }));
40
+ const linked = readLinkedProject();
41
+ if (linked?.appId === app.id) {
42
+ writeLinkedProject({ projectId: target.id, slug: target.slug, appId: app.id });
43
+ }
44
+ output(result, () => log.success(result.message));
45
+ };
package/dist/index.js CHANGED
@@ -2,7 +2,7 @@
2
2
  import { Command } from "commander";
3
3
  import { readFileSync } from "node:fs";
4
4
  import { forgotPassword, login, logout, register, resendVerification, verify, whoami } from "./commands/auth.js";
5
- import { createApp, deleteApp, listApps } from "./commands/apps.js";
5
+ import { createApp, deleteApp, listApps, renameApp, transferApp } from "./commands/apps.js";
6
6
  import { createProject, deleteProject, link, listProjects, logs, projectInfo, renameProject, start, stop } from "./commands/projects.js";
7
7
  import { deploy, deploymentLog, listDeployments, redeploy } from "./commands/deploy.js";
8
8
  import { importEnv, listEnv, setEnv, unsetEnv } from "./commands/env.js";
@@ -94,6 +94,12 @@ appScoped(domains.command("remove").description("Remove a domain").argument("<ho
94
94
  const apps = program.command("apps").description("Manage the apps in a project (2 per project)");
95
95
  scoped(apps.command("list").description("List apps in a project")).action(listApps);
96
96
  scoped(apps.command("create").description("Create an app").argument("<name>")).action(createApp);
97
+ appScoped(apps.command("rename").description("Rename an app").argument("<name>")).action(renameApp);
98
+ appScoped(apps
99
+ .command("transfer")
100
+ .description("Move an app to another project you own")
101
+ .requiredOption("--to <project>", "Target project slug or ID")
102
+ .option("--yes", "Confirm")).action(transferApp);
97
103
  appScoped(apps.command("delete").description("Delete one app and its deployments").option("--yes", "Confirm")).action(deleteApp);
98
104
  const billing = program.command("billing").description("Plan, usage and the Pro subscription");
99
105
  billing.command("show", { isDefault: true }).description("Show your plan, limits and usage").action(showBilling);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ezhst",
3
- "version": "1.3.4",
3
+ "version": "1.3.5",
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
@@ -12,7 +12,7 @@ Reverhost is free hosting for apps in any language, built from a Dockerfile you
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
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
- - Destructive commands (`projects delete`, `apps delete`, `storage delete`, `db delete`) need `--yes`. Only run them when the user explicitly asks.
15
+ - Destructive commands (`projects delete`, `apps delete`, `apps transfer`, `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`.
18
18
 
@@ -38,7 +38,7 @@ npx ezhst link --project <slug> --json
38
38
 
39
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 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.
41
+ 1. Inspect the repo, then always fetch the current template list from the API with `npx ezhst build dockerfile template --json` and pick the id that matches the framework. `npx ezhst build dockerfile template <id> --json` returns one template with its Dockerfile. 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
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
43
  3. The app must listen on `0.0.0.0` and `$PORT` (3000).
44
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`.
@@ -76,7 +76,7 @@ After changing env vars or build settings, run `npx ezhst redeploy --json` (rebu
76
76
 
77
77
  Projects and runtime:
78
78
  - `projects list | info | rename <name> | delete --yes`, `projects create <name> [--link]`, `link --project <slug>`
79
- - `apps list | create <name> | delete --yes`
79
+ - `apps list | create <name> | rename <name> | transfer --to <project-slug> --yes | delete --yes` (transfer moves an app to another project you own; only when the user asks)
80
80
  - `deploy [--verbose] [--app <slug>]`, `redeploy`, `start`, `stop`
81
81
  - `logs [--tail 200]` runtime logs
82
82
  - `deployments list`, `deployments log [deploymentId]` build logs
@@ -114,6 +114,6 @@ Billing:
114
114
 
115
115
  ## Limits
116
116
 
117
- Free: 3 projects. Pro ($10/mo): 10 projects and the AI token balance topped up to 1,000 every month. Per project on both: 2 apps, one bucket (256 MB) and one database (128 MB). One build at a time; 512 MB RAM and 1 CPU per app. A full bucket rejects uploads; a database over its size is blocked and the project's apps stop.
117
+ Free: 3 projects. Pro ($10/mo): 10 projects and the AI token balance topped up to 500 every month. Per project on both: 2 apps, one bucket (256 MB) and one database (128 MB). One build at a time; 512 MB RAM and 1 CPU per app. A full bucket rejects uploads; a database over its size is blocked and the project's apps stop.
118
118
 
119
119
  Docs: https://reverhost.com/docs