ezhst 1.0.0 → 1.3.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/dist/commands/auth.js +35 -5
- package/dist/commands/members.js +71 -0
- package/dist/commands/projects.js +1 -1
- package/dist/commands/skill.js +18 -5
- package/dist/index.js +18 -8
- package/dist/lib/api.js +13 -1
- package/package.json +1 -1
- package/skill/SKILL.md +12 -11
package/dist/commands/auth.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { input, password } from "@inquirer/prompts";
|
|
2
|
-
import { json, request } from "../lib/api.js";
|
|
2
|
+
import { ApiError, json, request } from "../lib/api.js";
|
|
3
3
|
import { clearConfig, readConfig, writeConfig } from "../lib/config.js";
|
|
4
|
-
import { log, output, required } from "../lib/ui.js";
|
|
4
|
+
import { isInteractive, log, output, required } from "../lib/ui.js";
|
|
5
5
|
const apiUrlFrom = (api) => (api ?? readConfig().apiUrl).replace(/\/$/, "");
|
|
6
6
|
const askEmail = () => input({ message: "Email" });
|
|
7
7
|
const askPassword = () => password({ message: "Password", mask: "*" });
|
|
@@ -9,11 +9,35 @@ const saveSession = (apiUrl, token, user, message) => {
|
|
|
9
9
|
writeConfig({ apiUrl, token });
|
|
10
10
|
output({ user, token }, () => {
|
|
11
11
|
log.success(`${message} ${user.name} <${user.email}>`);
|
|
12
|
-
if (!user.verified) {
|
|
13
|
-
log.warn("Verify your email
|
|
12
|
+
if (!user.verified && !isInteractive()) {
|
|
13
|
+
log.warn("Verify your email before using EasyHost: run `ezhst verify <code>` with the 6-digit code we emailed you.");
|
|
14
14
|
}
|
|
15
15
|
});
|
|
16
16
|
};
|
|
17
|
+
const askForCode = async (user) => {
|
|
18
|
+
if (user.verified || !isInteractive()) {
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
log.info(`We emailed a 6-digit code to ${user.email}. Enter it to finish (press Enter to skip for now).`);
|
|
22
|
+
while (true) {
|
|
23
|
+
const code = (await input({ message: "Verification code" })).trim();
|
|
24
|
+
if (!code) {
|
|
25
|
+
log.warn("Skipped. Run `ezhst verify <code>` before using other commands.");
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
try {
|
|
29
|
+
const result = await request("/auth/verify-email", json("POST", { code }));
|
|
30
|
+
log.success(result.message);
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
catch (error) {
|
|
34
|
+
if (!(error instanceof ApiError)) {
|
|
35
|
+
throw error;
|
|
36
|
+
}
|
|
37
|
+
log.error(error.message);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
};
|
|
17
41
|
export const register = async (options) => {
|
|
18
42
|
const apiUrl = apiUrlFrom(options.api);
|
|
19
43
|
writeConfig({ apiUrl });
|
|
@@ -22,6 +46,7 @@ export const register = async (options) => {
|
|
|
22
46
|
const secret = await required(options.password, "--password", askPassword);
|
|
23
47
|
const { token, user } = await request("/auth/register", json("POST", { name, email, password: secret }));
|
|
24
48
|
saveSession(apiUrl, token, user, "Account created for");
|
|
49
|
+
await askForCode(user);
|
|
25
50
|
};
|
|
26
51
|
export const login = async (options) => {
|
|
27
52
|
const apiUrl = apiUrlFrom(options.api);
|
|
@@ -30,6 +55,7 @@ export const login = async (options) => {
|
|
|
30
55
|
const secret = await required(options.password, "--password", askPassword);
|
|
31
56
|
const { token, user } = await request("/auth/login", json("POST", { email, password: secret }));
|
|
32
57
|
saveSession(apiUrl, token, user, "Logged in as");
|
|
58
|
+
await askForCode(user);
|
|
33
59
|
};
|
|
34
60
|
export const logout = () => {
|
|
35
61
|
clearConfig();
|
|
@@ -41,11 +67,15 @@ export const whoami = async () => {
|
|
|
41
67
|
output({ user, apiUrl }, () => {
|
|
42
68
|
log.info(`${user.name} <${user.email}>`);
|
|
43
69
|
if (!user.verified) {
|
|
44
|
-
log.warn("Email not verified");
|
|
70
|
+
log.warn("Email not verified. Run `ezhst verify <code>`.");
|
|
45
71
|
}
|
|
46
72
|
log.dim(apiUrl);
|
|
47
73
|
});
|
|
48
74
|
};
|
|
75
|
+
export const verify = async (code) => {
|
|
76
|
+
const result = await request("/auth/verify-email", json("POST", { code }));
|
|
77
|
+
output(result, () => log.success(result.message));
|
|
78
|
+
};
|
|
49
79
|
export const resendVerification = async () => {
|
|
50
80
|
const result = await request("/auth/resend-verification", { method: "POST" });
|
|
51
81
|
output(result, () => log.success(result.message));
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import pc from "picocolors";
|
|
2
|
+
import { json, request } from "../lib/api.js";
|
|
3
|
+
import { resolveProject } from "../lib/project.js";
|
|
4
|
+
import { confirmed, fail, log, output } from "../lib/ui.js";
|
|
5
|
+
const fetchMembers = async (options) => {
|
|
6
|
+
const project = await resolveProject(options);
|
|
7
|
+
const data = await request("/members", {}, project.id);
|
|
8
|
+
return { project, data };
|
|
9
|
+
};
|
|
10
|
+
const inviteToken = (value) => {
|
|
11
|
+
const trimmed = value.trim().replace(/\/+$/, "");
|
|
12
|
+
return trimmed.slice(trimmed.lastIndexOf("/") + 1);
|
|
13
|
+
};
|
|
14
|
+
export const listMembers = async (options) => {
|
|
15
|
+
const { data } = await fetchMembers(options);
|
|
16
|
+
output(data, () => {
|
|
17
|
+
log.info(`${pc.bold(data.owner.name.padEnd(24))} ${data.owner.email.padEnd(32)} ${pc.dim("owner")}`);
|
|
18
|
+
for (const member of data.members) {
|
|
19
|
+
log.info(`${pc.bold(member.name.padEnd(24))} ${member.email.padEnd(32)} ${pc.dim("member")}`);
|
|
20
|
+
}
|
|
21
|
+
for (const invite of data.invites) {
|
|
22
|
+
let status = `invited, expires ${invite.expiresAt}`;
|
|
23
|
+
if (invite.expired) {
|
|
24
|
+
status = "invite expired";
|
|
25
|
+
}
|
|
26
|
+
log.info(`${"".padEnd(24)} ${invite.email.padEnd(32)} ${pc.dim(status)}`);
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
};
|
|
30
|
+
export const inviteMember = async (email, options) => {
|
|
31
|
+
const project = await resolveProject(options);
|
|
32
|
+
const result = await request("/members/invites", json("POST", { email }), project.id);
|
|
33
|
+
output(result, () => {
|
|
34
|
+
log.success(result.message);
|
|
35
|
+
log.info(`Invite link: ${result.url}`);
|
|
36
|
+
});
|
|
37
|
+
};
|
|
38
|
+
export const revokeInvite = async (email, options) => {
|
|
39
|
+
const { project, data } = await fetchMembers(options);
|
|
40
|
+
const invite = data.invites.find((item) => item.email === email.trim().toLowerCase());
|
|
41
|
+
if (!invite) {
|
|
42
|
+
return fail(`No pending invite for ${email}.`);
|
|
43
|
+
}
|
|
44
|
+
const result = await request(`/members/invites/${invite.id}`, { method: "DELETE" }, project.id);
|
|
45
|
+
output(result, () => log.success(result.message));
|
|
46
|
+
};
|
|
47
|
+
export const removeMember = async (email, options) => {
|
|
48
|
+
const { project, data } = await fetchMembers(options);
|
|
49
|
+
const member = data.members.find((item) => item.email.toLowerCase() === email.trim().toLowerCase());
|
|
50
|
+
if (!member) {
|
|
51
|
+
return fail(`${email} is not a member of this project.`);
|
|
52
|
+
}
|
|
53
|
+
confirmed(options.yes, `Removing ${member.email} takes away their access to ${project.name}.`);
|
|
54
|
+
const result = await request(`/members/${member.id}`, { method: "DELETE" }, project.id);
|
|
55
|
+
output(result, () => log.success(result.message));
|
|
56
|
+
};
|
|
57
|
+
export const leaveProject = async (options) => {
|
|
58
|
+
const project = await resolveProject(options);
|
|
59
|
+
const { user } = await request("/auth/me");
|
|
60
|
+
confirmed(options.yes, `Leaving ${project.name} removes your access until the owner invites you again.`);
|
|
61
|
+
const result = await request(`/members/${user.id}`, { method: "DELETE" }, project.id);
|
|
62
|
+
output(result, () => log.success(result.message));
|
|
63
|
+
};
|
|
64
|
+
export const acceptInvite = async (tokenOrUrl) => {
|
|
65
|
+
const token = inviteToken(tokenOrUrl);
|
|
66
|
+
const result = await request(`/invites/${token}/accept`, { method: "POST" });
|
|
67
|
+
output(result, () => {
|
|
68
|
+
log.success(result.message);
|
|
69
|
+
log.info(`Use it with \`--project ${result.project.slug}\` or \`ezhst link --project ${result.project.slug}\`.`);
|
|
70
|
+
});
|
|
71
|
+
};
|
|
@@ -10,7 +10,7 @@ export const listProjects = async () => {
|
|
|
10
10
|
log.info("No projects yet. Create one with `ezhst projects create <name>`.");
|
|
11
11
|
}
|
|
12
12
|
for (const project of projects) {
|
|
13
|
-
log.info(`${pc.bold(project.slug.padEnd(40))} ${project.name}`);
|
|
13
|
+
log.info(`${pc.bold(project.slug.padEnd(40))} ${project.name.padEnd(28)} ${pc.dim(project.role ?? "")}`);
|
|
14
14
|
}
|
|
15
15
|
});
|
|
16
16
|
};
|
package/dist/commands/skill.js
CHANGED
|
@@ -5,10 +5,23 @@ import path from "node:path";
|
|
|
5
5
|
import { fileURLToPath } from "node:url";
|
|
6
6
|
import { fail, log, output, required } from "../lib/ui.js";
|
|
7
7
|
const SKILL_SOURCE = fileURLToPath(new URL("../../skill/SKILL.md", import.meta.url));
|
|
8
|
+
const AGENTS = {
|
|
9
|
+
claude: { name: "Claude Code", folder: ".claude" },
|
|
10
|
+
codex: { name: "Codex", folder: ".agents" },
|
|
11
|
+
cursor: { name: "Cursor", folder: ".cursor" },
|
|
12
|
+
};
|
|
8
13
|
export const installSkill = async (options) => {
|
|
14
|
+
if (options.agent !== undefined && !(options.agent in AGENTS)) {
|
|
15
|
+
return fail(`Unknown agent "${options.agent}". Use one of: ${Object.keys(AGENTS).join(", ")}.`);
|
|
16
|
+
}
|
|
9
17
|
if (options.global && options.local) {
|
|
10
18
|
return fail("Choose either --global or --local, not both.");
|
|
11
19
|
}
|
|
20
|
+
const agentKey = await required(options.agent, "--agent <claude|codex|cursor>", () => select({
|
|
21
|
+
message: "Which agent should get the skill?",
|
|
22
|
+
choices: Object.entries(AGENTS).map(([value, agent]) => ({ name: agent.name, value })),
|
|
23
|
+
}));
|
|
24
|
+
const agent = AGENTS[agentKey];
|
|
12
25
|
let scope;
|
|
13
26
|
if (options.global) {
|
|
14
27
|
scope = "global";
|
|
@@ -20,20 +33,20 @@ export const installSkill = async (options) => {
|
|
|
20
33
|
message: "Where should the skill be installed?",
|
|
21
34
|
default: "local",
|
|
22
35
|
choices: [
|
|
23
|
-
{ name:
|
|
24
|
-
{ name:
|
|
36
|
+
{ name: `Global (~/${agent.folder}/skills, all projects)`, value: "global" },
|
|
37
|
+
{ name: `Local (${agent.folder}/skills, current project)`, value: "local" },
|
|
25
38
|
],
|
|
26
39
|
}));
|
|
27
40
|
let base = process.cwd();
|
|
28
41
|
if (scope === "global") {
|
|
29
42
|
base = homedir();
|
|
30
43
|
}
|
|
31
|
-
const directory = path.join(base,
|
|
44
|
+
const directory = path.join(base, agent.folder, "skills", "easyhost");
|
|
32
45
|
const target = path.join(directory, "SKILL.md");
|
|
33
46
|
mkdirSync(directory, { recursive: true });
|
|
34
47
|
copyFileSync(SKILL_SOURCE, target);
|
|
35
|
-
output({ path: target }, () => {
|
|
36
|
-
log.success(`Installed the EasyHost skill at ${target}`);
|
|
48
|
+
output({ agent: agentKey, scope, path: target }, () => {
|
|
49
|
+
log.success(`Installed the EasyHost skill for ${agent.name} at ${target}`);
|
|
37
50
|
log.info('Ask your agent: "Deploy this app to EasyHost."');
|
|
38
51
|
});
|
|
39
52
|
};
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { Command } from "commander";
|
|
3
3
|
import { readFileSync } from "node:fs";
|
|
4
|
-
import { forgotPassword, login, logout, register, resendVerification, whoami } from "./commands/auth.js";
|
|
4
|
+
import { forgotPassword, login, logout, register, resendVerification, verify, whoami } from "./commands/auth.js";
|
|
5
5
|
import { createApp, deleteApp, listApps } from "./commands/apps.js";
|
|
6
6
|
import { createSchedule, deleteSchedule, listSchedules, scheduleLogs, setScheduleState, updateSchedule } from "./commands/schedules.js";
|
|
7
7
|
import { createProject, deleteProject, link, listProjects, logs, projectInfo, renameProject, start, stop } from "./commands/projects.js";
|
|
@@ -13,6 +13,7 @@ import { createStorage, deleteStorage, downloadStorage, listStorage, removeStora
|
|
|
13
13
|
import { createDatabase, databaseInfo, deleteDatabase, queryDatabase, resetDatabasePassword, tableRows } from "./commands/db.js";
|
|
14
14
|
import { createSender, deleteSender, emailInfo, emailLogs, sendEmail } from "./commands/email.js";
|
|
15
15
|
import { createKey, listKeys, revokeKey } from "./commands/keys.js";
|
|
16
|
+
import { acceptInvite, inviteMember, leaveProject, listMembers, removeMember, revokeInvite } from "./commands/members.js";
|
|
16
17
|
import { installSkill } from "./commands/skill.js";
|
|
17
18
|
import { fail, setJsonMode } from "./lib/ui.js";
|
|
18
19
|
const packageMetadata = JSON.parse(readFileSync(new URL("../package.json", import.meta.url), "utf8"));
|
|
@@ -22,7 +23,7 @@ if (!packageMetadata || typeof packageMetadata !== "object" || !("version" in pa
|
|
|
22
23
|
const program = new Command();
|
|
23
24
|
program
|
|
24
25
|
.name("ezhst")
|
|
25
|
-
.description("EasyHost from the terminal: deploy apps and manage storage
|
|
26
|
+
.description("EasyHost from the terminal: deploy apps and manage storage and databases")
|
|
26
27
|
.version(packageMetadata.version)
|
|
27
28
|
.option("--json", "Print machine-readable JSON")
|
|
28
29
|
.hook("preAction", (_command, action) => {
|
|
@@ -47,7 +48,8 @@ program
|
|
|
47
48
|
.action(login);
|
|
48
49
|
program.command("logout").description("Log out").action(logout);
|
|
49
50
|
program.command("whoami").description("Show the logged in user").action(whoami);
|
|
50
|
-
program.command("
|
|
51
|
+
program.command("verify").description("Verify your email with the 6-digit code").argument("<code>").action(verify);
|
|
52
|
+
program.command("resend-verification").description("Email a new verification code").action(resendVerification);
|
|
51
53
|
program.command("forgot-password").description("Email a password reset link").option("--email <email>").action(forgotPassword);
|
|
52
54
|
const projects = program.command("projects").description("Manage projects");
|
|
53
55
|
projects.command("list").description("List projects").action(listProjects);
|
|
@@ -90,7 +92,7 @@ appScoped(domains.command("list").description("List domains and the DNS target")
|
|
|
90
92
|
appScoped(domains.command("add").description("Add a domain").argument("<hostname>")).action(addDomain);
|
|
91
93
|
appScoped(domains.command("verify").description("Check DNS and issue HTTPS").argument("<hostname>")).action(verifyDomain);
|
|
92
94
|
appScoped(domains.command("remove").description("Remove a domain").argument("<hostname>")).action(removeDomain);
|
|
93
|
-
const apps = program.command("apps").description("Manage up to
|
|
95
|
+
const apps = program.command("apps").description("Manage up to three apps per project");
|
|
94
96
|
scoped(apps.command("list").description("List apps in a project")).action(listApps);
|
|
95
97
|
scoped(apps.command("create").description("Create an app").argument("<name>")).action(createApp);
|
|
96
98
|
appScoped(apps.command("delete").description("Delete one app and its deployments").option("--yes", "Confirm")).action(deleteApp);
|
|
@@ -125,7 +127,7 @@ scoped(db.command("query").description("Run SQL").argument("[sql]").option("--fi
|
|
|
125
127
|
scoped(db.command("rows").description("Browse a table").argument("<table>").option("--page <n>", "Page", "1")).action(tableRows);
|
|
126
128
|
scoped(db.command("reset-password").description("Rotate the database password")).action(resetDatabasePassword);
|
|
127
129
|
scoped(db.command("delete").description("Delete the database and its data").option("--yes", "Confirm")).action(deleteDatabase);
|
|
128
|
-
const email = program.command("email").description("Transactional email");
|
|
130
|
+
const email = program.command("email", { hidden: true }).description("Transactional email (coming soon)");
|
|
129
131
|
scoped(email.command("info").description("Show the sender address and usage")).action(emailInfo);
|
|
130
132
|
const sender = email.command("sender").description("Sender address");
|
|
131
133
|
scoped(sender.command("create").description("Create <username>@easyhost.fun").argument("<username>")).action(createSender);
|
|
@@ -139,16 +141,24 @@ scoped(email
|
|
|
139
141
|
.option("--text <body>")
|
|
140
142
|
.option("--html <html>")).action(sendEmail);
|
|
141
143
|
scoped(email.command("logs").description("Show sent emails").option("--page <n>", "Page", "1")).action(emailLogs);
|
|
142
|
-
const keys = program.command("keys").description("API keys for the HTTP API");
|
|
144
|
+
const keys = program.command("keys", { hidden: true }).description("API keys for the HTTP API");
|
|
143
145
|
scoped(keys.command("list").description("List API keys")).action(listKeys);
|
|
144
146
|
scoped(keys.command("create").description("Create an API key").argument("<name>")).action(createKey);
|
|
145
147
|
scoped(keys.command("revoke").description("Revoke an API key").argument("<id>")).action(revokeKey);
|
|
148
|
+
const members = program.command("members").description("Project members and invites");
|
|
149
|
+
scoped(members.command("list").description("List the owner, members and pending invites")).action(listMembers);
|
|
150
|
+
scoped(members.command("invite").description("Invite someone by email (owner only)").argument("<email>")).action(inviteMember);
|
|
151
|
+
scoped(members.command("revoke").description("Revoke a pending invite (owner only)").argument("<email>")).action(revokeInvite);
|
|
152
|
+
scoped(members.command("remove").description("Remove a member (owner only)").argument("<email>").option("--yes", "Confirm")).action(removeMember);
|
|
153
|
+
scoped(members.command("leave").description("Leave a project you were invited to").option("--yes", "Confirm")).action(leaveProject);
|
|
154
|
+
program.command("accept-invite").description("Accept a project invite").argument("<token-or-url>", "Invite link or token from the email").action(acceptInvite);
|
|
146
155
|
const skill = program.command("skill").description("Agent skill");
|
|
147
156
|
skill
|
|
148
157
|
.command("install")
|
|
149
158
|
.description("Install the EasyHost agent skill")
|
|
150
|
-
.option("--
|
|
151
|
-
.option("--
|
|
159
|
+
.option("--agent <agent>", "Target agent: claude, codex or cursor")
|
|
160
|
+
.option("--global", "Install to the agent's home skills folder for all projects")
|
|
161
|
+
.option("--local", "Install to the agent's skills folder in the current project")
|
|
152
162
|
.action(installSkill);
|
|
153
163
|
program.parseAsync().catch((error) => {
|
|
154
164
|
if (error?.name === "ExitPromptError") {
|
package/dist/lib/api.js
CHANGED
|
@@ -29,7 +29,19 @@ export const request = async (pathname, init = {}, projectId) => {
|
|
|
29
29
|
if (res.status === 401 && !pathname.startsWith("/auth/")) {
|
|
30
30
|
throw new ApiError("Not logged in. Run `ezhst login` or set EZHST_TOKEN.", 401);
|
|
31
31
|
}
|
|
32
|
-
|
|
32
|
+
if (data.code === "EMAIL_NOT_VERIFIED") {
|
|
33
|
+
throw new ApiError("Your email is not verified. Run `ezhst verify <code>` with the 6-digit code from your inbox, or `ezhst resend-verification` to get a new code.", res.status);
|
|
34
|
+
}
|
|
35
|
+
if (data.code === "EMAIL_COMING_SOON") {
|
|
36
|
+
throw new ApiError("Email is coming soon. It is not available on EasyHost yet.", res.status);
|
|
37
|
+
}
|
|
38
|
+
if (typeof data.error === "string") {
|
|
39
|
+
throw new ApiError(data.error, res.status);
|
|
40
|
+
}
|
|
41
|
+
if (res.status >= 500) {
|
|
42
|
+
throw new ApiError(`EasyHost is having trouble right now (status ${res.status}). Try again in a minute.`, res.status);
|
|
43
|
+
}
|
|
44
|
+
throw new ApiError(`Request failed with status ${res.status}.`, res.status);
|
|
33
45
|
}
|
|
34
46
|
return data;
|
|
35
47
|
};
|
package/package.json
CHANGED
package/skill/SKILL.md
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: easyhost
|
|
3
|
-
description: Deploy and manage apps on EasyHost (free hosting) with the ezhst CLI. Use when the user asks to deploy, host, publish or ship a Node.js app to EasyHost, or to manage its environment variables, build settings, logs, custom domains, S3 storage
|
|
3
|
+
description: Deploy and manage apps on EasyHost (free hosting) with the ezhst CLI. Use when the user asks to deploy, host, publish or ship a Node.js app to EasyHost, or to manage its environment variables, build settings, logs, custom domains, S3 storage or Postgres database.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# EasyHost
|
|
7
7
|
|
|
8
|
-
EasyHost is free hosting for Node.js apps with built-in S3 storage
|
|
8
|
+
EasyHost is free hosting for Node.js apps with built-in S3 storage and Postgres (email is coming soon). It is in beta. Everything is done through the `ezhst` CLI. Run it with `npx ezhst <command>` (or `ezhst` if installed globally with `npm i -g ezhst`).
|
|
9
9
|
|
|
10
10
|
## Rules for agents
|
|
11
11
|
|
|
@@ -21,12 +21,12 @@ EasyHost is free hosting for Node.js apps with built-in S3 storage, Postgres and
|
|
|
21
21
|
Check first: `npx ezhst whoami --json`. If it fails with "Not logged in":
|
|
22
22
|
|
|
23
23
|
- Existing account: ask the user for email and password, then `npx ezhst login --email <email> --password <password> --json`
|
|
24
|
-
- New account: ask for name, email and password, then `npx ezhst register --name <name> --email <email> --password <password> --json`.
|
|
24
|
+
- New account: ask for name, email and password, then `npx ezhst register --name <name> --email <email> --password <password> --json`. Verification is mandatory: ask the user for the 6-digit code from their inbox and run `npx ezhst verify <code> --json` before any other command (`npx ezhst resend-verification` sends a new code).
|
|
25
25
|
- CI: set `EZHST_TOKEN` instead of logging in.
|
|
26
26
|
|
|
27
27
|
## 2. Pick or create a project
|
|
28
28
|
|
|
29
|
-
A project contains up to
|
|
29
|
+
A project contains up to three apps, five schedules, and shared storage and database. Each app has its own slug and URL: `https://<app-slug>.easyhost.fun`. Existing project apps retain their URLs.
|
|
30
30
|
|
|
31
31
|
```
|
|
32
32
|
npx ezhst projects list --json
|
|
@@ -86,9 +86,7 @@ Database (Postgres, one per project):
|
|
|
86
86
|
- `db create <name> | info | query "<sql>" | query --file <file.sql> | rows <table> [--page n] | reset-password | delete --yes`
|
|
87
87
|
- `db info --json` returns `connectionString` and `shadowConnectionString` (for `prisma migrate dev`). Set `DATABASE_URL` with `env set`, and run migrations from the local machine against it (for Prisma: `prisma migrate deploy`).
|
|
88
88
|
|
|
89
|
-
Email
|
|
90
|
-
- `email sender create <username>`, `email info`, `email send --from <address> --to <address> --subject <text> --text <body>` (or `--html`), `email logs`, `email sender delete`
|
|
91
|
-
- From app code: `POST https://api.easyhost.fun/api/v1/email/send` with header `Authorization: Bearer <api key>` and JSON `{ "from", "to", "subject", "text" | "html" }`. Create the key with `keys create <name>` and store it with `env set EASYHOST_API_KEY=...`.
|
|
89
|
+
Email: coming soon. The `email` commands and the email API return "Email is coming soon." Do not set up or send email on EasyHost yet.
|
|
92
90
|
|
|
93
91
|
Schedules (up to five per project, intervals in minutes):
|
|
94
92
|
- `schedules list`, `schedules create <name> --url <url> --every <minutes> [--method POST] [--headers '<json>'] [--body '<text>'] [--paused]`
|
|
@@ -96,14 +94,17 @@ Schedules (up to five per project, intervals in minutes):
|
|
|
96
94
|
- `schedules pause <id>`, `schedules resume <id>`, `schedules logs <id>`, `schedules delete <id> --yes`
|
|
97
95
|
- Public HTTP/HTTPS URLs only, intervals 1 to 43200 minutes, 30-second timeout, no redirects. First call follows one interval; saving/resuming restarts it. Latest 100 runs retained, latest 10 shown. Missed intervals are skipped; execution has up to 10 seconds of polling delay. Requests in progress may finish after pausing/deleting.
|
|
98
96
|
|
|
99
|
-
|
|
100
|
-
- `
|
|
97
|
+
Members:
|
|
98
|
+
- `members list | invite <email> | revoke <email> | remove <email> --yes | leave --yes`. Only the owner can invite, revoke, remove, rename or delete the project. Members can do everything else.
|
|
99
|
+
- `accept-invite <link-or-token>` joins a project. The logged-in email must match the invited email.
|
|
101
100
|
|
|
102
101
|
Account:
|
|
103
|
-
- `whoami`, `logout`, `resend-verification`, `forgot-password --email <email>`
|
|
102
|
+
- `whoami`, `logout`, `verify <code>`, `resend-verification`, `forgot-password --email <email>`
|
|
103
|
+
- If a command fails with "Your email is not verified", ask the user for the 6-digit code from their inbox and run `verify <code>`. Codes expire after 10 minutes; `resend-verification` sends a new one (once a minute).
|
|
104
|
+
- Limit errors ("You can have at most 3 projects.", "Each project can have at most 3 apps.") are hard limits: suggest deleting something the user no longer needs.
|
|
104
105
|
|
|
105
106
|
## Limits
|
|
106
107
|
|
|
107
|
-
Free:
|
|
108
|
+
Free: 3 projects. Per project: three apps, five schedules, one bucket and one database. One build at a time; 512 MB RAM and 1 CPU per app.
|
|
108
109
|
|
|
109
110
|
Docs: https://easyhost.fun/docs
|