hostedge 0.1.2 → 0.1.3

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 CHANGED
@@ -1,48 +1,106 @@
1
- # hostedge CLI
1
+ # hostedge
2
2
 
3
- Deploy a folder to HostEdge from your terminal.
3
+ **Hosting your AI agent can use.** The HostEdge command line deploys websites and apps to a global edge network, reads logs, and manages environment variables. It works the same for people at a terminal, in CI, and for AI agents such as Claude Code, Cursor and Codex.
4
4
 
5
- Install once with `npm install --global hostedge` (or `curl -fsSL https://hostedge.app/install.sh | sh`), or run it with `npx`:
5
+ - Site: https://hostedge.app
6
+ - Docs: https://hostedge.app/docs/cli
7
+ - Free plan: 3 projects, no card
8
+
9
+ ## Quick start
10
+
11
+ ```sh
12
+ npx hostedge login # opens your browser and signs you in
13
+ npx hostedge deploy # uploads your project, shows the build, prints the live URL
14
+ ```
15
+
16
+ That is all. Run it in the folder that holds your site (a built `dist` or `out` folder, or the project itself). The first deploy creates the project and links it; later deploys only upload what changed.
17
+
18
+ Install it once if you prefer a short command:
19
+
20
+ ```sh
21
+ npm install --global hostedge # then: hostedge deploy
22
+ ```
23
+
24
+ Requires Node 20.11 or newer.
25
+
26
+ ## Let your AI agent do it
27
+
28
+ There are two ways. Use either or both.
29
+
30
+ **1. Teach the agent HostEdge (no setup in the dashboard):**
31
+
32
+ ```sh
33
+ npx hostedge init --ai
34
+ ```
35
+
36
+ This writes `AGENTS.md`, `CLAUDE.md`, a Cursor rule and a Claude Code skill into your project. Your agent then knows how to build for HostEdge, deploy, read logs and roll back.
37
+
38
+ **2. Connect it over MCP** and just ask ("deploy this and check the logs"):
6
39
 
7
40
  ```sh
8
- npx hostedge login # opens your browser; or: hostedge login --token hostedge_…
9
- npx hostedge deploy # uploads changed files, streams the build log, prints the URL
41
+ claude mcp add --transport http hostedge https://hostedge.app/api/mcp
10
42
  ```
11
43
 
44
+ For Cursor, Windsurf and other clients, add `https://hostedge.app/api/mcp` as a remote MCP server. Details: https://hostedge.app/docs/ai-assistants
45
+
46
+ ### For agents: what to know
47
+
48
+ - Every command takes `--json` (machine output on stdout, human text on stderr), `--yes` (never prompt) and `--quiet`. With `CI=1` or no TTY it never prompts.
49
+ - Authenticate with the `HOSTEDGE_TOKEN` environment variable (create one in Settings, API tokens, scope `deployments:write`) or `hostedge login --token <token>`.
50
+ - `hostedge deploy --wait --json` prints `{ "deploymentId", "status", "url", "failureReason", ... }` and exits `5` if the build fails.
51
+ - `hostedge logs --json` prints one JSON object per line.
52
+ - Exit codes are stable, see the table below.
53
+
54
+ ## Commands
55
+
12
56
  | Command | What it does |
13
57
  | --- | --- |
14
- | `hostedge login [--token <t> \| --with-token] [--api-url <url>]` | Signs in. The browser flow creates a 90-day token scoped to the CLI; `--with-token` reads the token from stdin. |
15
- | `hostedge logout` | Forgets the saved token (revoke it in Settings → API tokens). |
16
- | `hostedge whoami` | Shows the account, workspace and scopes in use. |
17
- | `hostedge ai-kit [dir] [--force]` | Writes `AGENTS.md`, `CLAUDE.md`, `.cursor/rules/hostedge.mdc` and `.claude/skills/hostedge/SKILL.md` (never overwrites without `--force`). |
18
- | `hostedge init [dir] [--name] [--project <id\|slug>] [--ai]` | Links a folder to a new or existing project (`.hostedge/project.json`); `--ai` also writes the agent kit. |
19
- | `hostedge deploy [dir] [--preview] [-m <message>] [--no-wait]` | Deploys; links the folder on first deploy. Exits 5 if the build fails. |
20
- | `hostedge logs [-f] [--level <l>] [--search <text>] [--since 30m\|1h\|24h\|7d]` | Runtime logs, oldest first; `-f` follows. |
21
- | `hostedge env pull [-e <environment>] [--file <path>]` | Writes variables to `.env.local` (0600, added to `.gitignore`). |
22
-
23
- For scripts and AI agents every command accepts `--json` (JSON on stdout, human text on
24
- stderr), `--yes` (never prompt; `CI=1` or no TTY also disables prompts), `--quiet`,
25
- `--api-url <url>` and `--no-color` (`NO_COLOR` is respected). `hostedge deploy --wait --json`
26
- prints `{deploymentId,status,url,failureReason,…}` and exits 5 if the build fails;
27
- `hostedge logs --json` prints one JSON object per line.
28
-
29
- | Exit code | Meaning |
58
+ | `hostedge login [--token <t> \| --with-token] [--api-url <url>]` | Sign in. The browser flow creates a 90-day token limited to the CLI. `--with-token` reads the token from stdin. |
59
+ | `hostedge logout` | Forget the saved token (revoke it in Settings, API tokens). |
60
+ | `hostedge whoami` | Show the account, workspace and scopes in use. |
61
+ | `hostedge init [dir] [--name] [--project <id\|slug>] [--ai]` | Link a folder to a new or existing project. `--ai` also writes the agent kit. |
62
+ | `hostedge deploy [dir] [--preview] [-m <message>] [--no-wait]` | Deploy. Links the folder on first use. Exits `5` if the build fails. |
63
+ | `hostedge logs [-f] [--level <l>] [--search <text>] [--since 30m\|1h\|24h\|7d]` | Runtime logs, oldest first. `-f` follows. |
64
+ | `hostedge env pull [-e <environment>] [--file <path>]` | Write variables to `.env.local` (private file, added to `.gitignore`). |
65
+ | `hostedge ai-kit [dir] [--force]` | Write the agent files only. Never overwrites without `--force`. |
66
+
67
+ Global flags: `--json`, `--yes`, `--quiet`, `--api-url <url>`, `--no-color` (`NO_COLOR` is respected).
68
+
69
+ ## Exit codes
70
+
71
+ | Code | Meaning |
30
72
  | --- | --- |
31
- | 0 | ok |
32
- | 1 | generic failure |
33
- | 2 | usage error |
34
- | 3 | auth error (not signed in, token invalid or missing a scope) |
35
- | 4 | not found (project, deployment, folder not linked) |
36
- | 5 | deployment failed or was canceled |
37
- | 6 | plan limit reached |
38
-
39
- In CI, set `HOSTEDGE_TOKEN` (create one in Settings → API tokens with the `deployments:write`
40
- scope) and run `npx hostedge deploy`. `HOSTEDGE_API_URL` points the CLI at another HostEdge
41
- (e.g. `http://localhost:3000` in development).
42
-
43
- The CLI follows the dashboard's upload rules: `.git`, `node_modules` and similar folders are
44
- skipped, secret-looking files (`.env*`, keys) are left behind, and symbolic links are refused.
45
- Only files HostEdge doesn't already have are uploaded.
46
-
47
- Development: `pnpm --filter hostedge build` bundles `dist/hostedge.js` (no runtime
48
- dependencies); `pnpm --filter hostedge test` runs the commands against a fake API.
73
+ | 0 | OK |
74
+ | 1 | Generic failure |
75
+ | 2 | Usage error (bad flag or argument) |
76
+ | 3 | Auth error: not signed in, token invalid, or missing a scope |
77
+ | 4 | Not found: project, deployment, or folder not linked |
78
+ | 5 | Deployment failed or was canceled |
79
+ | 6 | Plan limit reached |
80
+
81
+ ## CI
82
+
83
+ ```yaml
84
+ - run: npx hostedge deploy --yes
85
+ env:
86
+ HOSTEDGE_TOKEN: ${{ secrets.HOSTEDGE_TOKEN }}
87
+ ```
88
+
89
+ `HOSTEDGE_API_URL` points the CLI at another HostEdge, for example `http://localhost:3000` in development.
90
+
91
+ ## What gets uploaded
92
+
93
+ The CLI follows the same rules as the dashboard. `.git`, `node_modules` and similar folders are skipped. Files that look like secrets (`.env*`, private keys) are left behind. Symbolic links are refused. Only files HostEdge does not already have are uploaded, in batches, with progress and automatic retries.
94
+
95
+ ## Troubleshooting
96
+
97
+ - **"Not signed in" (exit 3):** run `npx hostedge login`, or set `HOSTEDGE_TOKEN`.
98
+ - **"Not linked" (exit 4):** run `npx hostedge init` in the project folder, or pass `--project <slug>`.
99
+ - **Too many requests:** the CLI waits and retries by itself; if it keeps failing, run it again in a minute.
100
+ - **Plan limit (exit 6):** upgrade at https://hostedge.app/pricing or remove an unused project.
101
+
102
+ ## Development
103
+
104
+ `pnpm --filter hostedge build` bundles `dist/hostedge.js` (no runtime dependencies). `pnpm --filter hostedge test` runs the commands against a fake API.
105
+
106
+ Source: https://github.com/ybenjaa-dev/appdock/tree/main/apps/cli
package/dist/hostedge.js CHANGED
@@ -1334,7 +1334,7 @@ function createApi(io2, apiUrl, token) {
1334
1334
  async function raw(path, init2 = {}) {
1335
1335
  const headers = new Headers(init2.headers);
1336
1336
  headers.set("authorization", `Bearer ${token}`);
1337
- headers.set("user-agent", "hostedge-cli/0.1.2");
1337
+ headers.set("user-agent", "hostedge-cli/0.1.3");
1338
1338
  let response;
1339
1339
  try {
1340
1340
  response = await io2.fetch(`${apiUrl}${path}`, { ...init2, headers });
@@ -3034,8 +3034,8 @@ var Reporter = class {
3034
3034
  };
3035
3035
 
3036
3036
  // src/cli.ts
3037
- var VERSION = "0.1.2";
3038
- var HELP = `hostedge \u2014 deploy to HostEdge from your terminal
3037
+ var VERSION = "0.1.3";
3038
+ var HELP = `hostedge \u2014 hosting your AI agent can use. Deploy from your terminal, CI or an agent.
3039
3039
 
3040
3040
  Usage
3041
3041
  hostedge login [--token <t> | --with-token] [--api-url <url>]
package/package.json CHANGED
@@ -1,12 +1,18 @@
1
1
  {
2
2
  "name": "hostedge",
3
- "version": "0.1.2",
4
- "description": "Deploy to HostEdge from your terminal",
3
+ "version": "0.1.3",
4
+ "description": "Hosting your AI agent can use. Deploy websites and apps to the edge, read logs and manage env vars from the terminal, CI or an AI agent (Claude Code, Cursor, Codex). JSON output, stable exit codes, MCP.",
5
5
  "keywords": [
6
6
  "hostedge",
7
7
  "deploy",
8
8
  "hosting",
9
9
  "cli",
10
+ "ai-agents",
11
+ "mcp",
12
+ "claude-code",
13
+ "cursor",
14
+ "edge",
15
+ "static-site",
10
16
  "cloudflare-workers"
11
17
  ],
12
18
  "homepage": "https://hostedge.app/docs/cli",