skilluse 0.3.2 → 0.4.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.
Files changed (3) hide show
  1. package/README.md +18 -14
  2. package/dist/cli.js +24 -134
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -9,26 +9,21 @@ See the [main README](../../README.md) for design philosophy and the [design doc
9
9
  ## Installation
10
10
 
11
11
  ```bash
12
+ # npm (recommended)
12
13
  npm install -g skilluse
14
+
15
+ # or shell script (macOS/Linux)
16
+ curl -fsSL https://skilluse.dev/install.sh | bash
13
17
  ```
14
18
 
15
19
  ## Quick Start
16
20
 
17
21
  ```bash
18
- # Login to GitHub
19
- skilluse login
20
-
21
- # Add a skill repository
22
+ # 1. Add a skill repository
22
23
  skilluse repo add owner/skill-repo
23
24
 
24
- # Search for skills
25
- skilluse search code-review
26
-
27
- # Install a skill
25
+ # 2. Install a skill
28
26
  skilluse install code-review
29
-
30
- # List installed skills
31
- skilluse list
32
27
  ```
33
28
 
34
29
  ## Commands
@@ -55,14 +50,18 @@ skilluse list
55
50
 
56
51
  | Command | Description |
57
52
  |---------|-------------|
58
- | `skilluse search <keyword>` | Search for skills |
59
- | `skilluse install <skill>` | Install skill locally |
53
+ | `skilluse install <skill>` | Install from configured repo |
54
+ | `skilluse install <github-url>` | Install from GitHub URL |
60
55
  | `skilluse install <skill> --global` | Install globally |
61
56
  | `skilluse uninstall <skill>` | Remove installed skill |
62
57
  | `skilluse upgrade [skill]` | Upgrade skill(s) to latest |
63
58
  | `skilluse list` | List installed skills |
64
59
  | `skilluse list --outdated` | Show skills with updates |
65
- | `skilluse info <skill>` | Show skill details |
60
+
61
+ Example with GitHub URL:
62
+ ```bash
63
+ skilluse install https://github.com/owner/repo/tree/main/skills/code-review
64
+ ```
66
65
 
67
66
  ### Agent Management
68
67
 
@@ -75,6 +74,11 @@ Supported agents: `claude`, `cursor`, `windsurf`, `codex`, `copilot`, `cline`, `
75
74
 
76
75
  ## Authentication
77
76
 
77
+ | Repository Type | Login Required |
78
+ |-----------------|----------------|
79
+ | Public repo | No |
80
+ | Private repo | Yes |
81
+
78
82
  Skilluse uses GitHub App OAuth for authentication.
79
83
 
80
84
  ### First-Time Login
package/dist/cli.js CHANGED
@@ -66941,8 +66941,8 @@ function Info({ args: [skillName] }) {
66941
66941
  }
66942
66942
 
66943
66943
  // src/commands/install.tsx
66944
- import { cp, mkdir, readFile as readFile2, stat, writeFile } from "node:fs/promises";
66945
- import { basename, isAbsolute, join as join3 } from "node:path";
66944
+ import { mkdir, writeFile } from "node:fs/promises";
66945
+ import { basename, join as join3 } from "node:path";
66946
66946
  var import_react32 = __toESM(require_react(), 1);
66947
66947
  var jsx_dev_runtime9 = __toESM(require_jsx_dev_runtime(), 1);
66948
66948
  var args2 = exports_external.tuple([exports_external.string().describe("Skill name to install")]);
@@ -66983,20 +66983,23 @@ function parseFrontmatter2(content) {
66983
66983
  return result;
66984
66984
  }
66985
66985
  function parseInstallSource(source) {
66986
- if (source.startsWith("./") || source.startsWith("/") || isAbsolute(source)) {
66987
- return { type: "local", path: source };
66988
- }
66989
- if (source.includes("/")) {
66990
- const parts = source.split("/");
66986
+ if (source.startsWith("https://github.com/")) {
66987
+ const urlPath = source.replace("https://github.com/", "");
66988
+ const parts = urlPath.split("/");
66989
+ if (parts.length < 2) {
66990
+ return { type: "repo", name: source };
66991
+ }
66992
+ const owner = parts[0];
66993
+ const repo = parts[1];
66991
66994
  if (parts.length === 2) {
66992
- return { type: "github", owner: parts[0], repo: parts[1] };
66995
+ return { type: "github", owner, repo, branch: "main" };
66993
66996
  }
66994
- return {
66995
- type: "github",
66996
- owner: parts[0],
66997
- repo: parts[1],
66998
- path: parts.slice(2).join("/")
66999
- };
66997
+ if (parts[2] === "tree" && parts.length >= 4) {
66998
+ const branch = parts[3];
66999
+ const path6 = parts.slice(4).join("/") || undefined;
67000
+ return { type: "github", owner, repo, branch, path: path6 };
67001
+ }
67002
+ return { type: "github", owner, repo, branch: "main" };
67000
67003
  }
67001
67004
  return { type: "repo", name: source };
67002
67005
  }
@@ -67159,30 +67162,6 @@ async function fetchGitHubSkill(token, owner, repo, path6, branch = "main") {
67159
67162
  return null;
67160
67163
  }
67161
67164
  }
67162
- async function installFromLocalPath(sourcePath, targetDir) {
67163
- const sourceStats = await stat(sourcePath);
67164
- if (!sourceStats.isDirectory()) {
67165
- throw new Error(`Source is not a directory: ${sourcePath}`);
67166
- }
67167
- const skillMdPath = join3(sourcePath, "SKILL.md");
67168
- let frontmatter = {};
67169
- try {
67170
- const content = await readFile2(skillMdPath, "utf-8");
67171
- frontmatter = parseFrontmatter2(content);
67172
- } catch {}
67173
- await mkdir(targetDir, { recursive: true });
67174
- await cp(sourcePath, targetDir, { recursive: true });
67175
- const skillName = basename(sourcePath);
67176
- return {
67177
- name: String(frontmatter.name || skillName),
67178
- description: String(frontmatter.description || ""),
67179
- type: frontmatter.type ? String(frontmatter.type) : undefined,
67180
- version: frontmatter.version ? String(frontmatter.version) : "1.0.0",
67181
- author: frontmatter.author ? String(frontmatter.author) : undefined,
67182
- repo: "local",
67183
- path: sourcePath
67184
- };
67185
- }
67186
67165
  function Install({ args: [skillName], options: opts }) {
67187
67166
  const { exit } = use_app_default();
67188
67167
  const [state, setState] = import_react32.useState({ phase: "checking" });
@@ -67201,68 +67180,11 @@ function Install({ args: [skillName], options: opts }) {
67201
67180
  const scope = opts.global ? "global" : "local";
67202
67181
  const config2 = getConfig();
67203
67182
  const source = parseInstallSource(skillName);
67204
- if (source.type === "local") {
67205
- const sourcePath = isAbsolute(source.path) ? source.path : join3(process.cwd(), source.path);
67206
- try {
67207
- const derivedName = basename(sourcePath);
67208
- const baseDir2 = getSkillsPath(agentId, scope);
67209
- const installPath2 = join3(baseDir2, derivedName);
67210
- const steps2 = [
67211
- { label: "Checking source directory", status: "done" },
67212
- { label: "Copying files", status: "in_progress" },
67213
- {
67214
- label: `Installing to ${agent.localPath}/${derivedName}`,
67215
- status: "pending"
67216
- },
67217
- { label: "Verifying installation", status: "pending" }
67218
- ];
67219
- setState({
67220
- phase: "installing",
67221
- skill: {
67222
- name: derivedName,
67223
- description: "",
67224
- repo: "local",
67225
- path: sourcePath
67226
- },
67227
- scope,
67228
- steps: steps2,
67229
- progress: 25
67230
- });
67231
- const skill2 = await installFromLocalPath(sourcePath, installPath2);
67232
- steps2[1].status = "done";
67233
- steps2[2].status = "done";
67234
- steps2[3].status = "done";
67235
- const installedSkill = {
67236
- name: skill2.name,
67237
- repo: "local",
67238
- repoPath: sourcePath,
67239
- commitSha: "local",
67240
- version: skill2.version || "1.0.0",
67241
- type: skill2.type || "skill",
67242
- installedPath: installPath2,
67243
- scope,
67244
- agent: agentId
67245
- };
67246
- addInstalledSkill(installedSkill);
67247
- setState({
67248
- phase: "success",
67249
- skill: skill2,
67250
- installedPath: installPath2
67251
- });
67252
- return;
67253
- } catch (err) {
67254
- setState({
67255
- phase: "error",
67256
- message: err instanceof Error ? err.message : "Installation failed"
67257
- });
67258
- return;
67259
- }
67260
- }
67261
67183
  const credentials = await getCredentials();
67262
67184
  const token = credentials?.token;
67263
67185
  if (source.type === "github") {
67264
67186
  setState({ phase: "searching", repo: `${source.owner}/${source.repo}` });
67265
- const result = await fetchGitHubSkill(token, source.owner, source.repo, source.path);
67187
+ const result = await fetchGitHubSkill(token, source.owner, source.repo, source.path, source.branch);
67266
67188
  if (result && "authRequired" in result) {
67267
67189
  setState({ phase: "auth_required", message: result.message });
67268
67190
  return;
@@ -67295,7 +67217,7 @@ function Install({ args: [skillName], options: opts }) {
67295
67217
  });
67296
67218
  try {
67297
67219
  const skillPath = source.path || "";
67298
- const downloadResult = await downloadSkillFiles(token, `${source.owner}/${source.repo}`, skillPath, "main", installPath2, (downloaded, total) => {
67220
+ const downloadResult = await downloadSkillFiles(token, `${source.owner}/${source.repo}`, skillPath, source.branch, installPath2, (downloaded, total) => {
67299
67221
  const downloadProgress = 25 + downloaded / total * 50;
67300
67222
  setState((prev) => {
67301
67223
  if (prev.phase !== "installing")
@@ -68043,23 +67965,12 @@ function List({ options: opts }) {
68043
67965
  var import_react34 = __toESM(require_react(), 1);
68044
67966
  var jsx_dev_runtime11 = __toESM(require_jsx_dev_runtime(), 1);
68045
67967
  var GITHUB_CLIENT_ID = process.env.SKILLUSE_GITHUB_CLIENT_ID || "Iv23liOOBSjdH2IRT6W2";
68046
- var options4 = exports_external.object({
68047
- force: exports_external.boolean().default(false).describe("Force re-authentication even if already logged in")
68048
- });
68049
- function Login({ options: opts }) {
67968
+ var options4 = exports_external.object({});
67969
+ function Login(_props) {
68050
67970
  const { exit } = use_app_default();
68051
- const [state, setState] = import_react34.useState({ phase: "checking" });
67971
+ const [state, setState] = import_react34.useState({ phase: "requesting_code" });
68052
67972
  import_react34.useEffect(() => {
68053
67973
  async function runLogin() {
68054
- if (!opts.force) {
68055
- const existing = await getCredentials();
68056
- if (existing) {
68057
- setState({ phase: "already_logged_in", username: existing.user });
68058
- exit();
68059
- return;
68060
- }
68061
- }
68062
- setState({ phase: "requesting_code" });
68063
67974
  let deviceCode;
68064
67975
  try {
68065
67976
  deviceCode = await requestDeviceCode(GITHUB_CLIENT_ID, "repo,user");
@@ -68151,29 +68062,8 @@ function Login({ options: opts }) {
68151
68062
  exit();
68152
68063
  }
68153
68064
  runLogin();
68154
- }, [opts.force, exit]);
68065
+ }, [exit]);
68155
68066
  switch (state.phase) {
68156
- case "checking":
68157
- return /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Spinner2, {
68158
- text: "Checking authentication status..."
68159
- }, undefined, false, undefined, this);
68160
- case "already_logged_in":
68161
- return /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Box_default, {
68162
- flexDirection: "column",
68163
- children: [
68164
- /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(StatusMessage, {
68165
- type: "success",
68166
- children: [
68167
- "Already logged in as ",
68168
- state.username
68169
- ]
68170
- }, undefined, true, undefined, this),
68171
- /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Text, {
68172
- dimColor: true,
68173
- children: "Use --force to re-authenticate"
68174
- }, undefined, false, undefined, this)
68175
- ]
68176
- }, undefined, true, undefined, this);
68177
68067
  case "requesting_code":
68178
68068
  return /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Spinner2, {
68179
68069
  text: "Starting authentication..."
@@ -70445,7 +70335,7 @@ function Upgrade({ args: [skillName] }) {
70445
70335
  // package.json
70446
70336
  var package_default = {
70447
70337
  name: "skilluse",
70448
- version: "0.3.2",
70338
+ version: "0.4.0",
70449
70339
  description: "CLI tool for managing and installing AI Coding Agent Skills",
70450
70340
  main: "dist/cli.js",
70451
70341
  bin: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "skilluse",
3
- "version": "0.3.2",
3
+ "version": "0.4.0",
4
4
  "description": "CLI tool for managing and installing AI Coding Agent Skills",
5
5
  "main": "dist/cli.js",
6
6
  "bin": {