@senso-ai/cli 0.7.0 → 0.8.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.
- package/dist/cli.js +146 -0
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -1488,6 +1488,151 @@ function registerRunConfigCommands(program2) {
|
|
|
1488
1488
|
});
|
|
1489
1489
|
}
|
|
1490
1490
|
|
|
1491
|
+
// src/commands/skills.ts
|
|
1492
|
+
import { execFile } from "child_process";
|
|
1493
|
+
import { promisify } from "util";
|
|
1494
|
+
var execFileAsync = promisify(execFile);
|
|
1495
|
+
var SENSO_SKILLS = [
|
|
1496
|
+
"@senso/senso-search",
|
|
1497
|
+
"@senso/senso-ingest",
|
|
1498
|
+
"@senso/senso-content-gen",
|
|
1499
|
+
"@senso/senso-brand-setup",
|
|
1500
|
+
"@senso/senso-kb-organize",
|
|
1501
|
+
"@senso/senso-review-publish"
|
|
1502
|
+
];
|
|
1503
|
+
var AGENT_FLAGS = {
|
|
1504
|
+
claude: "--claude",
|
|
1505
|
+
cursor: "--cursor",
|
|
1506
|
+
codex: "--codex",
|
|
1507
|
+
copilot: "--copilot",
|
|
1508
|
+
gemini: "--gemini",
|
|
1509
|
+
cline: "--cline"
|
|
1510
|
+
};
|
|
1511
|
+
async function resolveShipables() {
|
|
1512
|
+
try {
|
|
1513
|
+
await execFileAsync("shipables", ["--version"]);
|
|
1514
|
+
return "shipables";
|
|
1515
|
+
} catch {
|
|
1516
|
+
return "npx";
|
|
1517
|
+
}
|
|
1518
|
+
}
|
|
1519
|
+
async function runShipables(args) {
|
|
1520
|
+
const bin = await resolveShipables();
|
|
1521
|
+
if (bin === "npx") {
|
|
1522
|
+
return execFileAsync("npx", ["--yes", "@senso-ai/shipables", ...args], { timeout: 12e4 });
|
|
1523
|
+
}
|
|
1524
|
+
return execFileAsync(bin, args, { timeout: 12e4 });
|
|
1525
|
+
}
|
|
1526
|
+
function buildAgentFlags(agent) {
|
|
1527
|
+
if (!agent) return ["--all"];
|
|
1528
|
+
const flag = AGENT_FLAGS[agent.toLowerCase()];
|
|
1529
|
+
if (!flag) {
|
|
1530
|
+
const valid = Object.keys(AGENT_FLAGS).join(", ");
|
|
1531
|
+
throw new Error(`Unknown agent "${agent}". Valid agents: ${valid}`);
|
|
1532
|
+
}
|
|
1533
|
+
return [flag];
|
|
1534
|
+
}
|
|
1535
|
+
function registerSkillsCommands(program2) {
|
|
1536
|
+
const skills = program2.command("skills").description("Install and manage Senso agent skills. Skills teach AI coding agents (Claude Code, Cursor, Codex, etc.) how to use Senso automatically.");
|
|
1537
|
+
skills.command("install [names...]").description("Install Senso agent skills. Use --all for all six official skills, or pass individual short names (search, ingest, content-gen, brand-setup, kb-organize, review-publish).").option("--all", "Install all six official Senso skills").option("--agent <name>", "Target a specific agent: claude, cursor, codex, copilot, gemini, cline").option("--global", "Install globally instead of project-level").action(async (names, cmdOpts) => {
|
|
1538
|
+
const opts = program2.opts();
|
|
1539
|
+
let skillPackages;
|
|
1540
|
+
if (cmdOpts.all || names.length === 0) {
|
|
1541
|
+
skillPackages = [...SENSO_SKILLS];
|
|
1542
|
+
} else {
|
|
1543
|
+
skillPackages = names.map((n) => {
|
|
1544
|
+
if (n.startsWith("@")) return n;
|
|
1545
|
+
return `@senso/senso-${n}`;
|
|
1546
|
+
});
|
|
1547
|
+
}
|
|
1548
|
+
let agentFlags;
|
|
1549
|
+
try {
|
|
1550
|
+
agentFlags = buildAgentFlags(cmdOpts.agent);
|
|
1551
|
+
} catch (err) {
|
|
1552
|
+
error(err instanceof Error ? err.message : String(err));
|
|
1553
|
+
process.exit(1);
|
|
1554
|
+
}
|
|
1555
|
+
const envFlags = [];
|
|
1556
|
+
const apiKey = getApiKey({ apiKey: opts.apiKey });
|
|
1557
|
+
if (apiKey) {
|
|
1558
|
+
envFlags.push("--env", `SENSO_API_KEY=${apiKey}`);
|
|
1559
|
+
}
|
|
1560
|
+
const globalFlag = cmdOpts.global ? ["--global"] : [];
|
|
1561
|
+
info(`Installing ${skillPackages.length} skill(s)...`);
|
|
1562
|
+
for (const pkg of skillPackages) {
|
|
1563
|
+
try {
|
|
1564
|
+
const args = ["install", pkg, ...agentFlags, ...globalFlag, ...envFlags, "--yes"];
|
|
1565
|
+
const { stdout, stderr } = await runShipables(args);
|
|
1566
|
+
if (!opts.quiet) {
|
|
1567
|
+
if (stdout.trim()) console.log(stdout.trim());
|
|
1568
|
+
if (stderr.trim()) console.error(stderr.trim());
|
|
1569
|
+
}
|
|
1570
|
+
const shortName = pkg.replace("@senso/senso-", "");
|
|
1571
|
+
success(`Installed ${shortName}`);
|
|
1572
|
+
} catch (err) {
|
|
1573
|
+
const shortName = pkg.replace("@senso/senso-", "");
|
|
1574
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
1575
|
+
error(`Failed to install ${shortName}: ${msg}`);
|
|
1576
|
+
}
|
|
1577
|
+
}
|
|
1578
|
+
success("Done. Your agent can now use Senso \u2014 just talk to it naturally.");
|
|
1579
|
+
});
|
|
1580
|
+
skills.command("list").description("List installed Senso skills.").option("--global", "List globally installed skills").action(async (cmdOpts) => {
|
|
1581
|
+
const opts = program2.opts();
|
|
1582
|
+
try {
|
|
1583
|
+
const globalFlag = cmdOpts.global ? ["--global"] : [];
|
|
1584
|
+
const { stdout } = await runShipables(["list", ...globalFlag, "--json"]);
|
|
1585
|
+
const data = JSON.parse(stdout);
|
|
1586
|
+
if (opts.output === "json") {
|
|
1587
|
+
console.log(JSON.stringify(data, null, 2));
|
|
1588
|
+
} else {
|
|
1589
|
+
if (!data || Array.isArray(data) && data.length === 0) {
|
|
1590
|
+
info("No skills installed. Run `senso skills install --all` to get started.");
|
|
1591
|
+
} else {
|
|
1592
|
+
console.log(JSON.stringify(data, null, 2));
|
|
1593
|
+
}
|
|
1594
|
+
}
|
|
1595
|
+
} catch (err) {
|
|
1596
|
+
error(err instanceof Error ? err.message : String(err));
|
|
1597
|
+
process.exit(1);
|
|
1598
|
+
}
|
|
1599
|
+
});
|
|
1600
|
+
skills.command("list-available").description("Show all six official Senso skills available for install.").action(async () => {
|
|
1601
|
+
const opts = program2.opts();
|
|
1602
|
+
const available = SENSO_SKILLS.map((pkg) => ({
|
|
1603
|
+
package: pkg,
|
|
1604
|
+
shortName: pkg.replace("@senso/senso-", "")
|
|
1605
|
+
}));
|
|
1606
|
+
if (opts.output === "json") {
|
|
1607
|
+
console.log(JSON.stringify(available, null, 2));
|
|
1608
|
+
} else {
|
|
1609
|
+
console.log();
|
|
1610
|
+
for (const s of available) {
|
|
1611
|
+
console.log(` ${s.shortName.padEnd(18)} ${s.package}`);
|
|
1612
|
+
}
|
|
1613
|
+
console.log();
|
|
1614
|
+
info("Install all: senso skills install --all");
|
|
1615
|
+
}
|
|
1616
|
+
});
|
|
1617
|
+
skills.command("remove <name>").description("Remove an installed Senso skill. Use the short name (e.g., search, ingest, content-gen).").option("--global", "Remove from global install").action(async (name, cmdOpts) => {
|
|
1618
|
+
const opts = program2.opts();
|
|
1619
|
+
const pkg = name.startsWith("@") ? name : `@senso/senso-${name}`;
|
|
1620
|
+
const globalFlag = cmdOpts.global ? ["--global"] : [];
|
|
1621
|
+
try {
|
|
1622
|
+
const { stdout, stderr } = await runShipables(["uninstall", pkg, ...globalFlag, "--yes"]);
|
|
1623
|
+
if (!opts.quiet) {
|
|
1624
|
+
if (stdout.trim()) console.log(stdout.trim());
|
|
1625
|
+
if (stderr.trim()) console.error(stderr.trim());
|
|
1626
|
+
}
|
|
1627
|
+
const shortName = pkg.replace("@senso/senso-", "");
|
|
1628
|
+
success(`Removed ${shortName}`);
|
|
1629
|
+
} catch (err) {
|
|
1630
|
+
error(err instanceof Error ? err.message : String(err));
|
|
1631
|
+
process.exit(1);
|
|
1632
|
+
}
|
|
1633
|
+
});
|
|
1634
|
+
}
|
|
1635
|
+
|
|
1491
1636
|
// src/commands/members.ts
|
|
1492
1637
|
function registerMemberCommands(program2) {
|
|
1493
1638
|
const members = program2.command("members").description("View the organization member directory. Lists all users who belong to the organization with their names and emails.");
|
|
@@ -1964,6 +2109,7 @@ registerBrandKitCommands(program);
|
|
|
1964
2109
|
registerContentTypeCommands(program);
|
|
1965
2110
|
registerPromptCommands(program);
|
|
1966
2111
|
registerRunConfigCommands(program);
|
|
2112
|
+
registerSkillsCommands(program);
|
|
1967
2113
|
registerMemberCommands(program);
|
|
1968
2114
|
registerCreditsCommands(program);
|
|
1969
2115
|
registerQuestionsCommands(program);
|