@pkgseer/cli 0.2.1 → 0.2.2
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
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
version
|
|
4
|
-
} from "./shared/chunk-
|
|
4
|
+
} from "./shared/chunk-jyykfhaq.js";
|
|
5
5
|
|
|
6
6
|
// src/cli.ts
|
|
7
7
|
import { Command } from "commander";
|
|
@@ -3840,7 +3840,21 @@ function registerProjectInitCommand(program) {
|
|
|
3840
3840
|
}
|
|
3841
3841
|
|
|
3842
3842
|
// src/commands/skill-init.ts
|
|
3843
|
-
function
|
|
3843
|
+
function getCliInvocation() {
|
|
3844
|
+
const argv1 = process.argv[1] ?? "";
|
|
3845
|
+
const npmExecPath = process.env.npm_execpath ?? "";
|
|
3846
|
+
const npmCommand = process.env.npm_command ?? "";
|
|
3847
|
+
const isNpx = npmCommand === "exec" || argv1.includes("/_npx/") || argv1.includes("\\_npx\\") || npmExecPath.includes("npx");
|
|
3848
|
+
if (isNpx) {
|
|
3849
|
+
return "npx @pkgseer/cli";
|
|
3850
|
+
}
|
|
3851
|
+
const isBunx = process.env.BUN_INSTALL !== undefined && (argv1.includes("/.bun/") || argv1.includes("\\.bun\\") || argv1.includes("/bunx/") || argv1.includes("\\bunx\\"));
|
|
3852
|
+
if (isBunx) {
|
|
3853
|
+
return "bunx @pkgseer/cli";
|
|
3854
|
+
}
|
|
3855
|
+
return "pkgseer";
|
|
3856
|
+
}
|
|
3857
|
+
function generateSkillContent(invocation = "pkgseer") {
|
|
3844
3858
|
return `---
|
|
3845
3859
|
name: pkgseer
|
|
3846
3860
|
version: ${version}
|
|
@@ -3861,43 +3875,43 @@ Search and analyze packages across npm, PyPI, and Hex. All commands support \`--
|
|
|
3861
3875
|
|
|
3862
3876
|
\`\`\`bash
|
|
3863
3877
|
# Search code and docs across packages
|
|
3864
|
-
|
|
3865
|
-
|
|
3866
|
-
|
|
3878
|
+
${invocation} search "<query>" -P lodash,express # npm packages
|
|
3879
|
+
${invocation} search "<query>" -P requests -r pypi # PyPI packages
|
|
3880
|
+
${invocation} search "authentication" -P phoenix,plug -r hex
|
|
3867
3881
|
|
|
3868
3882
|
# Search modes
|
|
3869
|
-
|
|
3870
|
-
|
|
3883
|
+
${invocation} search "<query>" -P <packages> --code # Code only
|
|
3884
|
+
${invocation} search "<query>" -P <packages> --docs # Docs only
|
|
3871
3885
|
|
|
3872
3886
|
# Search project dependencies (requires pkgseer.yml)
|
|
3873
|
-
|
|
3887
|
+
${invocation} docs search "<query>"
|
|
3874
3888
|
\`\`\`
|
|
3875
3889
|
|
|
3876
3890
|
## Package Analysis
|
|
3877
3891
|
|
|
3878
3892
|
\`\`\`bash
|
|
3879
3893
|
# Overview: metadata, versions, quickstart
|
|
3880
|
-
|
|
3894
|
+
${invocation} pkg info <package> [-r npm|pypi|hex]
|
|
3881
3895
|
|
|
3882
3896
|
# Quality score (0-100) with category breakdown
|
|
3883
|
-
|
|
3897
|
+
${invocation} pkg quality <package> [-r registry] [-v version]
|
|
3884
3898
|
|
|
3885
3899
|
# Security: CVEs, severity, upgrade paths
|
|
3886
|
-
|
|
3900
|
+
${invocation} pkg vulns <package> [-r registry] [-v version]
|
|
3887
3901
|
|
|
3888
3902
|
# Dependencies: direct, transitive, tree view
|
|
3889
|
-
|
|
3903
|
+
${invocation} pkg deps <package> [-r registry] [-t] [-d depth]
|
|
3890
3904
|
|
|
3891
3905
|
# Compare up to 10 packages
|
|
3892
|
-
|
|
3893
|
-
|
|
3906
|
+
${invocation} pkg compare lodash underscore ramda
|
|
3907
|
+
${invocation} pkg compare npm:axios pypi:httpx # cross-registry
|
|
3894
3908
|
\`\`\`
|
|
3895
3909
|
|
|
3896
3910
|
## Documentation
|
|
3897
3911
|
|
|
3898
3912
|
\`\`\`bash
|
|
3899
|
-
|
|
3900
|
-
|
|
3913
|
+
${invocation} docs list <package> [-r registry] # List pages
|
|
3914
|
+
${invocation} docs get <package>/<page-id> # Fetch content
|
|
3901
3915
|
\`\`\`
|
|
3902
3916
|
|
|
3903
3917
|
## Tips
|
|
@@ -3925,7 +3939,7 @@ function getCodexSkillPaths(fs, scope) {
|
|
|
3925
3939
|
skillPath: fs.joinPath(baseDir, "SKILL.md")
|
|
3926
3940
|
};
|
|
3927
3941
|
}
|
|
3928
|
-
async function installSkill(fs, skillDir, skillPath) {
|
|
3942
|
+
async function installSkill(fs, skillDir, skillPath, invocation) {
|
|
3929
3943
|
try {
|
|
3930
3944
|
const exists = await fs.exists(skillPath);
|
|
3931
3945
|
let updated = false;
|
|
@@ -3942,7 +3956,7 @@ async function installSkill(fs, skillDir, skillPath) {
|
|
|
3942
3956
|
updated = true;
|
|
3943
3957
|
}
|
|
3944
3958
|
await fs.ensureDir(skillDir);
|
|
3945
|
-
const content = generateSkillContent();
|
|
3959
|
+
const content = generateSkillContent(invocation);
|
|
3946
3960
|
await fs.writeFile(skillPath, content);
|
|
3947
3961
|
return {
|
|
3948
3962
|
success: true,
|
|
@@ -3959,6 +3973,7 @@ async function installSkill(fs, skillDir, skillPath) {
|
|
|
3959
3973
|
async function skillInitAction(deps) {
|
|
3960
3974
|
const { fileSystemService: fs, promptService } = deps;
|
|
3961
3975
|
const useColors = shouldUseColors2();
|
|
3976
|
+
const invocation = getCliInvocation();
|
|
3962
3977
|
console.log("Skill Setup");
|
|
3963
3978
|
console.log(`───────────
|
|
3964
3979
|
`);
|
|
@@ -3985,7 +4000,7 @@ async function skillInitAction(deps) {
|
|
|
3985
4000
|
}
|
|
3986
4001
|
]);
|
|
3987
4002
|
if (tool === "other") {
|
|
3988
|
-
showManualInstructions2(useColors);
|
|
4003
|
+
showManualInstructions2(useColors, invocation);
|
|
3989
4004
|
return;
|
|
3990
4005
|
}
|
|
3991
4006
|
const scope = await promptService.select("Where should the skill be installed?", [
|
|
@@ -4022,11 +4037,11 @@ Skip update.`, useColors));
|
|
|
4022
4037
|
}
|
|
4023
4038
|
console.log(dim(`
|
|
4024
4039
|
Installing skill...`, useColors));
|
|
4025
|
-
const result = await installSkill(fs, paths.skillDir, paths.skillPath);
|
|
4040
|
+
const result = await installSkill(fs, paths.skillDir, paths.skillPath, invocation);
|
|
4026
4041
|
if (!result.success) {
|
|
4027
4042
|
console.log(error(`
|
|
4028
4043
|
Failed to install skill: ${result.error}`, useColors));
|
|
4029
|
-
showManualInstructions2(useColors);
|
|
4044
|
+
showManualInstructions2(useColors, invocation);
|
|
4030
4045
|
return;
|
|
4031
4046
|
}
|
|
4032
4047
|
const toolName = tool === "claude-code" ? "Claude Code" : "Codex";
|
|
@@ -4040,7 +4055,7 @@ The skill is now available. Try asking:
|
|
|
4040
4055
|
` + ` "Is lodash secure? Check for vulnerabilities"
|
|
4041
4056
|
` + ' "Compare axios vs fetch vs got"', useColors));
|
|
4042
4057
|
}
|
|
4043
|
-
function showManualInstructions2(useColors) {
|
|
4058
|
+
function showManualInstructions2(useColors, invocation) {
|
|
4044
4059
|
console.log(`
|
|
4045
4060
|
Manual Installation`);
|
|
4046
4061
|
console.log(`───────────────────
|
|
@@ -4058,12 +4073,13 @@ Manual Installation`);
|
|
|
4058
4073
|
console.log(`Content:
|
|
4059
4074
|
`);
|
|
4060
4075
|
console.log("─".repeat(60));
|
|
4061
|
-
console.log(generateSkillContent());
|
|
4076
|
+
console.log(generateSkillContent(invocation));
|
|
4062
4077
|
console.log("─".repeat(60));
|
|
4063
4078
|
}
|
|
4064
4079
|
async function skillUpdateAction(deps) {
|
|
4065
4080
|
const { fileSystemService: fs } = deps;
|
|
4066
4081
|
const useColors = shouldUseColors2();
|
|
4082
|
+
const invocation = getCliInvocation();
|
|
4067
4083
|
console.log(`Checking for skill updates...
|
|
4068
4084
|
`);
|
|
4069
4085
|
const locations = [
|
|
@@ -4097,7 +4113,7 @@ async function skillUpdateAction(deps) {
|
|
|
4097
4113
|
console.log(`${loc.name}: ${highlight(`v${version}`, useColors)} (current)`);
|
|
4098
4114
|
continue;
|
|
4099
4115
|
}
|
|
4100
|
-
const result = await installSkill(fs, loc.skillDir, loc.skillPath);
|
|
4116
|
+
const result = await installSkill(fs, loc.skillDir, loc.skillPath, invocation);
|
|
4101
4117
|
if (result.success) {
|
|
4102
4118
|
console.log(`${loc.name}: ${dim(`v${existingVersion ?? "unknown"}`, useColors)} → ${highlight(`v${version}`, useColors)}`);
|
|
4103
4119
|
updatedAny = true;
|
|
@@ -4107,7 +4123,7 @@ async function skillUpdateAction(deps) {
|
|
|
4107
4123
|
}
|
|
4108
4124
|
if (!foundAny) {
|
|
4109
4125
|
console.log(dim("No installed skills found.", useColors));
|
|
4110
|
-
console.log(dim(`Run '
|
|
4126
|
+
console.log(dim(`Run '${invocation} skill init' to install the skill.
|
|
4111
4127
|
`, useColors));
|
|
4112
4128
|
return;
|
|
4113
4129
|
}
|
package/dist/index.js
CHANGED