ezhst 0.2.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.
@@ -1,15 +1,34 @@
1
+ import { select } from "@inquirer/prompts";
1
2
  import { copyFileSync, mkdirSync } from "node:fs";
2
3
  import { homedir } from "node:os";
3
4
  import path from "node:path";
4
5
  import { fileURLToPath } from "node:url";
5
- import { log, output } from "../lib/ui.js";
6
+ import { fail, log, output, required } from "../lib/ui.js";
6
7
  const SKILL_SOURCE = fileURLToPath(new URL("../../skill/SKILL.md", import.meta.url));
7
- export const installSkill = (options) => {
8
- let base = process.cwd();
8
+ export const installSkill = async (options) => {
9
+ if (options.global && options.local) {
10
+ return fail("Choose either --global or --local, not both.");
11
+ }
12
+ let scope;
9
13
  if (options.global) {
14
+ scope = "global";
15
+ }
16
+ else if (options.local) {
17
+ scope = "local";
18
+ }
19
+ scope = await required(scope, "--global or --local", () => select({
20
+ message: "Where should the skill be installed?",
21
+ default: "local",
22
+ choices: [
23
+ { name: "Global (all projects)", value: "global" },
24
+ { name: "Local (current project)", value: "local" },
25
+ ],
26
+ }));
27
+ let base = process.cwd();
28
+ if (scope === "global") {
10
29
  base = homedir();
11
30
  }
12
- const directory = path.join(base, ".claude", "skills", "easyhost");
31
+ const directory = path.join(base, ".agents", "skills", "easyhost");
13
32
  const target = path.join(directory, "SKILL.md");
14
33
  mkdirSync(directory, { recursive: true });
15
34
  copyFileSync(SKILL_SOURCE, target);
package/dist/index.js CHANGED
@@ -119,8 +119,9 @@ scoped(keys.command("revoke").description("Revoke an API key").argument("<id>"))
119
119
  const skill = program.command("skill").description("Agent skill");
120
120
  skill
121
121
  .command("install")
122
- .description("Install the EasyHost skill for Claude Code")
123
- .option("--global", "Install to ~/.claude/skills instead of this project")
122
+ .description("Install the EasyHost agent skill")
123
+ .option("--global", "Install to ~/.agents/skills for all projects")
124
+ .option("--local", "Install to .agents/skills in the current project")
124
125
  .action(installSkill);
125
126
  program.parseAsync().catch((error) => {
126
127
  if (error?.name === "ExitPromptError") {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ezhst",
3
- "version": "0.2.0",
3
+ "version": "0.3.0",
4
4
  "description": "EasyHost CLI: agent-first hosting for Next.js apps with storage, databases and email",
5
5
  "type": "module",
6
6
  "bin": {