@poolzin/plcode 2.1.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.
Files changed (4) hide show
  1. package/LICENSE +23 -0
  2. package/README.md +189 -0
  3. package/bin/plcode +90 -0
  4. package/package.json +48 -0
package/LICENSE ADDED
@@ -0,0 +1,23 @@
1
+
2
+
3
+ MIT License
4
+
5
+ Copyright (c) 2025 plcunha
6
+
7
+ Permission is hereby granted, free of charge, to any person obtaining a copy
8
+ of this software and associated documentation files (the "Software"), to deal
9
+ in the Software without restriction, including without limitation the rights
10
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+ copies of the Software, and to permit persons to whom the Software is
12
+ furnished to do so, subject to the following conditions:
13
+
14
+ The above copyright notice and this permission notice shall be included in all
15
+ copies or substantial portions of the Software.
16
+
17
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,189 @@
1
+ # PLCODE
2
+
3
+ <p align="center">
4
+ <strong>Terminal-first AI coding agent with multi-agent orchestration.</strong>
5
+ </p>
6
+
7
+ <p align="center">
8
+ <a href="https://www.npmjs.com/package/@poolzin/plcode"><img alt="npm" src="https://img.shields.io/npm/v/%40poolzin%2Fplcode?style=flat-square" /></a>
9
+ <a href="https://github.com/plcunha/PLCODE/actions/workflows/ci.yml"><img alt="CI" src="https://img.shields.io/github/actions/workflow/status/plcunha/PLCODE/ci.yml?branch=main&style=flat-square" /></a>
10
+ <a href="https://github.com/plcunha/PLCODE/releases"><img alt="GitHub release" src="https://img.shields.io/github/v/release/plcunha/PLCODE?style=flat-square" /></a>
11
+ <a href="LICENSE"><img alt="License" src="https://img.shields.io/github/license/plcunha/PLCODE?style=flat-square" /></a>
12
+ </p>
13
+
14
+ PLCODE is an open-source coding agent for interactive terminal work, headless automation, and structured multi-agent development. It combines a fast TUI with **65 available agents**, **80 loaded skills**, MCP/LSP/ACP support, project-level instructions, diagnostics, and provider-independent model access.
15
+
16
+ ## Why PLCODE?
17
+
18
+ - **Terminal and headless workflows** — use the TUI, `plcode run`, ACP, or the HTTP server.
19
+ - **Specialized orchestration** — delegate work to bundled agents and reusable skills instead of relying on one generic prompt.
20
+ - **Provider-independent** — configure OpenAI, Anthropic, Google, OpenRouter, local or OpenAI-compatible endpoints.
21
+ - **Project-aware** — load agents, skills, instructions, permissions, and MCP servers from `.plcode/`.
22
+ - **Built for real repositories** — Git integration, LSP, sessions, task tracking, statistics, and diagnostics.
23
+ - **Native binaries** — npm installs a small Node launcher and the correct compiled binary for the current platform.
24
+
25
+ ## Installation
26
+
27
+ ### npm (recommended)
28
+
29
+ ```bash
30
+ npm install -g @poolzin/plcode
31
+ plcode --version
32
+ plcode doctor
33
+ ```
34
+
35
+ Node.js 18 or newer is required only by the npm launcher. PLCODE itself runs as a compiled native binary; Bun is not required after installation.
36
+
37
+ Optional dependencies must be enabled. If your package manager disables them, reinstall with:
38
+
39
+ ```bash
40
+ npm install -g @poolzin/plcode --include=optional
41
+ ```
42
+
43
+ ### Install script
44
+
45
+ Linux and macOS:
46
+
47
+ ```bash
48
+ curl -fsSL https://raw.githubusercontent.com/plcunha/PLCODE/main/install | bash
49
+ ```
50
+
51
+ Windows PowerShell:
52
+
53
+ ```powershell
54
+ irm https://raw.githubusercontent.com/plcunha/PLCODE/main/install.ps1 | iex
55
+ ```
56
+
57
+ ### Supported binaries
58
+
59
+ | Platform | Architectures | Notes |
60
+ | -------- | ------------- | ---------------------------------------------------- |
61
+ | Linux | x64, arm64 | glibc and musl; portable x64 baseline build included |
62
+ | macOS | x64, arm64 | Intel and Apple Silicon |
63
+ | Windows | x64 | Native executable |
64
+
65
+ ## Quick start
66
+
67
+ ```bash
68
+ # Interactive first-time setup
69
+ plcode init
70
+
71
+ # Authenticate a provider
72
+ plcode auth login
73
+
74
+ # Inspect available models
75
+ plcode models
76
+
77
+ # Start the TUI in the current repository
78
+ plcode
79
+
80
+ # Run a headless task
81
+ plcode run "Review this repository and fix the failing tests"
82
+
83
+ # Select a model explicitly
84
+ plcode --model openai/gpt-5.2
85
+ ```
86
+
87
+ Run `plcode --help` or `plcode <command> --help` for the live command reference.
88
+
89
+ ## Core commands
90
+
91
+ | Command | Purpose |
92
+ | ---------------------- | --------------------------------------- |
93
+ | `plcode [project]` | Start the interactive TUI |
94
+ | `plcode run [message]` | Execute a headless task |
95
+ | `plcode init` | Run first-time setup |
96
+ | `plcode auth login` | Configure provider credentials |
97
+ | `plcode models` | List available models |
98
+ | `plcode doctor` | Diagnose installation and configuration |
99
+ | `plcode agent list` | List available agents |
100
+ | `plcode skill list` | List available skills |
101
+ | `plcode session` | Manage sessions |
102
+ | `plcode serve` | Start the headless HTTP server |
103
+ | `plcode acp` | Start the Agent Client Protocol server |
104
+ | `plcode stats` | Show token usage and cost statistics |
105
+ | `plcode tools` | Inspect available tools |
106
+
107
+ ## Configuration
108
+
109
+ PLCODE supports JSON and JSONC configuration. The usual locations are:
110
+
111
+ - project: `.plcode/plcode.jsonc`
112
+ - user: `$XDG_CONFIG_HOME/plcode/plcode.jsonc`
113
+ - Linux default user path: `~/.config/plcode/plcode.jsonc`
114
+
115
+ Minimal project configuration:
116
+
117
+ ```jsonc
118
+ {
119
+ "$schema": "https://raw.githubusercontent.com/plcunha/PLCODE/main/packages/plcode/opencode/src/config/plcode.schema.json",
120
+ "model": "openai/gpt-5.2",
121
+ "permission": {
122
+ "bash": "ask",
123
+ "write": "ask",
124
+ },
125
+ }
126
+ ```
127
+
128
+ Project resources can be committed alongside the code:
129
+
130
+ ```text
131
+ .plcode/
132
+ ├── AGENTS.md # repository instructions
133
+ ├── agent/ # custom agents
134
+ ├── skill/ # reusable skills
135
+ ├── instructions/ # additional instruction files
136
+ └── plcode.jsonc # project configuration
137
+ ```
138
+
139
+ Credentials should be added with `plcode auth login`, not committed to configuration files.
140
+
141
+ ## Documentation
142
+
143
+ - [Documentation index](docs/README.md)
144
+ - [Getting started](docs/user/getting-started.md)
145
+ - [Installation verification and repair](docs/user/installation-verification.md)
146
+ - [MCP troubleshooting](docs/user/mcp-troubleshooting.md)
147
+ - [Architecture](docs/developer/architecture.md)
148
+ - [Testing](docs/developer/testing.md)
149
+ - [Contributing](docs/developer/contributing.md)
150
+ - [npm release process](docs/developer/npm-release.md)
151
+
152
+ Historical implementation reports are kept under `docs/archive/`; they are not current user documentation.
153
+
154
+ ## Development
155
+
156
+ PLCODE uses Bun **1.3.14** and a Bun workspace.
157
+
158
+ ```bash
159
+ git clone https://github.com/plcunha/PLCODE.git
160
+ cd PLCODE
161
+ bun install --frozen-lockfile
162
+
163
+ # Typecheck all workspaces (builds dependencies in the correct order)
164
+ bun run typecheck
165
+
166
+ # Full test suite
167
+ bun turbo test
168
+
169
+ # Run from source
170
+ bun run plcode
171
+
172
+ # Build a native binary for the current Linux x64 target
173
+ bun run plcode:build:target linux-x64
174
+ ```
175
+
176
+ See [the testing guide](docs/developer/testing.md) before submitting a pull request.
177
+
178
+ ## Security
179
+
180
+ - Review permission rules before enabling unattended execution.
181
+ - Keep provider credentials out of Git and use `plcode auth login`.
182
+ - Treat third-party plugins, skills, MCP servers, and shell commands as executable code.
183
+ - Report vulnerabilities privately through [GitHub Security Advisories](https://github.com/plcunha/PLCODE/security/advisories/new).
184
+
185
+ ## Project status
186
+
187
+ PLCODE is actively developed. CLI and configuration behavior may evolve between minor releases; release notes document material changes.
188
+
189
+ PLCODE builds on ideas and code from the open-source [OpenCode](https://github.com/anomalyco/opencode) ecosystem and is distributed under the [MIT License](LICENSE).
package/bin/plcode ADDED
@@ -0,0 +1,90 @@
1
+ #!/usr/bin/env node
2
+ "use strict"
3
+
4
+ // PLCODE npm launcher: resolves a compatible native package and inherits cwd.
5
+
6
+ const fs = require("node:fs")
7
+ const os = require("node:os")
8
+ const path = require("node:path")
9
+ const { execFileSync, spawnSync } = require("node:child_process")
10
+
11
+ function fail(message) {
12
+ console.error(`plcode: ${message}`)
13
+ process.exit(1)
14
+ }
15
+
16
+ function run(target) {
17
+ const result = spawnSync(target, process.argv.slice(2), { stdio: "inherit" })
18
+ if (result.error) fail(result.error.message)
19
+ if (result.signal) {
20
+ try {
21
+ process.kill(process.pid, result.signal)
22
+ } catch {
23
+ process.exit(1)
24
+ }
25
+ }
26
+ process.exit(result.status ?? 1)
27
+ }
28
+
29
+ if (process.env.PLCODE_BIN_PATH) run(process.env.PLCODE_BIN_PATH)
30
+
31
+ const platform = { darwin: "darwin", linux: "linux", win32: "windows" }[os.platform()]
32
+ const arch = { x64: "x64", arm64: "arm64" }[os.arch()]
33
+ if (!platform || !arch) fail(`unsupported platform: ${os.platform()}-${os.arch()}`)
34
+
35
+ function isMusl() {
36
+ if (platform !== "linux") return false
37
+ try {
38
+ return !process.report?.getReport()?.header?.glibcVersionRuntime
39
+ } catch {
40
+ return false
41
+ }
42
+ }
43
+
44
+ function hasAvx2() {
45
+ if (arch !== "x64") return true
46
+ try {
47
+ if (platform === "linux") {
48
+ return /(?:^|\s)avx2(?:\s|$)/im.test(fs.readFileSync("/proc/cpuinfo", "utf8"))
49
+ }
50
+ if (platform === "darwin") {
51
+ const features = execFileSync("/usr/sbin/sysctl", ["-n", "machdep.cpu.leaf7_features"], {
52
+ encoding: "utf8",
53
+ })
54
+ return /(?:^|\s)AVX2(?:\s|$)/i.test(features)
55
+ }
56
+ } catch {
57
+ // Prefer the portable build when CPU capabilities cannot be determined.
58
+ }
59
+ return false
60
+ }
61
+
62
+ function packageCandidates() {
63
+ const base = `plcode-${platform}-${arch}`
64
+ const libc = platform === "linux" && isMusl() ? "-musl" : ""
65
+ if (arch === "x64") {
66
+ if (hasAvx2()) return [`${base}${libc}`, `${base}-baseline${libc}`]
67
+ return [`${base}-baseline${libc}`]
68
+ }
69
+ return [`${base}${libc}`]
70
+ }
71
+
72
+ const scriptDir = path.dirname(fs.realpathSync(__filename))
73
+ const binaryName = platform === "windows" ? "plcode.exe" : "plcode"
74
+ const candidates = packageCandidates()
75
+
76
+ for (const packageName of candidates) {
77
+ try {
78
+ const manifest = require.resolve(`${packageName}/package.json`, { paths: [scriptDir] })
79
+ const binary = path.join(path.dirname(manifest), "bin", binaryName)
80
+ if (fs.existsSync(binary)) run(binary)
81
+ } catch {
82
+ // Try the next compatible package (for example the x64 baseline build).
83
+ }
84
+ }
85
+
86
+ fail(
87
+ `no compatible native package was installed for ${os.platform()}-${os.arch()}. ` +
88
+ `Expected one of: ${candidates.join(", ")}. ` +
89
+ `Reinstall with optional dependencies enabled: npm install -g plcode --include=optional`,
90
+ )
package/package.json ADDED
@@ -0,0 +1,48 @@
1
+ {
2
+ "name": "@poolzin/plcode",
3
+ "version": "2.1.1",
4
+ "description": "AI coding agent with multi-agent orchestration, 65 available agents, and a terminal-first workflow",
5
+ "license": "MIT",
6
+ "bin": {
7
+ "plcode": "bin/plcode"
8
+ },
9
+ "files": [
10
+ "bin",
11
+ "README.md",
12
+ "LICENSE"
13
+ ],
14
+ "engines": {
15
+ "node": ">=18"
16
+ },
17
+ "repository": {
18
+ "type": "git",
19
+ "url": "git+https://github.com/plcunha/PLCODE.git"
20
+ },
21
+ "homepage": "https://github.com/plcunha/PLCODE#readme",
22
+ "bugs": {
23
+ "url": "https://github.com/plcunha/PLCODE/issues"
24
+ },
25
+ "keywords": [
26
+ "ai",
27
+ "coding-agent",
28
+ "cli",
29
+ "terminal",
30
+ "multi-agent",
31
+ "developer-tools",
32
+ "llm",
33
+ "mcp"
34
+ ],
35
+ "optionalDependencies": {
36
+ "plcode-darwin-arm64": "2.1.1",
37
+ "plcode-darwin-x64": "2.1.1",
38
+ "plcode-darwin-x64-baseline": "2.1.1",
39
+ "plcode-linux-arm64": "2.1.1",
40
+ "plcode-linux-arm64-musl": "2.1.1",
41
+ "plcode-linux-x64": "2.1.1",
42
+ "plcode-linux-x64-baseline": "2.1.1",
43
+ "plcode-linux-x64-baseline-musl": "2.1.1",
44
+ "plcode-linux-x64-musl": "2.1.1",
45
+ "plcode-windows-x64": "2.1.1",
46
+ "plcode-windows-x64-baseline": "2.1.1"
47
+ }
48
+ }