@klevar/portal-cli 0.1.0 → 0.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.
package/README.md CHANGED
@@ -7,7 +7,7 @@ First-class npm CLI for the Klevar Client Management Portal.
7
7
  Run without installing:
8
8
 
9
9
  ```bash
10
- npx klevar-portal help
10
+ npx @klevar/portal-cli help
11
11
  ```
12
12
 
13
13
  Install globally for repeated use:
@@ -34,33 +34,33 @@ Do not paste API keys, portal tokens, or production secrets into chat logs, issu
34
34
  ## Command Examples
35
35
 
36
36
  ```bash
37
- npx klevar-portal health
38
- npx klevar-portal tenant info
39
- npx klevar-portal clients list
40
- npx klevar-portal clients create --name "Stefan" --email "stefan@example.de" --platform direct
41
- npx klevar-portal projects create <clientId> --name "Idealo" --externalRef "idealo:ksh.de"
42
- npx klevar-portal metrics push --external_ref "idealo:ksh.de" --source_ref "run:33" --snapshot_date "2026-04-12" --metrics '{"score":88}'
43
- npx klevar-portal portal me --portal-token "<client-token>"
37
+ npx @klevar/portal-cli health
38
+ npx @klevar/portal-cli tenant info
39
+ npx @klevar/portal-cli clients list
40
+ npx @klevar/portal-cli clients create --name "Stefan" --email "stefan@example.de" --platform direct
41
+ npx @klevar/portal-cli projects create <clientId> --name "Idealo" --externalRef "idealo:ksh.de"
42
+ npx @klevar/portal-cli metrics push --external_ref "idealo:ksh.de" --source_ref "run:33" --snapshot_date "2026-04-12" --metrics '{"score":88}'
43
+ npx @klevar/portal-cli portal me --portal-token "<client-token>"
44
44
  ```
45
45
 
46
46
  ## Brain Usage
47
47
 
48
- Brain usage should prefer the published `npx klevar-portal` entrypoint.
48
+ Brain usage should prefer the published `npx @klevar/portal-cli` entrypoint.
49
49
 
50
50
  Brain agents should call:
51
51
 
52
52
  ```bash
53
- npx klevar-portal <resource> <action> [id] [--key value]
53
+ npx @klevar/portal-cli <resource> <action> [id] [--key value]
54
54
  ```
55
55
 
56
56
  The local compatibility wrapper remains available for old automation after a build:
57
57
 
58
58
  ```bash
59
59
  npm run cli:build
60
- node tools/client.js clients list
60
+ klevar-portal clients list
61
61
  ```
62
62
 
63
- New automation should use `npx klevar-portal`.
63
+ New automation should use `npx @klevar/portal-cli`.
64
64
 
65
65
  ## Auth Modes
66
66
 
@@ -5,13 +5,15 @@
5
5
  * Uses X-API-Key header for authentication.
6
6
  *
7
7
  * Usage:
8
- * node client.js <resource> <action> [id] [--key value ...]
8
+ * klevar-portal <resource> <action> [id] [--key value ...]
9
+ * npx @klevar/portal-cli <resource> <action> [id] [--key value ...]
9
10
  *
10
11
  * Resources: clients, projects, tasks, updates, onboarding, dashboard, token
11
12
  *
12
13
  * Config:
13
14
  * PORTAL_API_KEY — API key (env var or ~/.klevar/portal.env)
14
- * PORTAL_URL — API base URL (default: http://localhost:3000)
15
+ * PORTAL_API_URL - API base URL (default: http://127.0.0.1:3100)
16
+ * PORTAL_TOKEN - client portal token for portal commands
15
17
  *
16
18
  * To add a new API endpoint:
17
19
  * 1. Add an entry to COMMANDS: 'resource.action': { method, path, body? }
@@ -579,7 +581,8 @@ let [,, resource, action, ...rest] = process.argv;
579
581
 
580
582
  if (!resource || resource === 'help' || resource === '--help') {
581
583
  console.log('Klevar Client Portal CLI\n');
582
- console.log('Usage: node client.js <resource> <action> [id] [--key value ...]\n');
584
+ console.log('Usage: klevar-portal <resource> <action> [id] [--key value ...]');
585
+ console.log(' npx @klevar/portal-cli <resource> <action> [id] [--key value ...]\n');
583
586
  console.log('Commands:');
584
587
  const grouped = {};
585
588
  for (const [key, cmd] of Object.entries(COMMANDS)) {
@@ -594,7 +597,7 @@ if (!resource || resource === 'help' || resource === '--help') {
594
597
  console.log(` ${c.action || '(default)'} — ${c.desc}${bodyHint}`);
595
598
  }
596
599
  }
597
- console.log(`\nConfig: PORTAL_API_KEY, PORTAL_URL (or ~/.klevar/portal.env)`);
600
+ console.log(`\nConfig: PORTAL_API_URL, PORTAL_API_KEY, PORTAL_TOKEN (or ~/.klevar/portal.env)`);
598
601
  console.log(`Target: ${BASE_URL}`);
599
602
  process.exit(0);
600
603
  }
@@ -619,7 +622,7 @@ if (!cmd && COMMANDS[resource]) {
619
622
 
620
623
  if (!cmd) {
621
624
  console.error(`Unknown command: ${commandKey}`);
622
- console.error(`Run 'node client.js help' for available commands.`);
625
+ console.error(`Run 'klevar-portal help' for available commands.`);
623
626
  process.exit(1);
624
627
  }
625
628
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@klevar/portal-cli",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "First-class npm CLI for the Klevar Client Management Portal",
5
5
  "type": "module",
6
6
  "bin": {