bcdocker 1.0.0 → 1.0.1
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 +1 -1
- package/README.md +75 -104
- package/dist/cli-main.d.ts +2 -0
- package/dist/cli-main.js +12 -0
- package/dist/cli.d.ts +4 -1
- package/dist/cli.js +198 -189
- package/dist/executor.d.ts +6 -0
- package/dist/executor.js +20 -5
- package/dist/server-handlers.d.ts +145 -0
- package/dist/server-handlers.js +147 -0
- package/dist/server.d.ts +3 -1
- package/dist/server.js +28 -147
- package/package.json +11 -6
package/LICENSE
CHANGED
package/README.md
CHANGED
|
@@ -1,165 +1,136 @@
|
|
|
1
|
-
#
|
|
1
|
+
# bcdocker
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
## Prerequisites
|
|
6
|
-
|
|
7
|
-
- **Node.js 18+**
|
|
8
|
-
- **Windows PowerShell 5.1** (BC management cmdlets require it)
|
|
9
|
-
- **Docker Desktop** in Windows containers mode
|
|
10
|
-
- **BCDocker PowerShell module** (the `PartnerScript/` sibling folder)
|
|
11
|
-
|
|
12
|
-
## Setup
|
|
3
|
+
MCP server and CLI for **Business Central Docker** container management. Run via `npx` -- no install needed.
|
|
13
4
|
|
|
14
5
|
```bash
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
6
|
+
npx bcdocker list # list containers
|
|
7
|
+
npx bcdocker create # create a BC sandbox
|
|
8
|
+
npx bcdocker test bcsandbox # run AL tests
|
|
18
9
|
```
|
|
19
10
|
|
|
20
|
-
##
|
|
11
|
+
## Quick start
|
|
12
|
+
|
|
13
|
+
### As MCP server (AI assistants)
|
|
21
14
|
|
|
22
|
-
|
|
15
|
+
Zero-install -- add to your IDE config and your AI can manage BC containers directly:
|
|
23
16
|
|
|
24
|
-
|
|
17
|
+
**Cursor** (`.cursor/mcp.json`):
|
|
25
18
|
|
|
26
19
|
```json
|
|
27
20
|
{
|
|
28
21
|
"mcpServers": {
|
|
29
22
|
"bcd": {
|
|
30
|
-
"command": "
|
|
31
|
-
"args": ["
|
|
23
|
+
"command": "npx",
|
|
24
|
+
"args": ["-y", "bcdocker"]
|
|
32
25
|
}
|
|
33
26
|
}
|
|
34
27
|
}
|
|
35
28
|
```
|
|
36
29
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
Add to `claude_desktop_config.json`:
|
|
30
|
+
**Claude Desktop** (`claude_desktop_config.json`):
|
|
40
31
|
|
|
41
32
|
```json
|
|
42
33
|
{
|
|
43
34
|
"mcpServers": {
|
|
44
35
|
"bcd": {
|
|
45
|
-
"command": "
|
|
46
|
-
"args": ["
|
|
36
|
+
"command": "npx",
|
|
37
|
+
"args": ["-y", "bcdocker"]
|
|
47
38
|
}
|
|
48
39
|
}
|
|
49
40
|
}
|
|
50
41
|
```
|
|
51
42
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
Add to `.vscode/mcp.json`:
|
|
43
|
+
**VS Code / Copilot** (`.vscode/mcp.json`):
|
|
55
44
|
|
|
56
45
|
```json
|
|
57
46
|
{
|
|
58
47
|
"servers": {
|
|
59
48
|
"bcd": {
|
|
60
49
|
"type": "stdio",
|
|
61
|
-
"command": "
|
|
62
|
-
"args": ["
|
|
50
|
+
"command": "npx",
|
|
51
|
+
"args": ["-y", "bcdocker"]
|
|
63
52
|
}
|
|
64
53
|
}
|
|
65
54
|
}
|
|
66
55
|
```
|
|
67
56
|
|
|
68
|
-
|
|
57
|
+
Once configured, ask your AI assistant things like:
|
|
69
58
|
|
|
70
59
|
- "List my BC containers"
|
|
71
|
-
- "Create a new BC sandbox
|
|
60
|
+
- "Create a new BC sandbox with version 26.0"
|
|
72
61
|
- "Show me the apps in bcsandbox"
|
|
73
62
|
- "Run tests in my container"
|
|
74
|
-
- "Compile and publish my AL project
|
|
75
|
-
- "Stop the bcsandbox container"
|
|
63
|
+
- "Compile and publish my AL project"
|
|
76
64
|
|
|
77
|
-
|
|
65
|
+
### As CLI
|
|
78
66
|
|
|
79
|
-
|
|
80
|
-
# List containers
|
|
81
|
-
node dist/cli.js list
|
|
67
|
+
**Via npx (no install):**
|
|
82
68
|
|
|
83
|
-
|
|
84
|
-
|
|
69
|
+
```bash
|
|
70
|
+
npx bcdocker list
|
|
71
|
+
npx bcdocker info bcsandbox
|
|
72
|
+
npx bcdocker create --name bcsandbox --version 26.0 --country w1 --bypass-cdn
|
|
73
|
+
npx bcdocker start bcsandbox
|
|
74
|
+
npx bcdocker stop bcsandbox
|
|
75
|
+
npx bcdocker apps bcsandbox --publisher Microsoft
|
|
76
|
+
npx bcdocker test bcsandbox --codeunit 50100
|
|
77
|
+
```
|
|
85
78
|
|
|
86
|
-
|
|
87
|
-
node dist/cli.js create --name bcsandbox --version 26.0 --country w1 --bypass-cdn
|
|
79
|
+
**Global install** (puts `bcd` on your PATH):
|
|
88
80
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
81
|
+
```bash
|
|
82
|
+
npm i -g bcdocker
|
|
83
|
+
bcd list
|
|
84
|
+
bcd create --name mybc --version 26.0
|
|
85
|
+
bcd test mybc
|
|
86
|
+
```
|
|
93
87
|
|
|
94
|
-
|
|
95
|
-
node dist/cli.js remove bcsandbox
|
|
88
|
+
## Prerequisites
|
|
96
89
|
|
|
97
|
-
|
|
98
|
-
|
|
90
|
+
- **Node.js 18+**
|
|
91
|
+
- **Windows PowerShell 5.1** (BC management cmdlets require it)
|
|
92
|
+
- **Docker Desktop** in Windows containers mode
|
|
99
93
|
|
|
100
|
-
|
|
101
|
-
node dist/cli.js apps bcsandbox
|
|
102
|
-
node dist/cli.js apps bcsandbox --publisher Microsoft
|
|
94
|
+
The npm package bundles the PowerShell module in `ps/`. Override with `BCD_MODULE_PATH` if needed.
|
|
103
95
|
|
|
104
|
-
|
|
105
|
-
node dist/cli.js install bcsandbox "C:\apps\MyApp.app"
|
|
96
|
+
## CLI commands
|
|
106
97
|
|
|
107
|
-
|
|
108
|
-
|
|
98
|
+
| Command | Description |
|
|
99
|
+
|---|---|
|
|
100
|
+
| `list` / `ls` | List all BC containers with status |
|
|
101
|
+
| `info <container>` | Show version, status, and endpoints |
|
|
102
|
+
| `create` | Create a new BC container (5-30 min) |
|
|
103
|
+
| `remove <container>` | Remove a container |
|
|
104
|
+
| `start <container>` | Start a stopped container |
|
|
105
|
+
| `stop <container>` | Stop a running container |
|
|
106
|
+
| `restart <container>` | Restart a container |
|
|
107
|
+
| `open <container>` | Open BC Web Client in browser |
|
|
108
|
+
| `apps <container>` | List apps (optional `--publisher`) |
|
|
109
|
+
| `install <container> <appFile>` | Install a .app file |
|
|
110
|
+
| `uninstall <container> <app> <publisher>` | Uninstall an app |
|
|
111
|
+
| `publish <container> <folder>` | Compile and publish an AL project |
|
|
112
|
+
| `test [container]` | Run AL tests (optional `--codeunit`, `--function`, `--app`) |
|
|
113
|
+
| `toolkit <container>` | Import test toolkit (`--full` for all) |
|
|
114
|
+
| `license <container> <file>` | Import a license file |
|
|
109
115
|
|
|
110
|
-
|
|
111
|
-
node dist/cli.js test bcsandbox
|
|
112
|
-
node dist/cli.js test bcsandbox --codeunit 50100
|
|
113
|
-
node dist/cli.js test bcsandbox --app "C:\Projects\MyApp.Test"
|
|
116
|
+
## MCP tools
|
|
114
117
|
|
|
115
|
-
|
|
116
|
-
node dist/cli.js toolkit bcsandbox
|
|
117
|
-
node dist/cli.js toolkit bcsandbox --full
|
|
118
|
+
The same 15 operations exposed as MCP tools for AI assistants:
|
|
118
119
|
|
|
119
|
-
|
|
120
|
-
node dist/cli.js license bcsandbox "C:\license.bclicense"
|
|
121
|
-
```
|
|
120
|
+
`list-containers` `container-info` `create-container` `remove-container` `start-container` `stop-container` `restart-container` `open-webclient` `list-apps` `install-app` `uninstall-app` `publish-project` `run-tests` `import-test-toolkit` `import-license`
|
|
122
121
|
|
|
123
|
-
|
|
122
|
+
## Naming
|
|
124
123
|
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
bcd
|
|
129
|
-
|
|
130
|
-
bcd apps mybc
|
|
131
|
-
```
|
|
124
|
+
| Term | What it is |
|
|
125
|
+
|------|------------|
|
|
126
|
+
| **`bcdocker`** | This npm package and GitHub repo. |
|
|
127
|
+
| **`bcd`** | The CLI command after global install (`npm i -g bcdocker`). |
|
|
128
|
+
| **`bcdocker-toolkit`** | The PowerShell + Windows UI repo (module **BCDocker**). Different repo. |
|
|
132
129
|
|
|
133
|
-
##
|
|
130
|
+
## Related
|
|
134
131
|
|
|
135
|
-
|
|
136
|
-
|---|---|
|
|
137
|
-
| `list-containers` | List all BC containers with status |
|
|
138
|
-
| `container-info` | Get version, status, and endpoints |
|
|
139
|
-
| `create-container` | Create a new BC container (5-30 min) |
|
|
140
|
-
| `remove-container` | Remove a container |
|
|
141
|
-
| `start-container` | Start a stopped container |
|
|
142
|
-
| `stop-container` | Stop a running container |
|
|
143
|
-
| `restart-container` | Restart a container |
|
|
144
|
-
| `list-apps` | List apps in a container |
|
|
145
|
-
| `install-app` | Install a .app file |
|
|
146
|
-
| `publish-project` | Compile and publish an AL project |
|
|
147
|
-
| `import-test-toolkit` | Import test toolkit |
|
|
148
|
-
| `import-license` | Import a license file |
|
|
149
|
-
| `run-tests` | Run AL tests |
|
|
150
|
-
|
|
151
|
-
## Architecture
|
|
132
|
+
- **[bcdocker-toolkit](https://github.com/olederkach/bcdocker-toolkit)** -- PowerShell module and Windows UI for Business Central Docker containers
|
|
152
133
|
|
|
153
|
-
|
|
154
|
-
bcd/
|
|
155
|
-
├── src/
|
|
156
|
-
│ ├── server.ts # MCP server — exposes tools over stdio
|
|
157
|
-
│ ├── cli.ts # CLI — same operations via command line
|
|
158
|
-
│ └── executor.ts # PowerShell 5.1 execution layer
|
|
159
|
-
├── dist/ # Compiled JS (after npm run build)
|
|
160
|
-
├── package.json
|
|
161
|
-
├── tsconfig.json
|
|
162
|
-
└── README.md
|
|
163
|
-
```
|
|
134
|
+
## License
|
|
164
135
|
|
|
165
|
-
|
|
136
|
+
MIT
|
package/dist/cli-main.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { resolve } from "node:path";
|
|
3
|
+
import { fileURLToPath } from "node:url";
|
|
4
|
+
import { runCli } from "./cli.js";
|
|
5
|
+
const isMainModule = process.argv[1] &&
|
|
6
|
+
resolve(fileURLToPath(import.meta.url)) === resolve(process.argv[1]);
|
|
7
|
+
if (isMainModule) {
|
|
8
|
+
runCli(process.argv).catch((err) => {
|
|
9
|
+
console.error("Error:", err.message);
|
|
10
|
+
process.exit(1);
|
|
11
|
+
});
|
|
12
|
+
}
|
package/dist/cli.d.ts
CHANGED