@pkgseer/cli 0.2.1 → 0.2.3

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-9016p6c6.js";
4
+ } from "./shared/chunk-zaq9c2d8.js";
5
5
 
6
6
  // src/cli.ts
7
7
  import { Command } from "commander";
@@ -3840,17 +3840,25 @@ function registerProjectInitCommand(program) {
3840
3840
  }
3841
3841
 
3842
3842
  // src/commands/skill-init.ts
3843
- function generateSkillContent() {
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}
3847
- description: >-
3848
- Search code and documentation across npm, PyPI, and Hex packages.
3849
- Find functions, classes, APIs, and usage examples. Also provides
3850
- quality scores, security vulnerabilities, dependencies, and comparisons.
3851
- Triggers on: "how does X work", "find examples of", "search for",
3852
- "is X secure", "compare X vs Y", package evaluation, dependency decisions,
3853
- "what package should I use for", API lookup, security audits.
3861
+ description: Search code/docs across npm, PyPI, Hex packages. Provides quality scores, security vulnerabilities, dependencies, comparisons. Use when user asks about package security, CVEs, vulnerabilities, code examples, API usage, package comparison, dependency analysis, or which package to use.
3854
3862
  ---
3855
3863
 
3856
3864
  # PkgSeer - Package Intelligence
@@ -3861,43 +3869,43 @@ Search and analyze packages across npm, PyPI, and Hex. All commands support \`--
3861
3869
 
3862
3870
  \`\`\`bash
3863
3871
  # Search code and docs across packages
3864
- pkgseer search "<query>" -P lodash,express # npm packages
3865
- pkgseer search "<query>" -P requests -r pypi # PyPI packages
3866
- pkgseer search "authentication" -P phoenix,plug -r hex
3872
+ ${invocation} search "<query>" -P lodash,express # npm packages
3873
+ ${invocation} search "<query>" -P requests -r pypi # PyPI packages
3874
+ ${invocation} search "authentication" -P phoenix,plug -r hex
3867
3875
 
3868
3876
  # Search modes
3869
- pkgseer search "<query>" -P <packages> --code # Code only
3870
- pkgseer search "<query>" -P <packages> --docs # Docs only
3877
+ ${invocation} search "<query>" -P <packages> --code # Code only
3878
+ ${invocation} search "<query>" -P <packages> --docs # Docs only
3871
3879
 
3872
3880
  # Search project dependencies (requires pkgseer.yml)
3873
- pkgseer docs search "<query>"
3881
+ ${invocation} docs search "<query>"
3874
3882
  \`\`\`
3875
3883
 
3876
3884
  ## Package Analysis
3877
3885
 
3878
3886
  \`\`\`bash
3879
3887
  # Overview: metadata, versions, quickstart
3880
- pkgseer pkg info <package> [-r npm|pypi|hex]
3888
+ ${invocation} pkg info <package> [-r npm|pypi|hex]
3881
3889
 
3882
3890
  # Quality score (0-100) with category breakdown
3883
- pkgseer pkg quality <package> [-r registry] [-v version]
3891
+ ${invocation} pkg quality <package> [-r registry] [-v version]
3884
3892
 
3885
3893
  # Security: CVEs, severity, upgrade paths
3886
- pkgseer pkg vulns <package> [-r registry] [-v version]
3894
+ ${invocation} pkg vulns <package> [-r registry] [-v version]
3887
3895
 
3888
3896
  # Dependencies: direct, transitive, tree view
3889
- pkgseer pkg deps <package> [-r registry] [-t] [-d depth]
3897
+ ${invocation} pkg deps <package> [-r registry] [-t] [-d depth]
3890
3898
 
3891
3899
  # Compare up to 10 packages
3892
- pkgseer pkg compare lodash underscore ramda
3893
- pkgseer pkg compare npm:axios pypi:httpx # cross-registry
3900
+ ${invocation} pkg compare lodash underscore ramda
3901
+ ${invocation} pkg compare npm:axios pypi:httpx # cross-registry
3894
3902
  \`\`\`
3895
3903
 
3896
3904
  ## Documentation
3897
3905
 
3898
3906
  \`\`\`bash
3899
- pkgseer docs list <package> [-r registry] # List pages
3900
- pkgseer docs get <package>/<page-id> # Fetch content
3907
+ ${invocation} docs list <package> [-r registry] # List pages
3908
+ ${invocation} docs get <package>/<page-id> # Fetch content
3901
3909
  \`\`\`
3902
3910
 
3903
3911
  ## Tips
@@ -3925,7 +3933,7 @@ function getCodexSkillPaths(fs, scope) {
3925
3933
  skillPath: fs.joinPath(baseDir, "SKILL.md")
3926
3934
  };
3927
3935
  }
3928
- async function installSkill(fs, skillDir, skillPath) {
3936
+ async function installSkill(fs, skillDir, skillPath, invocation) {
3929
3937
  try {
3930
3938
  const exists = await fs.exists(skillPath);
3931
3939
  let updated = false;
@@ -3942,7 +3950,7 @@ async function installSkill(fs, skillDir, skillPath) {
3942
3950
  updated = true;
3943
3951
  }
3944
3952
  await fs.ensureDir(skillDir);
3945
- const content = generateSkillContent();
3953
+ const content = generateSkillContent(invocation);
3946
3954
  await fs.writeFile(skillPath, content);
3947
3955
  return {
3948
3956
  success: true,
@@ -3959,6 +3967,7 @@ async function installSkill(fs, skillDir, skillPath) {
3959
3967
  async function skillInitAction(deps) {
3960
3968
  const { fileSystemService: fs, promptService } = deps;
3961
3969
  const useColors = shouldUseColors2();
3970
+ const invocation = getCliInvocation();
3962
3971
  console.log("Skill Setup");
3963
3972
  console.log(`───────────
3964
3973
  `);
@@ -3985,7 +3994,7 @@ async function skillInitAction(deps) {
3985
3994
  }
3986
3995
  ]);
3987
3996
  if (tool === "other") {
3988
- showManualInstructions2(useColors);
3997
+ showManualInstructions2(useColors, invocation);
3989
3998
  return;
3990
3999
  }
3991
4000
  const scope = await promptService.select("Where should the skill be installed?", [
@@ -4022,11 +4031,11 @@ Skip update.`, useColors));
4022
4031
  }
4023
4032
  console.log(dim(`
4024
4033
  Installing skill...`, useColors));
4025
- const result = await installSkill(fs, paths.skillDir, paths.skillPath);
4034
+ const result = await installSkill(fs, paths.skillDir, paths.skillPath, invocation);
4026
4035
  if (!result.success) {
4027
4036
  console.log(error(`
4028
4037
  Failed to install skill: ${result.error}`, useColors));
4029
- showManualInstructions2(useColors);
4038
+ showManualInstructions2(useColors, invocation);
4030
4039
  return;
4031
4040
  }
4032
4041
  const toolName = tool === "claude-code" ? "Claude Code" : "Codex";
@@ -4040,7 +4049,7 @@ The skill is now available. Try asking:
4040
4049
  ` + ` "Is lodash secure? Check for vulnerabilities"
4041
4050
  ` + ' "Compare axios vs fetch vs got"', useColors));
4042
4051
  }
4043
- function showManualInstructions2(useColors) {
4052
+ function showManualInstructions2(useColors, invocation) {
4044
4053
  console.log(`
4045
4054
  Manual Installation`);
4046
4055
  console.log(`───────────────────
@@ -4058,12 +4067,13 @@ Manual Installation`);
4058
4067
  console.log(`Content:
4059
4068
  `);
4060
4069
  console.log("─".repeat(60));
4061
- console.log(generateSkillContent());
4070
+ console.log(generateSkillContent(invocation));
4062
4071
  console.log("─".repeat(60));
4063
4072
  }
4064
4073
  async function skillUpdateAction(deps) {
4065
4074
  const { fileSystemService: fs } = deps;
4066
4075
  const useColors = shouldUseColors2();
4076
+ const invocation = getCliInvocation();
4067
4077
  console.log(`Checking for skill updates...
4068
4078
  `);
4069
4079
  const locations = [
@@ -4097,7 +4107,7 @@ async function skillUpdateAction(deps) {
4097
4107
  console.log(`${loc.name}: ${highlight(`v${version}`, useColors)} (current)`);
4098
4108
  continue;
4099
4109
  }
4100
- const result = await installSkill(fs, loc.skillDir, loc.skillPath);
4110
+ const result = await installSkill(fs, loc.skillDir, loc.skillPath, invocation);
4101
4111
  if (result.success) {
4102
4112
  console.log(`${loc.name}: ${dim(`v${existingVersion ?? "unknown"}`, useColors)} → ${highlight(`v${version}`, useColors)}`);
4103
4113
  updatedAny = true;
@@ -4107,7 +4117,7 @@ async function skillUpdateAction(deps) {
4107
4117
  }
4108
4118
  if (!foundAny) {
4109
4119
  console.log(dim("No installed skills found.", useColors));
4110
- console.log(dim(`Run 'pkgseer skill init' to install the skill.
4120
+ console.log(dim(`Run '${invocation} skill init' to install the skill.
4111
4121
  `, useColors));
4112
4122
  return;
4113
4123
  }
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  version
3
- } from "./shared/chunk-9016p6c6.js";
3
+ } from "./shared/chunk-zaq9c2d8.js";
4
4
  export {
5
5
  version
6
6
  };
@@ -1,4 +1,4 @@
1
1
  // package.json
2
- var version = "0.2.1";
2
+ var version = "0.2.3";
3
3
 
4
4
  export { version };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@pkgseer/cli",
3
3
  "description": "CLI companion for PkgSeer - package intelligence for developers and AI assistants",
4
- "version": "0.2.1",
4
+ "version": "0.2.3",
5
5
  "type": "module",
6
6
  "files": [
7
7
  "dist",