@orth/cli 0.2.21 → 0.2.23
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/dist/analytics.js +1 -1
- package/dist/api.js +1 -1
- package/dist/commands/skills.d.ts +3 -0
- package/dist/commands/skills.js +33 -0
- package/dist/index.js +8 -0
- package/package.json +1 -1
package/dist/analytics.js
CHANGED
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.trackEvent = trackEvent;
|
|
4
4
|
const config_js_1 = require("./config.js");
|
|
5
5
|
const CLI_VERSION = process.env.npm_package_version || "0.2.0";
|
|
6
|
-
const BASE_URL = "https://api.
|
|
6
|
+
const BASE_URL = "https://api.orthogonal.com/v1";
|
|
7
7
|
/**
|
|
8
8
|
* Fire-and-forget analytics event for CLI usage tracking.
|
|
9
9
|
* Never blocks, never throws, never shows errors to the user.
|
package/dist/api.js
CHANGED
|
@@ -8,7 +8,7 @@ exports.getDetails = getDetails;
|
|
|
8
8
|
exports.run = run;
|
|
9
9
|
exports.integrate = integrate;
|
|
10
10
|
const config_js_1 = require("./config.js");
|
|
11
|
-
const BASE_URL = process.env.ORTH_API_URL || "https://api.
|
|
11
|
+
const BASE_URL = process.env.ORTH_API_URL || "https://api.orthogonal.com/v1";
|
|
12
12
|
async function apiRequest(endpoint, options = {}) {
|
|
13
13
|
const apiKey = (0, config_js_1.requireApiKey)();
|
|
14
14
|
const res = await fetch(`${BASE_URL}${endpoint}`, {
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
export declare function skillsListCommand(options: {
|
|
2
2
|
limit: string;
|
|
3
3
|
}): Promise<void>;
|
|
4
|
+
export declare function skillsMineCommand(options: {
|
|
5
|
+
limit: string;
|
|
6
|
+
}): Promise<void>;
|
|
4
7
|
export declare function skillsSearchCommand(query: string, options: {
|
|
5
8
|
limit: string;
|
|
6
9
|
}): Promise<void>;
|
package/dist/commands/skills.js
CHANGED
|
@@ -37,6 +37,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
37
37
|
};
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
39
|
exports.skillsListCommand = skillsListCommand;
|
|
40
|
+
exports.skillsMineCommand = skillsMineCommand;
|
|
40
41
|
exports.skillsSearchCommand = skillsSearchCommand;
|
|
41
42
|
exports.skillsShowCommand = skillsShowCommand;
|
|
42
43
|
exports.skillsCreateCommand = skillsCreateCommand;
|
|
@@ -105,6 +106,38 @@ async function skillsListCommand(options) {
|
|
|
105
106
|
}
|
|
106
107
|
}
|
|
107
108
|
// ─────────────────────────────────────────────────────────────────────────────
|
|
109
|
+
// orth skills mine
|
|
110
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
111
|
+
async function skillsMineCommand(options) {
|
|
112
|
+
const spinner = (0, ora_1.default)("Loading your skills...").start();
|
|
113
|
+
try {
|
|
114
|
+
const limit = parseInt(options.limit, 10) || 50;
|
|
115
|
+
const data = await (0, api_js_1.apiRequest)(`/skills/mine?limit=${limit}`);
|
|
116
|
+
spinner.stop();
|
|
117
|
+
if (!data.skills || data.skills.length === 0) {
|
|
118
|
+
console.log(chalk_1.default.gray("\n No skills yet. Create one with: orth skills init\n"));
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
console.log(chalk_1.default.bold(`\nYour Skills (${data.total} total):\n`));
|
|
122
|
+
for (const skill of data.skills) {
|
|
123
|
+
const verified = skill.verified ? chalk_1.default.blue(" ✓") : "";
|
|
124
|
+
const discoverable = skill.discoverable ? chalk_1.default.green(" [public]") : chalk_1.default.gray(" [private]");
|
|
125
|
+
const files = chalk_1.default.gray(`${skill.fileCount} files`);
|
|
126
|
+
console.log(` ${chalk_1.default.cyan.bold(skill.name)}${verified}${discoverable} ${files}`);
|
|
127
|
+
console.log(` Slug: ${chalk_1.default.white(skill.slug)}`);
|
|
128
|
+
if (skill.description) {
|
|
129
|
+
console.log(chalk_1.default.gray(` ${skill.description.slice(0, 100)}${skill.description.length > 100 ? "..." : ""}`));
|
|
130
|
+
}
|
|
131
|
+
console.log();
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
catch (error) {
|
|
135
|
+
spinner.stop();
|
|
136
|
+
console.error(chalk_1.default.red("Failed to load skills:"), error instanceof Error ? error.message : String(error));
|
|
137
|
+
process.exit(1);
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
108
141
|
// orth skills search <query>
|
|
109
142
|
// ─────────────────────────────────────────────────────────────────────────────
|
|
110
143
|
async function skillsSearchCommand(query, options) {
|
package/dist/index.js
CHANGED
|
@@ -146,6 +146,14 @@ skillsGroup
|
|
|
146
146
|
(0, analytics_js_1.trackEvent)("skills.list");
|
|
147
147
|
await (0, skills_js_1.skillsListCommand)(options);
|
|
148
148
|
}));
|
|
149
|
+
skillsGroup
|
|
150
|
+
.command("mine")
|
|
151
|
+
.description("List your own skills")
|
|
152
|
+
.option("-l, --limit <number>", "Max results", "50")
|
|
153
|
+
.action(asyncAction(async (options) => {
|
|
154
|
+
(0, analytics_js_1.trackEvent)("skills.mine");
|
|
155
|
+
await (0, skills_js_1.skillsMineCommand)(options);
|
|
156
|
+
}));
|
|
149
157
|
skillsGroup
|
|
150
158
|
.command("search <query>")
|
|
151
159
|
.description("Search for agent skills")
|