pro-app 0.1.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 +15 -0
- package/bin/proapp.js +64 -0
- package/package.json +24 -0
package/README.md
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# pro-app
|
|
2
|
+
|
|
3
|
+
Connect Claude Code or Codex to your PROApp workspace.
|
|
4
|
+
|
|
5
|
+
```
|
|
6
|
+
npx pro-app
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
Adds PROApp to whichever assistant you have and opens PROApp sign-in in your browser. Sign in, click **Allow access**, done.
|
|
10
|
+
|
|
11
|
+
- `npx pro-app login` — sign in again
|
|
12
|
+
- `npx pro-app logout` — sign out
|
|
13
|
+
- `npx pro-app status` — show the connection
|
|
14
|
+
|
|
15
|
+
The assistant can only do what your PROApp role allows. Your company needs the AI Assistant add-on; ask your PROApp admin.
|
package/bin/proapp.js
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
'use strict';
|
|
3
|
+
// PROApp connector for local AI coding assistants. No credentials live here:
|
|
4
|
+
// sign-in happens in your browser on PROApp's own page, and each assistant
|
|
5
|
+
// stores its own token. Usage: npx pro-app [connect|login|logout|status|help]
|
|
6
|
+
const { spawnSync } = require('node:child_process');
|
|
7
|
+
|
|
8
|
+
const URL = 'https://www.pro-app.com/api/mcp';
|
|
9
|
+
const NAME = 'proapp';
|
|
10
|
+
const APPS = [
|
|
11
|
+
{ label: 'Claude Code', bin: 'claude',
|
|
12
|
+
add: ['mcp', 'add', '--transport', 'http', '--scope', 'user', '--client-id', 'proapp-claude-code', '--callback-port', '8766', NAME, URL],
|
|
13
|
+
remove: ['mcp', 'remove', NAME, '--scope', 'user'] },
|
|
14
|
+
{ label: 'Codex', bin: 'codex',
|
|
15
|
+
add: ['mcp', 'add', NAME, '--url', URL, '--oauth-client-id', 'proapp-codex'],
|
|
16
|
+
remove: ['mcp', 'remove', NAME] },
|
|
17
|
+
];
|
|
18
|
+
|
|
19
|
+
const run = (bin, args, quiet = false) => spawnSync(bin, args, { stdio: quiet ? 'ignore' : 'inherit', shell: false });
|
|
20
|
+
const installed = (bin) => {
|
|
21
|
+
const probe = spawnSync(bin, ['--version'], { stdio: 'ignore', shell: false });
|
|
22
|
+
return !probe.error && probe.status === 0;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
function pick(which) {
|
|
26
|
+
const apps = APPS.filter(app => installed(app.bin));
|
|
27
|
+
const chosen = which ? apps.filter(app => app.bin === which || app.label.toLowerCase().startsWith(which)) : apps;
|
|
28
|
+
if (!apps.length) {
|
|
29
|
+
console.error('Neither Claude Code nor Codex was found. Install one, then run: npx pro-app');
|
|
30
|
+
process.exit(1);
|
|
31
|
+
}
|
|
32
|
+
if (!chosen.length) {
|
|
33
|
+
console.error(`"${which}" is not installed. Found: ${apps.map(a => a.bin).join(', ')}`);
|
|
34
|
+
process.exit(1);
|
|
35
|
+
}
|
|
36
|
+
return chosen;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
function connect(which) {
|
|
40
|
+
for (const app of pick(which)) {
|
|
41
|
+
run(app.bin, app.remove, true);
|
|
42
|
+
if (run(app.bin, app.add, true).status !== 0) { console.error(`Could not add PROApp to ${app.label}.`); continue; }
|
|
43
|
+
console.log(`\nPROApp added to ${app.label}. Opening sign-in in your browser...`);
|
|
44
|
+
if (run(app.bin, ['mcp', 'login', NAME]).status !== 0) console.log(`Finish later with: npx pro-app login ${app.bin}`);
|
|
45
|
+
else console.log(`${app.label} is connected to PROApp.`);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
const [command = 'connect', which] = process.argv.slice(2);
|
|
50
|
+
switch (command) {
|
|
51
|
+
case 'connect': connect(which); break;
|
|
52
|
+
case 'login': for (const app of pick(which)) run(app.bin, ['mcp', 'login', NAME]); break;
|
|
53
|
+
case 'logout': for (const app of pick(which)) run(app.bin, ['mcp', 'logout', NAME]); break;
|
|
54
|
+
case 'status': for (const app of pick(which)) { console.log(`\n${app.label}:`); run(app.bin, ['mcp', 'get', NAME]); } break;
|
|
55
|
+
default:
|
|
56
|
+
console.log(`PROApp for Claude Code and Codex
|
|
57
|
+
|
|
58
|
+
npx pro-app connect (adds PROApp and opens sign-in)
|
|
59
|
+
npx pro-app login sign in again
|
|
60
|
+
npx pro-app logout sign out
|
|
61
|
+
npx pro-app status show the connection
|
|
62
|
+
|
|
63
|
+
Add "claude" or "codex" to act on just one. Your company needs the PROApp AI Assistant add-on.`);
|
|
64
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "pro-app",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Connect Claude Code or Codex to your PROApp workspace.",
|
|
5
|
+
"bin": {
|
|
6
|
+
"pro-app": "bin/proapp.js"
|
|
7
|
+
},
|
|
8
|
+
"files": [
|
|
9
|
+
"bin",
|
|
10
|
+
"README.md"
|
|
11
|
+
],
|
|
12
|
+
"engines": {
|
|
13
|
+
"node": ">=18"
|
|
14
|
+
},
|
|
15
|
+
"homepage": "https://www.proapphub.com",
|
|
16
|
+
"keywords": [
|
|
17
|
+
"proapp",
|
|
18
|
+
"mcp",
|
|
19
|
+
"claude",
|
|
20
|
+
"codex"
|
|
21
|
+
],
|
|
22
|
+
"license": "UNLICENSED",
|
|
23
|
+
"author": "PROApp"
|
|
24
|
+
}
|