ezhst 0.1.0 → 0.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/skill/SKILL.md ADDED
@@ -0,0 +1,100 @@
1
+ ---
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 Next.js app to EasyHost, or to manage its environment variables, build settings, logs, custom domains, S3 storage, Postgres database, transactional email or API keys.
4
+ ---
5
+
6
+ # EasyHost
7
+
8
+ EasyHost is free hosting for Next.js apps with built-in S3 storage, Postgres and email. Everything is done through the `ezhst` CLI. Run it with `npx ezhst <command>` (or `ezhst` if installed globally with `npm i -g ezhst`).
9
+
10
+ ## Rules for agents
11
+
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
+ - 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>`.
15
+ - Destructive commands (`projects delete`, `storage delete`, `db delete`) need `--yes`. Only run them when the user explicitly asks.
16
+ - Never print secrets (passwords, S3 secret keys, API keys, connection strings) back to the user unless they ask. Put them in env vars with `ezhst env set` instead.
17
+ - `.env` files are never uploaded. Environment variables must be set with `ezhst env set` or `ezhst env import .env`.
18
+
19
+ ## 1. Authenticate
20
+
21
+ Check first: `npx ezhst whoami --json`. If it fails with "Not logged in":
22
+
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`. Tell the user to click the verification link in their inbox.
25
+ - CI: set `EZHST_TOKEN` instead of logging in.
26
+
27
+ ## 2. Pick or create a project
28
+
29
+ A project is one app plus its storage, database, email sender and API keys. Its slug is the subdomain: `https://<slug>.easyhost.fun`.
30
+
31
+ ```
32
+ npx ezhst projects list --json
33
+ npx ezhst projects create <name> --link --json
34
+ npx ezhst link --project <slug> --json
35
+ ```
36
+
37
+ ## 3. Deploy
38
+
39
+ Run inside the Next.js project folder (it needs `package.json` with `next` and a `build` script):
40
+
41
+ ```
42
+ npx ezhst env import .env --json
43
+ npx ezhst deploy --json
44
+ ```
45
+
46
+ Success prints `{"deploymentId", "status": "RUNNING", "url"}`. On failure read the build log and fix the cause:
47
+
48
+ ```
49
+ npx ezhst deployments log --json
50
+ ```
51
+
52
+ Common fixes:
53
+ - Missing env var at build time: `ezhst env set KEY=VALUE`, then `ezhst redeploy`.
54
+ - `npm ci` says the lockfile is out of sync: delete `node_modules` and `package-lock.json`, run `npm install`, deploy again.
55
+ - Monorepo: `ezhst build set --root-dir apps/web`.
56
+ - Needs another Node version: `ezhst build set --node 22` (20, 22 or 24; default is `engines.node` or 24).
57
+
58
+ After changing env vars or build settings, run `npx ezhst redeploy --json` (rebuilds the last upload). After changing code, run `deploy` again.
59
+
60
+ ## Commands
61
+
62
+ Projects and runtime:
63
+ - `projects list | info | rename <name> | delete --yes`, `projects create <name> [--link]`, `link --project <slug>`
64
+ - `deploy [--verbose]`, `redeploy`, `start`, `stop`
65
+ - `logs [--tail 200]` runtime logs
66
+ - `deployments list`, `deployments log [deploymentId]` build logs
67
+
68
+ Environment and build:
69
+ - `env list | set KEY=VALUE... | unset KEY... | import <file>`
70
+ - `build show`, `build set [--node <v>] [--root-dir <dir>] [--install <cmd>] [--build <cmd>] [--start <cmd>]` (`""` resets a field to auto), `build reset`
71
+ - The start command must listen on `0.0.0.0` and `$PORT`. Default: `next start -H 0.0.0.0 -p $PORT`.
72
+
73
+ Custom domains:
74
+ - `domains list | add <hostname> | verify <hostname> | remove <hostname>`
75
+ - DNS: CNAME to `<slug>.easyhost.fun`, or an A record to the IP from `domains list` for a root domain. Run `verify` after DNS is set; it issues HTTPS.
76
+
77
+ Storage (S3 compatible, one bucket per project, files are public by URL):
78
+ - `storage create <name> | info | rotate-keys | ls [prefix] | upload <files...> [--prefix dir/] | download <key> [output] | rm <key> | delete --yes`
79
+ - In app code use any S3 client with endpoint `https://storage.easyhost.fun`, region `us-east-1`, `forcePathStyle: true`, and the bucket name and keys from `storage info`. Public file URL: `https://storage.easyhost.fun/<bucket>/<key>`.
80
+ - Typical setup: `storage create files`, then `env set S3_ENDPOINT=... S3_BUCKET=... S3_ACCESS_KEY_ID=... S3_SECRET_ACCESS_KEY=...` from `storage info --json`.
81
+
82
+ Database (Postgres, one per project):
83
+ - `db create <name> | info | query "<sql>" | query --file <file.sql> | rows <table> [--page n] | reset-password | delete --yes`
84
+ - `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`).
85
+
86
+ Email (from `<username>@easyhost.fun`, 100 emails a day):
87
+ - `email sender create <username>`, `email info`, `email send --from <address> --to <address> --subject <text> --text <body>` (or `--html`), `email logs`, `email sender delete`
88
+ - 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
+
90
+ API keys:
91
+ - `keys list | create <name> | revoke <id>` (a key is shown only once)
92
+
93
+ Account:
94
+ - `whoami`, `logout`, `resend-verification`, `forgot-password --email <email>`
95
+
96
+ ## Limits
97
+
98
+ Free: 10 projects, one bucket, one database and one email sender per project, 100 emails a day, one build at a time, 512 MB RAM and 1 CPU per app. Only Next.js apps are supported right now.
99
+
100
+ Docs: https://easyhost.fun/docs