plugins 1.3.0 → 1.3.1-snapshot.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/README.md +22 -22
- package/dist/index.js +36 -11
- package/package.json +17 -2
package/README.md
CHANGED
|
@@ -42,31 +42,31 @@ npx plugins targets
|
|
|
42
42
|
|
|
43
43
|
## Commands
|
|
44
44
|
|
|
45
|
-
| Command
|
|
46
|
-
|
|
47
|
-
| `plugins add <source>`
|
|
48
|
-
| `plugins discover <source>` | Inspect plugins without installing (dry run)
|
|
49
|
-
| `plugins targets`
|
|
45
|
+
| Command | Description |
|
|
46
|
+
| --------------------------- | ----------------------------------------------------- |
|
|
47
|
+
| `plugins add <source>` | Discover and install plugins from a source |
|
|
48
|
+
| `plugins discover <source>` | Inspect plugins without installing (dry run) |
|
|
49
|
+
| `plugins targets` | List available agent tools and their detection status |
|
|
50
50
|
|
|
51
51
|
If no subcommand is given, `plugins <source>` defaults to `add`.
|
|
52
52
|
|
|
53
53
|
## Flags
|
|
54
54
|
|
|
55
|
-
| Flag
|
|
56
|
-
|
|
57
|
-
| `--target` | `-t`
|
|
58
|
-
| `--scope`
|
|
59
|
-
| `--yes`
|
|
60
|
-
| `--help`
|
|
55
|
+
| Flag | Short | Default | Description |
|
|
56
|
+
| ---------- | ----- | ----------- | ---------------------------------------------------------- |
|
|
57
|
+
| `--target` | `-t` | auto-detect | Install to a specific agent tool (`claude-code`, `cursor`) |
|
|
58
|
+
| `--scope` | `-s` | `user` | Installation scope: `user`, `project`, or `local` |
|
|
59
|
+
| `--yes` | `-y` | `false` | Skip the confirmation prompt |
|
|
60
|
+
| `--help` | `-h` | | Show usage information |
|
|
61
61
|
|
|
62
62
|
## Supported targets
|
|
63
63
|
|
|
64
64
|
The CLI auto-detects which agent tools are installed and installs to all of them.
|
|
65
65
|
|
|
66
|
-
| Target
|
|
67
|
-
|
|
68
|
-
| [Claude Code](https://code.claude.com) | `claude` binary on PATH
|
|
69
|
-
| [Cursor](https://cursor.com)
|
|
66
|
+
| Target | Detection |
|
|
67
|
+
| -------------------------------------- | ------------------------------------ |
|
|
68
|
+
| [Claude Code](https://code.claude.com) | `claude` binary on PATH |
|
|
69
|
+
| [Cursor](https://cursor.com) | `cursor` + `claude` binaries on PATH |
|
|
70
70
|
|
|
71
71
|
## How it works
|
|
72
72
|
|
|
@@ -90,12 +90,12 @@ The CLI translates the vendor-neutral `.plugin/` format into target-specific for
|
|
|
90
90
|
|
|
91
91
|
## Environment variables
|
|
92
92
|
|
|
93
|
-
| Variable
|
|
94
|
-
|
|
95
|
-
| `DISABLE_TELEMETRY` | Disable anonymous install telemetry
|
|
96
|
-
| `DO_NOT_TRACK`
|
|
97
|
-
| `NO_COLOR`
|
|
98
|
-
| `FORCE_COLOR`
|
|
93
|
+
| Variable | Purpose |
|
|
94
|
+
| ------------------- | -------------------------------------------------------------------------------- |
|
|
95
|
+
| `DISABLE_TELEMETRY` | Disable anonymous install telemetry |
|
|
96
|
+
| `DO_NOT_TRACK` | Disable anonymous install telemetry ([standard](https://consoledonottrack.com/)) |
|
|
97
|
+
| `NO_COLOR` | Disable color output |
|
|
98
|
+
| `FORCE_COLOR` | Force color output |
|
|
99
99
|
|
|
100
100
|
## Development
|
|
101
101
|
|
|
@@ -109,4 +109,4 @@ Zero runtime dependencies. Built with [tsup](https://tsup.egoist.dev/) as a sing
|
|
|
109
109
|
|
|
110
110
|
## License
|
|
111
111
|
|
|
112
|
-
[Apache 2.0](
|
|
112
|
+
[Apache 2.0](./LICENSE)
|
package/dist/index.js
CHANGED
|
@@ -773,7 +773,10 @@ async function installToPluginCache(plugins, scope, repoPath, source) {
|
|
|
773
773
|
marketplaceSource = { source: "github", repo: githubRepo };
|
|
774
774
|
} else if (isRemoteSource(source)) {
|
|
775
775
|
const gitUrl = normalizeGitUrl(source);
|
|
776
|
-
marketplaceSource = {
|
|
776
|
+
marketplaceSource = {
|
|
777
|
+
source: "git",
|
|
778
|
+
url: gitUrl.endsWith(".git") ? gitUrl : gitUrl + ".git"
|
|
779
|
+
};
|
|
777
780
|
} else {
|
|
778
781
|
marketplaceSource = { source: "directory", path: repoPath };
|
|
779
782
|
}
|
|
@@ -787,7 +790,10 @@ async function installToPluginCache(plugins, scope, repoPath, source) {
|
|
|
787
790
|
}
|
|
788
791
|
barEmpty();
|
|
789
792
|
const installedPath = join3(pluginsDir, "installed_plugins.json");
|
|
790
|
-
let installedData = {
|
|
793
|
+
let installedData = {
|
|
794
|
+
version: 2,
|
|
795
|
+
plugins: {}
|
|
796
|
+
};
|
|
791
797
|
if (existsSync2(installedPath)) {
|
|
792
798
|
try {
|
|
793
799
|
installedData = JSON.parse(await readFile2(installedPath, "utf-8"));
|
|
@@ -796,7 +802,11 @@ async function installToPluginCache(plugins, scope, repoPath, source) {
|
|
|
796
802
|
}
|
|
797
803
|
let gitSha;
|
|
798
804
|
try {
|
|
799
|
-
gitSha = execSync2("git rev-parse HEAD", {
|
|
805
|
+
gitSha = execSync2("git rev-parse HEAD", {
|
|
806
|
+
cwd: repoPath,
|
|
807
|
+
encoding: "utf-8",
|
|
808
|
+
stdio: "pipe"
|
|
809
|
+
}).trim();
|
|
800
810
|
} catch {
|
|
801
811
|
}
|
|
802
812
|
for (const plugin of plugins) {
|
|
@@ -834,7 +844,9 @@ async function installToPluginCache(plugins, scope, repoPath, source) {
|
|
|
834
844
|
}
|
|
835
845
|
}
|
|
836
846
|
if (settingsCorrupted) {
|
|
837
|
-
warn(
|
|
847
|
+
warn(
|
|
848
|
+
"Could not parse ~/.claude/settings.json \u2014 skipping enabledPlugins update to avoid overwriting existing settings."
|
|
849
|
+
);
|
|
838
850
|
barLine(c.dim("You may need to manually enable the plugins in Claude Code settings."));
|
|
839
851
|
} else {
|
|
840
852
|
const enabled = settings.enabledPlugins ?? {};
|
|
@@ -867,7 +879,11 @@ async function installToCursorExtensions(plugins, scope, repoPath, source) {
|
|
|
867
879
|
}
|
|
868
880
|
let gitSha;
|
|
869
881
|
try {
|
|
870
|
-
gitSha = execSync2("git rev-parse HEAD", {
|
|
882
|
+
gitSha = execSync2("git rev-parse HEAD", {
|
|
883
|
+
cwd: repoPath,
|
|
884
|
+
encoding: "utf-8",
|
|
885
|
+
stdio: "pipe"
|
|
886
|
+
}).trim();
|
|
871
887
|
} catch {
|
|
872
888
|
}
|
|
873
889
|
for (const plugin of plugins) {
|
|
@@ -881,9 +897,7 @@ async function installToCursorExtensions(plugins, scope, repoPath, source) {
|
|
|
881
897
|
await cp(plugin.path, destDir, { recursive: true });
|
|
882
898
|
barDebug(c.dim(`Copied to ${destDir}`));
|
|
883
899
|
const identifier = `${marketplaceName}.${plugin.name}`;
|
|
884
|
-
extensions = extensions.filter(
|
|
885
|
-
(e) => e?.identifier?.id !== identifier
|
|
886
|
-
);
|
|
900
|
+
extensions = extensions.filter((e) => e?.identifier?.id !== identifier);
|
|
887
901
|
const uriPath = "/" + destDir.replace(/\\/g, "/");
|
|
888
902
|
extensions.push({
|
|
889
903
|
identifier: { id: identifier },
|
|
@@ -917,7 +931,11 @@ async function installToCodex(plugins, scope, repoPath, source) {
|
|
|
917
931
|
}
|
|
918
932
|
let gitSha;
|
|
919
933
|
try {
|
|
920
|
-
gitSha = execSync2("git rev-parse HEAD", {
|
|
934
|
+
gitSha = execSync2("git rev-parse HEAD", {
|
|
935
|
+
cwd: repoPath,
|
|
936
|
+
encoding: "utf-8",
|
|
937
|
+
stdio: "pipe"
|
|
938
|
+
}).trim();
|
|
921
939
|
} catch {
|
|
922
940
|
}
|
|
923
941
|
const versionKey = gitSha ?? "local";
|
|
@@ -1031,7 +1049,12 @@ async function enrichForCodex(plugin) {
|
|
|
1031
1049
|
};
|
|
1032
1050
|
if (manifest.homepage) iface.websiteURL = manifest.homepage;
|
|
1033
1051
|
else if (manifest.repository) iface.websiteURL = manifest.repository;
|
|
1034
|
-
const assetCandidates = [
|
|
1052
|
+
const assetCandidates = [
|
|
1053
|
+
"assets/app-icon.png",
|
|
1054
|
+
"assets/icon.png",
|
|
1055
|
+
"assets/logo.png",
|
|
1056
|
+
"assets/logo.svg"
|
|
1057
|
+
];
|
|
1035
1058
|
for (const candidate of assetCandidates) {
|
|
1036
1059
|
if (existsSync2(join3(plugin.path, candidate))) {
|
|
1037
1060
|
iface.logo = `./${candidate}`;
|
|
@@ -1131,7 +1154,9 @@ async function translateEnvVars(pluginPath, pluginName, envVar) {
|
|
|
1131
1154
|
if (changed) {
|
|
1132
1155
|
await writeFile(filePath, content);
|
|
1133
1156
|
barDebug(
|
|
1134
|
-
c.dim(
|
|
1157
|
+
c.dim(
|
|
1158
|
+
`${pluginName}: translated plugin root \u2192 \${${envVar}} in ${filePath.split("/").pop()}`
|
|
1159
|
+
)
|
|
1135
1160
|
);
|
|
1136
1161
|
}
|
|
1137
1162
|
}
|
package/package.json
CHANGED
|
@@ -1,20 +1,35 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "plugins",
|
|
3
|
-
"version": "1.3.0",
|
|
3
|
+
"version": "1.3.1-snapshot.0",
|
|
4
4
|
"description": "Install open-plugin format plugins into agent tools",
|
|
5
5
|
"type": "module",
|
|
6
|
+
"packageManager": "pnpm@10.28.1",
|
|
7
|
+
"engines": {
|
|
8
|
+
"node": ">=18"
|
|
9
|
+
},
|
|
6
10
|
"bin": {
|
|
7
11
|
"plugins": "dist/index.js"
|
|
8
12
|
},
|
|
9
13
|
"files": [
|
|
10
14
|
"dist"
|
|
11
15
|
],
|
|
16
|
+
"repository": {
|
|
17
|
+
"type": "git",
|
|
18
|
+
"url": "https://github.com/vercel-labs/plugins.git"
|
|
19
|
+
},
|
|
20
|
+
"homepage": "https://github.com/vercel-labs/plugins#readme",
|
|
21
|
+
"bugs": {
|
|
22
|
+
"url": "https://github.com/vercel-labs/plugins/issues"
|
|
23
|
+
},
|
|
12
24
|
"scripts": {
|
|
13
25
|
"build": "tsup",
|
|
14
26
|
"start": "node dist/index.js",
|
|
15
|
-
"test": "tsx --test test/*.test.ts"
|
|
27
|
+
"test": "tsx --test test/*.test.ts",
|
|
28
|
+
"format:check": "prettier --check \"index.ts\" \"lib/**/*.ts\" \"test/**/*.ts\"",
|
|
29
|
+
"publish:snapshot": "npm version prerelease --preid=snapshot --no-git-tag-version && npm publish --tag snapshot"
|
|
16
30
|
},
|
|
17
31
|
"devDependencies": {
|
|
32
|
+
"prettier": "^3",
|
|
18
33
|
"tsx": "^4.20.6",
|
|
19
34
|
"tsup": "^8",
|
|
20
35
|
"typescript": "^5"
|