superacli 1.1.2 → 1.1.4
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/LICENSE +22 -0
- package/README.md +10 -1
- package/__tests__/blogwatcher-plugin.test.js +157 -0
- package/__tests__/clix-plugin.test.js +143 -0
- package/__tests__/config.test.js +46 -1
- package/__tests__/himalaya-plugin.test.js +121 -0
- package/__tests__/mcp-adapter.test.js +79 -0
- package/__tests__/mcp-local.test.js +43 -1
- package/__tests__/mongosh-plugin.test.js +106 -0
- package/__tests__/mysql-plugin.test.js +94 -0
- package/__tests__/plugin-blogwatcher.test.js +55 -0
- package/__tests__/plugin-clix.test.js +51 -0
- package/__tests__/plugin-xurl.test.js +51 -0
- package/__tests__/server-config-service.test.js +8 -1
- package/__tests__/skills.test.js +26 -0
- package/__tests__/wacli-plugin.test.js +132 -0
- package/__tests__/xurl-plugin.test.js +176 -0
- package/cli/adapter-schema.js +7 -0
- package/cli/adapters/mcp.js +82 -20
- package/cli/config.js +65 -8
- package/cli/mcp-local.js +50 -4
- package/cli/plugin-install-guidance.js +100 -0
- package/cli/skills.js +55 -0
- package/cli/supercli.js +1 -1
- package/docs/features/adapters.md +6 -2
- package/docs/initial/mcp-local-mode.md +3 -0
- package/docs/skills-catalog.md +50 -0
- package/docs/supported-harnesses.md +20 -0
- package/package.json +2 -1
- package/plugins/blogwatcher/README.md +52 -0
- package/plugins/blogwatcher/plugin.json +195 -0
- package/plugins/blogwatcher/scripts/post-install.js +66 -0
- package/plugins/blogwatcher/scripts/post-uninstall.js +25 -0
- package/plugins/clix/README.md +44 -0
- package/plugins/clix/plugin.json +126 -0
- package/plugins/clix/scripts/post-install.js +66 -0
- package/plugins/clix/scripts/post-uninstall.js +25 -0
- package/plugins/himalaya/README.md +48 -0
- package/plugins/himalaya/plugin.json +157 -0
- package/plugins/mongosh/README.md +56 -0
- package/plugins/mongosh/plugin.json +88 -0
- package/plugins/mysql/README.md +48 -0
- package/plugins/mysql/plugin.json +64 -0
- package/plugins/plugins.json +63 -0
- package/plugins/wacli/README.md +52 -0
- package/plugins/wacli/plugin.json +260 -0
- package/plugins/xurl/README.md +52 -0
- package/plugins/xurl/plugin.json +239 -0
- package/plugins/xurl/scripts/post-install.js +66 -0
- package/plugins/xurl/scripts/post-uninstall.js +25 -0
- package/server/routes/mcp.js +30 -4
- package/server/services/configService.js +9 -1
- package/tests/test-blogwatcher-smoke.sh +48 -0
- package/tests/test-clix-smoke.sh +44 -0
- package/tests/test-himalaya-smoke.sh +47 -0
- package/tests/test-mcp-browser-use-smoke.sh +141 -0
- package/tests/test-mongosh-smoke.sh +40 -0
- package/tests/test-mysql-smoke.sh +37 -0
- package/tests/test-plugins-registry.js +35 -0
- package/tests/test-wacli-smoke.sh +46 -0
- package/tests/test-xurl-smoke.sh +46 -0
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "clix",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Hybrid clix plugin with remote agent docs and safe read-only X wrappers",
|
|
5
|
+
"source": "https://github.com/spideystreet/clix",
|
|
6
|
+
"checks": [
|
|
7
|
+
{ "type": "binary", "name": "curl" },
|
|
8
|
+
{ "type": "binary", "name": "clix" }
|
|
9
|
+
],
|
|
10
|
+
"post_install": {
|
|
11
|
+
"script": "scripts/post-install.js",
|
|
12
|
+
"runtime": "node",
|
|
13
|
+
"timeout_ms": 15000
|
|
14
|
+
},
|
|
15
|
+
"post_uninstall": {
|
|
16
|
+
"script": "scripts/post-uninstall.js",
|
|
17
|
+
"runtime": "node",
|
|
18
|
+
"timeout_ms": 15000
|
|
19
|
+
},
|
|
20
|
+
"commands": [
|
|
21
|
+
{
|
|
22
|
+
"namespace": "clix",
|
|
23
|
+
"resource": "auth",
|
|
24
|
+
"action": "status",
|
|
25
|
+
"description": "Show clix authentication status as JSON",
|
|
26
|
+
"adapter": "process",
|
|
27
|
+
"adapterConfig": {
|
|
28
|
+
"command": "clix",
|
|
29
|
+
"baseArgs": ["auth", "status", "--json"],
|
|
30
|
+
"parseJson": true,
|
|
31
|
+
"timeout_ms": 15000,
|
|
32
|
+
"missingDependencyHelp": "Please install clix to use this command."
|
|
33
|
+
},
|
|
34
|
+
"args": []
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"namespace": "clix",
|
|
38
|
+
"resource": "timeline",
|
|
39
|
+
"action": "list",
|
|
40
|
+
"description": "List timeline tweets as JSON",
|
|
41
|
+
"adapter": "process",
|
|
42
|
+
"adapterConfig": {
|
|
43
|
+
"command": "clix",
|
|
44
|
+
"baseArgs": ["feed", "--json"],
|
|
45
|
+
"parseJson": true,
|
|
46
|
+
"timeout_ms": 15000,
|
|
47
|
+
"missingDependencyHelp": "Please install clix to use this command."
|
|
48
|
+
},
|
|
49
|
+
"args": [
|
|
50
|
+
{ "name": "type", "type": "string", "required": false },
|
|
51
|
+
{ "name": "count", "type": "integer", "required": false }
|
|
52
|
+
]
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
"namespace": "clix",
|
|
56
|
+
"resource": "posts",
|
|
57
|
+
"action": "search",
|
|
58
|
+
"description": "Search posts as JSON",
|
|
59
|
+
"adapter": "process",
|
|
60
|
+
"adapterConfig": {
|
|
61
|
+
"command": "clix",
|
|
62
|
+
"baseArgs": ["search", "--json"],
|
|
63
|
+
"positionalArgs": ["query"],
|
|
64
|
+
"parseJson": true,
|
|
65
|
+
"timeout_ms": 15000,
|
|
66
|
+
"missingDependencyHelp": "Please install clix to use this command."
|
|
67
|
+
},
|
|
68
|
+
"args": [
|
|
69
|
+
{ "name": "query", "type": "string", "required": true },
|
|
70
|
+
{ "name": "type", "type": "string", "required": false },
|
|
71
|
+
{ "name": "count", "type": "integer", "required": false }
|
|
72
|
+
]
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
"namespace": "clix",
|
|
76
|
+
"resource": "posts",
|
|
77
|
+
"action": "show",
|
|
78
|
+
"description": "Show a tweet and thread as JSON",
|
|
79
|
+
"adapter": "process",
|
|
80
|
+
"adapterConfig": {
|
|
81
|
+
"command": "clix",
|
|
82
|
+
"baseArgs": ["tweet", "--json"],
|
|
83
|
+
"positionalArgs": ["id"],
|
|
84
|
+
"parseJson": true,
|
|
85
|
+
"timeout_ms": 15000,
|
|
86
|
+
"missingDependencyHelp": "Please install clix to use this command."
|
|
87
|
+
},
|
|
88
|
+
"args": [
|
|
89
|
+
{ "name": "id", "type": "string", "required": true }
|
|
90
|
+
]
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
"namespace": "clix",
|
|
94
|
+
"resource": "users",
|
|
95
|
+
"action": "show",
|
|
96
|
+
"description": "Show a user profile and recent tweets as JSON",
|
|
97
|
+
"adapter": "process",
|
|
98
|
+
"adapterConfig": {
|
|
99
|
+
"command": "clix",
|
|
100
|
+
"baseArgs": ["user", "--json"],
|
|
101
|
+
"positionalArgs": ["handle"],
|
|
102
|
+
"parseJson": true,
|
|
103
|
+
"timeout_ms": 15000,
|
|
104
|
+
"missingDependencyHelp": "Please install clix to use this command."
|
|
105
|
+
},
|
|
106
|
+
"args": [
|
|
107
|
+
{ "name": "handle", "type": "string", "required": true }
|
|
108
|
+
]
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
"namespace": "clix",
|
|
112
|
+
"resource": "bookmarks",
|
|
113
|
+
"action": "list",
|
|
114
|
+
"description": "List bookmarks as JSON",
|
|
115
|
+
"adapter": "process",
|
|
116
|
+
"adapterConfig": {
|
|
117
|
+
"command": "clix",
|
|
118
|
+
"baseArgs": ["bookmarks", "--json"],
|
|
119
|
+
"parseJson": true,
|
|
120
|
+
"timeout_ms": 15000,
|
|
121
|
+
"missingDependencyHelp": "Please install clix to use this command."
|
|
122
|
+
},
|
|
123
|
+
"args": []
|
|
124
|
+
}
|
|
125
|
+
]
|
|
126
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
const { addProvider, syncCatalog } = require("../../../cli/skills-catalog")
|
|
2
|
+
|
|
3
|
+
const OWNER = "spideystreet"
|
|
4
|
+
const REPO = "clix"
|
|
5
|
+
const REF = "main"
|
|
6
|
+
const SOURCE_REPO = `https://github.com/${OWNER}/${REPO}`
|
|
7
|
+
const RAW_BASE_URL = `https://raw.githubusercontent.com/${OWNER}/${REPO}/${REF}`
|
|
8
|
+
|
|
9
|
+
const CATALOG_FILES = [
|
|
10
|
+
{
|
|
11
|
+
id: "root.skill",
|
|
12
|
+
name: "clix Agent Skill",
|
|
13
|
+
path: "SKILL.md",
|
|
14
|
+
description: "Agent-focused guidance for safe clix usage, JSON mode, and X workflows.",
|
|
15
|
+
tags: ["agents", "x", "twitter"]
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
id: "root.readme",
|
|
19
|
+
name: "clix Overview",
|
|
20
|
+
path: "README.md",
|
|
21
|
+
description: "Project overview, installation, auth model, and command examples for clix.",
|
|
22
|
+
tags: ["overview", "x", "cookies"]
|
|
23
|
+
}
|
|
24
|
+
]
|
|
25
|
+
|
|
26
|
+
function buildRemoteEntries() {
|
|
27
|
+
return CATALOG_FILES.map(file => ({
|
|
28
|
+
...file,
|
|
29
|
+
source_url: `${RAW_BASE_URL}/${file.path}`
|
|
30
|
+
}))
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
function run() {
|
|
34
|
+
const entries = buildRemoteEntries()
|
|
35
|
+
addProvider({
|
|
36
|
+
name: "clix",
|
|
37
|
+
type: "remote_static",
|
|
38
|
+
enabled: true,
|
|
39
|
+
source_repo: SOURCE_REPO,
|
|
40
|
+
ref: REF,
|
|
41
|
+
entries
|
|
42
|
+
})
|
|
43
|
+
|
|
44
|
+
const index = syncCatalog()
|
|
45
|
+
return {
|
|
46
|
+
provider: "clix",
|
|
47
|
+
entries: entries.length,
|
|
48
|
+
synced_skills: Array.isArray(index.skills) ? index.skills.length : 0
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
if (require.main === module) {
|
|
53
|
+
try {
|
|
54
|
+
const result = run()
|
|
55
|
+
process.stdout.write(JSON.stringify(result))
|
|
56
|
+
} catch (err) {
|
|
57
|
+
process.stderr.write(err.message)
|
|
58
|
+
process.exit(1)
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
module.exports = {
|
|
63
|
+
CATALOG_FILES,
|
|
64
|
+
buildRemoteEntries,
|
|
65
|
+
run
|
|
66
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
const { removeProvider, syncCatalog } = require("../../../cli/skills-catalog")
|
|
2
|
+
|
|
3
|
+
function run() {
|
|
4
|
+
const removed = removeProvider("clix")
|
|
5
|
+
const index = syncCatalog()
|
|
6
|
+
return {
|
|
7
|
+
provider: "clix",
|
|
8
|
+
removed,
|
|
9
|
+
synced_skills: Array.isArray(index.skills) ? index.skills.length : 0
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
if (require.main === module) {
|
|
14
|
+
try {
|
|
15
|
+
const result = run()
|
|
16
|
+
process.stdout.write(JSON.stringify(result))
|
|
17
|
+
} catch (err) {
|
|
18
|
+
process.stderr.write(err.message)
|
|
19
|
+
process.exit(1)
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
module.exports = {
|
|
24
|
+
run
|
|
25
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# Himalaya Plugin Harness
|
|
2
|
+
|
|
3
|
+
This plugin integrates the Himalaya email CLI into dcli with safe read-only wrappers and full namespace passthrough.
|
|
4
|
+
|
|
5
|
+
## Prerequisites
|
|
6
|
+
|
|
7
|
+
Ensure `himalaya` is available on your machine:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
himalaya --version
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
You also need a working Himalaya config, usually at `~/.config/himalaya/config.toml`, with at least one configured account.
|
|
14
|
+
|
|
15
|
+
## Available Commands
|
|
16
|
+
|
|
17
|
+
### Safe Read-Only Wrappers
|
|
18
|
+
|
|
19
|
+
These wrappers target JSON-capable, automation-friendly commands and avoid write-side email actions.
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
dcli himalaya cli version --json
|
|
23
|
+
dcli himalaya account list --json
|
|
24
|
+
dcli himalaya account doctor --account personal --json
|
|
25
|
+
dcli himalaya folder list --account personal --json
|
|
26
|
+
dcli himalaya envelope list --account personal --folder INBOX --page 1 --json
|
|
27
|
+
dcli himalaya envelope thread --account personal --folder INBOX --id 42 --json
|
|
28
|
+
dcli himalaya message read-preview --account personal --folder INBOX --id 42 --json
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
### Full Passthrough
|
|
32
|
+
|
|
33
|
+
You can run any Himalaya command through the `himalaya` namespace.
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
# Explicit upstream JSON mode
|
|
37
|
+
dcli himalaya --output json account list
|
|
38
|
+
|
|
39
|
+
# Raw CLI help
|
|
40
|
+
dcli himalaya --help
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## Notes
|
|
44
|
+
|
|
45
|
+
- Wrapped list and preview commands bake in Himalaya's `--output json` support and return parsed data in the dcli envelope.
|
|
46
|
+
- The wrapped `message read-preview` command forces `--preview` so it can inspect mail without marking it seen.
|
|
47
|
+
- Destructive or interactive flows such as `account configure`, `message send`, `message write`, and delete/move operations are intentionally left out of wrapped v1.
|
|
48
|
+
- Himalaya passthrough does not understand upstream `--json`; use `--output json` when you want Himalaya itself to emit JSON.
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "himalaya",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Himalaya email CLI plugin with safe read-only wrappers and passthrough",
|
|
5
|
+
"source": "https://github.com/pimalaya/himalaya",
|
|
6
|
+
"checks": [
|
|
7
|
+
{
|
|
8
|
+
"type": "binary",
|
|
9
|
+
"name": "himalaya"
|
|
10
|
+
}
|
|
11
|
+
],
|
|
12
|
+
"commands": [
|
|
13
|
+
{
|
|
14
|
+
"namespace": "himalaya",
|
|
15
|
+
"resource": "cli",
|
|
16
|
+
"action": "version",
|
|
17
|
+
"description": "Show Himalaya CLI version",
|
|
18
|
+
"adapter": "process",
|
|
19
|
+
"adapterConfig": {
|
|
20
|
+
"command": "himalaya",
|
|
21
|
+
"baseArgs": ["--version"],
|
|
22
|
+
"parseJson": false,
|
|
23
|
+
"missingDependencyHelp": "Please install Himalaya to use this command."
|
|
24
|
+
},
|
|
25
|
+
"args": []
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
"namespace": "himalaya",
|
|
29
|
+
"resource": "account",
|
|
30
|
+
"action": "list",
|
|
31
|
+
"description": "List configured email accounts as JSON",
|
|
32
|
+
"adapter": "process",
|
|
33
|
+
"adapterConfig": {
|
|
34
|
+
"command": "himalaya",
|
|
35
|
+
"baseArgs": ["--output", "json", "account", "list"],
|
|
36
|
+
"parseJson": true,
|
|
37
|
+
"timeout_ms": 15000,
|
|
38
|
+
"missingDependencyHelp": "Please install Himalaya to use this command."
|
|
39
|
+
},
|
|
40
|
+
"args": []
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
"namespace": "himalaya",
|
|
44
|
+
"resource": "account",
|
|
45
|
+
"action": "doctor",
|
|
46
|
+
"description": "Inspect a configured account without applying fixes",
|
|
47
|
+
"adapter": "process",
|
|
48
|
+
"adapterConfig": {
|
|
49
|
+
"command": "himalaya",
|
|
50
|
+
"baseArgs": ["account", "doctor"],
|
|
51
|
+
"parseJson": false,
|
|
52
|
+
"timeout_ms": 15000,
|
|
53
|
+
"env": { "NO_COLOR": "1" },
|
|
54
|
+
"missingDependencyHelp": "Please install Himalaya to use this command."
|
|
55
|
+
},
|
|
56
|
+
"args": [
|
|
57
|
+
{ "name": "account", "type": "string", "required": true }
|
|
58
|
+
]
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
"namespace": "himalaya",
|
|
62
|
+
"resource": "folder",
|
|
63
|
+
"action": "list",
|
|
64
|
+
"description": "List folders for a configured account as JSON",
|
|
65
|
+
"adapter": "process",
|
|
66
|
+
"adapterConfig": {
|
|
67
|
+
"command": "himalaya",
|
|
68
|
+
"baseArgs": ["--output", "json", "folder", "list"],
|
|
69
|
+
"parseJson": true,
|
|
70
|
+
"timeout_ms": 15000,
|
|
71
|
+
"missingDependencyHelp": "Please install Himalaya to use this command."
|
|
72
|
+
},
|
|
73
|
+
"args": [
|
|
74
|
+
{ "name": "account", "type": "string", "required": true },
|
|
75
|
+
{ "name": "page", "type": "integer", "required": false },
|
|
76
|
+
{ "name": "page-size", "type": "integer", "required": false }
|
|
77
|
+
]
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
"namespace": "himalaya",
|
|
81
|
+
"resource": "envelope",
|
|
82
|
+
"action": "list",
|
|
83
|
+
"description": "List message envelopes for an account and folder as JSON",
|
|
84
|
+
"adapter": "process",
|
|
85
|
+
"adapterConfig": {
|
|
86
|
+
"command": "himalaya",
|
|
87
|
+
"baseArgs": ["--output", "json", "envelope", "list"],
|
|
88
|
+
"parseJson": true,
|
|
89
|
+
"timeout_ms": 15000,
|
|
90
|
+
"missingDependencyHelp": "Please install Himalaya to use this command."
|
|
91
|
+
},
|
|
92
|
+
"args": [
|
|
93
|
+
{ "name": "account", "type": "string", "required": true },
|
|
94
|
+
{ "name": "folder", "type": "string", "required": true },
|
|
95
|
+
{ "name": "page", "type": "integer", "required": false },
|
|
96
|
+
{ "name": "page-size", "type": "integer", "required": false },
|
|
97
|
+
{ "name": "query", "type": "string", "required": false }
|
|
98
|
+
]
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
"namespace": "himalaya",
|
|
102
|
+
"resource": "envelope",
|
|
103
|
+
"action": "thread",
|
|
104
|
+
"description": "Inspect an envelope thread as JSON",
|
|
105
|
+
"adapter": "process",
|
|
106
|
+
"adapterConfig": {
|
|
107
|
+
"command": "himalaya",
|
|
108
|
+
"baseArgs": ["--output", "json", "envelope", "thread"],
|
|
109
|
+
"parseJson": true,
|
|
110
|
+
"timeout_ms": 15000,
|
|
111
|
+
"missingDependencyHelp": "Please install Himalaya to use this command."
|
|
112
|
+
},
|
|
113
|
+
"args": [
|
|
114
|
+
{ "name": "account", "type": "string", "required": true },
|
|
115
|
+
{ "name": "folder", "type": "string", "required": true },
|
|
116
|
+
{ "name": "id", "type": "integer", "required": true }
|
|
117
|
+
]
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
"namespace": "himalaya",
|
|
121
|
+
"resource": "message",
|
|
122
|
+
"action": "read-preview",
|
|
123
|
+
"description": "Read a message preview as JSON without marking it seen",
|
|
124
|
+
"adapter": "process",
|
|
125
|
+
"adapterConfig": {
|
|
126
|
+
"command": "himalaya",
|
|
127
|
+
"baseArgs": ["--output", "json", "message", "read", "--preview"],
|
|
128
|
+
"positionalArgs": ["id"],
|
|
129
|
+
"parseJson": true,
|
|
130
|
+
"timeout_ms": 15000,
|
|
131
|
+
"missingDependencyHelp": "Please install Himalaya to use this command."
|
|
132
|
+
},
|
|
133
|
+
"args": [
|
|
134
|
+
{ "name": "account", "type": "string", "required": true },
|
|
135
|
+
{ "name": "folder", "type": "string", "required": true },
|
|
136
|
+
{ "name": "id", "type": "integer", "required": true },
|
|
137
|
+
{ "name": "header", "type": "string[]", "required": false },
|
|
138
|
+
{ "name": "no-headers", "type": "boolean", "required": false }
|
|
139
|
+
]
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
"namespace": "himalaya",
|
|
143
|
+
"resource": "_",
|
|
144
|
+
"action": "_",
|
|
145
|
+
"description": "Passthrough command to execute any Himalaya CLI command",
|
|
146
|
+
"adapter": "process",
|
|
147
|
+
"adapterConfig": {
|
|
148
|
+
"command": "himalaya",
|
|
149
|
+
"passthrough": true,
|
|
150
|
+
"parseJson": false,
|
|
151
|
+
"timeout_ms": 15000,
|
|
152
|
+
"missingDependencyHelp": "Please install Himalaya to use this command."
|
|
153
|
+
},
|
|
154
|
+
"args": []
|
|
155
|
+
}
|
|
156
|
+
]
|
|
157
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
# mongosh Plugin Harness
|
|
2
|
+
|
|
3
|
+
This plugin integrates the MongoDB shell (`mongosh`) into dcli with wrapped version, ping, and eval commands plus full namespace passthrough.
|
|
4
|
+
|
|
5
|
+
## Prerequisites
|
|
6
|
+
|
|
7
|
+
Ensure `mongosh` is available on your machine:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
mongosh --version
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
If you plan to connect to a protected server, provide the usual connection flags or rely on your environment and shell profile.
|
|
14
|
+
|
|
15
|
+
## Available Commands
|
|
16
|
+
|
|
17
|
+
### CLI Version (Wrapped)
|
|
18
|
+
|
|
19
|
+
Returns the mongosh version via `mongosh --version`.
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
dcli mongosh cli version --json
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
### Server Ping (Wrapped)
|
|
26
|
+
|
|
27
|
+
Runs `db.adminCommand({ ping: 1 })` with quiet relaxed JSON output.
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
dcli mongosh server ping --host 127.0.0.1 --port 27017 --json
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
### Eval Run (Wrapped)
|
|
34
|
+
|
|
35
|
+
Runs a JavaScript expression through `mongosh --quiet --json=relaxed --eval`.
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
dcli mongosh eval run --javascript "db.runCommand({ buildInfo: 1 })" --json
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
### Full Passthrough
|
|
42
|
+
|
|
43
|
+
You can run any mongosh command through the `mongosh` namespace.
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
# Show help
|
|
47
|
+
dcli mongosh --help
|
|
48
|
+
|
|
49
|
+
# Evaluate directly
|
|
50
|
+
dcli mongosh --quiet --json=relaxed --eval "db.adminCommand({ ping: 1 })"
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
## Notes
|
|
54
|
+
|
|
55
|
+
- This plugin targets `mongosh`, not the legacy `mongo` shell.
|
|
56
|
+
- Wrapped commands parse relaxed JSON output when possible; more complex BSON values may still surface as Extended JSON structures.
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "mongosh",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "mongosh CLI plugin for dcli",
|
|
5
|
+
"source": "https://www.mongodb.com/docs/mongodb-shell/",
|
|
6
|
+
"checks": [
|
|
7
|
+
{
|
|
8
|
+
"type": "binary",
|
|
9
|
+
"name": "mongosh"
|
|
10
|
+
}
|
|
11
|
+
],
|
|
12
|
+
"commands": [
|
|
13
|
+
{
|
|
14
|
+
"namespace": "mongosh",
|
|
15
|
+
"resource": "cli",
|
|
16
|
+
"action": "version",
|
|
17
|
+
"description": "Show mongosh CLI version",
|
|
18
|
+
"adapter": "process",
|
|
19
|
+
"adapterConfig": {
|
|
20
|
+
"command": "mongosh",
|
|
21
|
+
"baseArgs": ["--version"],
|
|
22
|
+
"parseJson": false,
|
|
23
|
+
"missingDependencyHelp": "Please install mongosh to use this command."
|
|
24
|
+
},
|
|
25
|
+
"args": []
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
"namespace": "mongosh",
|
|
29
|
+
"resource": "server",
|
|
30
|
+
"action": "ping",
|
|
31
|
+
"description": "Run a MongoDB admin ping through mongosh",
|
|
32
|
+
"adapter": "process",
|
|
33
|
+
"adapterConfig": {
|
|
34
|
+
"command": "mongosh",
|
|
35
|
+
"baseArgs": ["--quiet", "--json=relaxed", "--eval", "db.adminCommand({ ping: 1 })"],
|
|
36
|
+
"parseJson": true,
|
|
37
|
+
"timeout_ms": 15000,
|
|
38
|
+
"missingDependencyHelp": "Please install mongosh to use this command."
|
|
39
|
+
},
|
|
40
|
+
"args": [
|
|
41
|
+
{ "name": "host", "type": "string", "required": false },
|
|
42
|
+
{ "name": "port", "type": "integer", "required": false },
|
|
43
|
+
{ "name": "username", "type": "string", "required": false },
|
|
44
|
+
{ "name": "password", "type": "string", "required": false },
|
|
45
|
+
{ "name": "authenticationDatabase", "type": "string", "required": false },
|
|
46
|
+
{ "name": "tls", "type": "boolean", "required": false }
|
|
47
|
+
]
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"namespace": "mongosh",
|
|
51
|
+
"resource": "eval",
|
|
52
|
+
"action": "run",
|
|
53
|
+
"description": "Run JavaScript in mongosh with relaxed JSON output",
|
|
54
|
+
"adapter": "process",
|
|
55
|
+
"adapterConfig": {
|
|
56
|
+
"command": "mongosh",
|
|
57
|
+
"baseArgs": ["--quiet", "--json=relaxed", "--eval"],
|
|
58
|
+
"positionalArgs": ["javascript"],
|
|
59
|
+
"parseJson": true,
|
|
60
|
+
"timeout_ms": 15000,
|
|
61
|
+
"missingDependencyHelp": "Please install mongosh to use this command."
|
|
62
|
+
},
|
|
63
|
+
"args": [
|
|
64
|
+
{ "name": "javascript", "type": "string", "required": true, "description": "JavaScript expression to evaluate" },
|
|
65
|
+
{ "name": "host", "type": "string", "required": false },
|
|
66
|
+
{ "name": "port", "type": "integer", "required": false },
|
|
67
|
+
{ "name": "username", "type": "string", "required": false },
|
|
68
|
+
{ "name": "password", "type": "string", "required": false },
|
|
69
|
+
{ "name": "authenticationDatabase", "type": "string", "required": false },
|
|
70
|
+
{ "name": "tls", "type": "boolean", "required": false }
|
|
71
|
+
]
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
"namespace": "mongosh",
|
|
75
|
+
"resource": "_",
|
|
76
|
+
"action": "_",
|
|
77
|
+
"description": "Passthrough command to execute any mongosh command",
|
|
78
|
+
"adapter": "process",
|
|
79
|
+
"adapterConfig": {
|
|
80
|
+
"command": "mongosh",
|
|
81
|
+
"passthrough": true,
|
|
82
|
+
"parseJson": true,
|
|
83
|
+
"missingDependencyHelp": "Please install mongosh to use this command."
|
|
84
|
+
},
|
|
85
|
+
"args": []
|
|
86
|
+
}
|
|
87
|
+
]
|
|
88
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# MySQL Plugin Harness
|
|
2
|
+
|
|
3
|
+
This plugin integrates the MySQL CLI into dcli with a wrapped version command, a batch-friendly query wrapper, and full namespace passthrough.
|
|
4
|
+
|
|
5
|
+
## Prerequisites
|
|
6
|
+
|
|
7
|
+
Ensure `mysql` is available on your machine:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
mysql --version
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
If you plan to connect to a remote server, set the usual connection flags or environment variables such as `MYSQL_HOST`, `MYSQL_USER`, `MYSQL_DATABASE`, and `MYSQL_PWD`.
|
|
14
|
+
|
|
15
|
+
## Available Commands
|
|
16
|
+
|
|
17
|
+
### CLI Version (Wrapped)
|
|
18
|
+
|
|
19
|
+
Returns the MySQL client version via `mysql --version`.
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
dcli mysql cli version --json
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
### Query Execute (Wrapped)
|
|
26
|
+
|
|
27
|
+
Runs `mysql --batch --raw --skip-column-names --execute <sql>` so the output stays automation-friendly.
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
dcli mysql query execute --execute "select 1" --host 127.0.0.1 --user root --database mysql --json
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
### Full Passthrough
|
|
34
|
+
|
|
35
|
+
You can run any MySQL CLI command through the `mysql` namespace.
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
# Show help
|
|
39
|
+
dcli mysql --help
|
|
40
|
+
|
|
41
|
+
# Run a one-off query directly
|
|
42
|
+
dcli mysql --execute "show databases()"
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## Notes
|
|
46
|
+
|
|
47
|
+
- The wrapped query command returns raw text output, not parsed JSON.
|
|
48
|
+
- Prefer `MYSQL_PWD` or other secure credential mechanisms instead of putting passwords directly in shell history.
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "mysql",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "MySQL CLI plugin for dcli",
|
|
5
|
+
"source": "https://dev.mysql.com/doc/refman/en/mysql.html",
|
|
6
|
+
"checks": [
|
|
7
|
+
{
|
|
8
|
+
"type": "binary",
|
|
9
|
+
"name": "mysql"
|
|
10
|
+
}
|
|
11
|
+
],
|
|
12
|
+
"commands": [
|
|
13
|
+
{
|
|
14
|
+
"namespace": "mysql",
|
|
15
|
+
"resource": "cli",
|
|
16
|
+
"action": "version",
|
|
17
|
+
"description": "Show MySQL CLI version",
|
|
18
|
+
"adapter": "process",
|
|
19
|
+
"adapterConfig": {
|
|
20
|
+
"command": "mysql",
|
|
21
|
+
"baseArgs": ["--version"],
|
|
22
|
+
"parseJson": false,
|
|
23
|
+
"missingDependencyHelp": "Please install the MySQL CLI to use this command."
|
|
24
|
+
},
|
|
25
|
+
"args": []
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
"namespace": "mysql",
|
|
29
|
+
"resource": "query",
|
|
30
|
+
"action": "execute",
|
|
31
|
+
"description": "Execute a SQL query with batch-friendly MySQL output",
|
|
32
|
+
"adapter": "process",
|
|
33
|
+
"adapterConfig": {
|
|
34
|
+
"command": "mysql",
|
|
35
|
+
"baseArgs": ["--batch", "--raw", "--skip-column-names"],
|
|
36
|
+
"parseJson": false,
|
|
37
|
+
"timeout_ms": 15000,
|
|
38
|
+
"missingDependencyHelp": "Please install the MySQL CLI to use this command."
|
|
39
|
+
},
|
|
40
|
+
"args": [
|
|
41
|
+
{ "name": "execute", "type": "string", "required": true, "description": "SQL statement to execute" },
|
|
42
|
+
{ "name": "host", "type": "string", "required": false },
|
|
43
|
+
{ "name": "port", "type": "integer", "required": false },
|
|
44
|
+
{ "name": "user", "type": "string", "required": false },
|
|
45
|
+
{ "name": "password", "type": "string", "required": false },
|
|
46
|
+
{ "name": "database", "type": "string", "required": false }
|
|
47
|
+
]
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"namespace": "mysql",
|
|
51
|
+
"resource": "_",
|
|
52
|
+
"action": "_",
|
|
53
|
+
"description": "Passthrough command to execute any MySQL CLI command",
|
|
54
|
+
"adapter": "process",
|
|
55
|
+
"adapterConfig": {
|
|
56
|
+
"command": "mysql",
|
|
57
|
+
"passthrough": true,
|
|
58
|
+
"parseJson": true,
|
|
59
|
+
"missingDependencyHelp": "Please install the MySQL CLI to use this command."
|
|
60
|
+
},
|
|
61
|
+
"args": []
|
|
62
|
+
}
|
|
63
|
+
]
|
|
64
|
+
}
|