askill-cli 0.1.4 → 0.1.5

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 +2 -2
  2. package/dist/cli.mjs +32 -17
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -58,9 +58,9 @@ After installation, read the skill's `SKILL.md` file for usage instructions. Ski
58
58
 
59
59
  ---
60
60
 
61
- askill is a universal package manager for AI agent skills. It enables agents to discover, install, and use skills across Claude Code, Cursor, Windsurf, and 40+ other AI coding assistants.
61
+ askill is a universal package manager for AI agent skills. It enables agents to discover, install, and use skills across Claude Code, Codex, OpenCode, OpenClaw, Cursor, and 40+ other AI coding assistants.
62
62
 
63
- Every skill on [askill.sh](https://askill.sh) is automatically reviewed by AI across 5 quality dimensions safety, clarity, reusability, completeness, and actionability so you can evaluate quality before you install.
63
+ Every skill on [askill.sh](https://askill.sh) is automatically reviewed by AI across 5 strict dimensions - Safety, Clarity, Reusability, Completeness, and Actionability - so risky or malicious skills are filtered out, and truly excellent skills rise to the top of the rankings.
64
64
 
65
65
  ## Quick Start
66
66
 
package/dist/cli.mjs CHANGED
@@ -4,7 +4,7 @@
4
4
  import { homedir } from "os";
5
5
  import { join } from "path";
6
6
  import { existsSync } from "fs";
7
- var VERSION = "0.1.4";
7
+ var VERSION = "0.1.5";
8
8
  var API_BASE_URL = "https://askill.sh/api/v1";
9
9
  var REGISTRY_URL = "https://askill.sh";
10
10
  var RESET = "\x1B[0m";
@@ -419,11 +419,13 @@ var APIClient = class {
419
419
  * Publish a skill from local content or GitHub URL
420
420
  */
421
421
  async publish(payload) {
422
+ const headers = {};
423
+ if (payload.token) {
424
+ headers.Authorization = `Bearer ${payload.token}`;
425
+ }
422
426
  return this.fetch("/publish", {
423
427
  method: "POST",
424
- headers: {
425
- Authorization: `Bearer ${payload.token}`
426
- },
428
+ headers,
427
429
  body: JSON.stringify({
428
430
  content: payload.content,
429
431
  githubUrl: payload.githubUrl
@@ -1523,7 +1525,7 @@ function showBanner() {
1523
1525
  console.log(` ${DIM}$${RESET} askill init${RESET} ${DIM}Create a new skill${RESET}`);
1524
1526
  console.log(` ${DIM}$${RESET} askill submit ${DIM}<url>${RESET} ${DIM}Submit GitHub skill URL${RESET}`);
1525
1527
  console.log(` ${DIM}$${RESET} askill login${RESET} ${DIM}Login with API token${RESET}`);
1526
- console.log(` ${DIM}$${RESET} askill publish${RESET} ${DIM}Publish a skill${RESET}`);
1528
+ console.log(` ${DIM}$${RESET} askill publish${RESET} ${DIM}Publish to @author/slug${RESET}`);
1527
1529
  console.log(` ${DIM}$${RESET} askill run ${DIM}<skill:cmd>${RESET} ${DIM}Run a skill command${RESET}`);
1528
1530
  console.log();
1529
1531
  console.log(`${DIM}Browse skills at${RESET} ${CYAN}https://askill.sh${RESET}`);
@@ -1547,8 +1549,8 @@ ${BOLD}Commands:${RESET}
1547
1549
  login [--token <token>] Login with API token
1548
1550
  logout Clear saved API token
1549
1551
  whoami Show current authenticated user
1550
- publish [path] Publish SKILL.md from local path
1551
- publish --github <url> Publish SKILL.md from GitHub URL
1552
+ publish [path] Publish local SKILL.md (login required)
1553
+ publish --github <url> Publish GitHub SKILL.md (author=repo owner)
1552
1554
  run <skill:cmd> Run a skill command
1553
1555
  upgrade Update askill CLI to latest version
1554
1556
 
@@ -1822,11 +1824,12 @@ Usage:
1822
1824
  askill publish --github <blob-url-to-SKILL.md>
1823
1825
 
1824
1826
  Description:
1825
- Publish a skill under your author scope (@author/skill-name).
1827
+ Publish a skill to canonical slug @author/slug.
1826
1828
 
1827
- Requirements:
1828
- - Logged in via askill login
1829
- - SKILL.md contains valid name and semver version
1829
+ Rules:
1830
+ - SKILL.md must include valid frontmatter fields: name, slug, version
1831
+ - Local publish requires askill login token (author is your GitHub user)
1832
+ - --github publish uses repository owner as author and does not require login
1830
1833
 
1831
1834
  Examples:
1832
1835
  askill publish
@@ -3356,11 +3359,6 @@ async function runWhoami() {
3356
3359
  }
3357
3360
  }
3358
3361
  async function runPublish(args) {
3359
- const creds = await loadCredentials();
3360
- if (!creds?.token) {
3361
- p.log.error("Not logged in. Run askill login first.");
3362
- process.exit(1);
3363
- }
3364
3362
  const githubFlagIndex = args.findIndex((a) => a === "--github");
3365
3363
  const githubUrl = githubFlagIndex >= 0 ? args[githubFlagIndex + 1] : void 0;
3366
3364
  const localPath = args.find((a) => !a.startsWith("-")) || ".";
@@ -3393,11 +3391,22 @@ async function runPublish(args) {
3393
3391
  }
3394
3392
  const parsed = parseSkillMd(content);
3395
3393
  const name = typeof parsed.frontmatter.name === "string" ? parsed.frontmatter.name.trim() : "";
3394
+ const slug = typeof parsed.frontmatter.slug === "string" ? parsed.frontmatter.slug.trim() : "";
3396
3395
  const version = typeof parsed.frontmatter.version === "string" ? parsed.frontmatter.version.trim() : "";
3397
3396
  if (!name) {
3398
3397
  p.log.error("SKILL.md must include frontmatter name");
3399
3398
  process.exit(1);
3400
3399
  }
3400
+ if (!slug) {
3401
+ p.log.error("SKILL.md must include frontmatter slug");
3402
+ p.log.info("Add slug using lowercase letters, numbers, and hyphens (example: slug: my-skill)");
3403
+ process.exit(1);
3404
+ }
3405
+ if (!/^[a-z0-9]+(?:-[a-z0-9]+)*$/.test(slug)) {
3406
+ p.log.error(`Invalid slug in SKILL.md: "${slug}"`);
3407
+ p.log.info("Expected format: lowercase letters, numbers, hyphens (example: my-skill)");
3408
+ process.exit(1);
3409
+ }
3401
3410
  if (!version) {
3402
3411
  p.log.error('SKILL.md is missing frontmatter field "version".');
3403
3412
  p.log.info("Add a semver version, for example: version: 0.1.0");
@@ -3415,8 +3424,14 @@ async function runPublish(args) {
3415
3424
  const spinner2 = p.spinner();
3416
3425
  spinner2.start("Publishing skill...");
3417
3426
  try {
3427
+ const creds = githubUrl ? null : await loadCredentials();
3428
+ if (!githubUrl && !creds?.token) {
3429
+ spinner2.stop(pc.red("Publish failed"));
3430
+ p.log.error("Not logged in. Run askill login first for local publish.");
3431
+ process.exit(1);
3432
+ }
3418
3433
  const result = await api.publish({
3419
- token: creds.token,
3434
+ token: creds?.token,
3420
3435
  githubUrl,
3421
3436
  content: githubUrl ? void 0 : content
3422
3437
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "askill-cli",
3
- "version": "0.1.4",
3
+ "version": "0.1.5",
4
4
  "description": "askill - The Agent Skill Package Manager",
5
5
  "type": "module",
6
6
  "bin": {