@reporting-bi/cli 0.0.2
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 +53 -0
- package/dist/index.js +3536 -0
- package/package.json +31 -0
package/README.md
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# rp-cli
|
|
2
|
+
|
|
3
|
+
Command-line interface for Reporting.bi platform.
|
|
4
|
+
|
|
5
|
+
## Overview
|
|
6
|
+
|
|
7
|
+
`rp-cli` provides terminal access to Reporting.bi services — managing accountings, ETL threads, SQL execution, and other platform operations. It communicates with the Reporting.bi API via `@reporting/rp-client`.
|
|
8
|
+
|
|
9
|
+
One of the primary goals is to serve as a tool interface for AI agents (e.g. Claude Code, Cursor, Copilot), enabling them to interact with the Reporting.bi platform programmatically — query data, manage ETL, execute SQL, and perform administrative tasks without a browser.
|
|
10
|
+
|
|
11
|
+
## Architecture
|
|
12
|
+
|
|
13
|
+
```
|
|
14
|
+
rp-cli (this package)
|
|
15
|
+
├── @reporting/rp-auth-client-v2 (shared auth client)
|
|
16
|
+
├── @reporting/rp-client (shared API client)
|
|
17
|
+
└── @reporting/rp-types (auto-generated types from PHP)
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
### Shared packages
|
|
21
|
+
|
|
22
|
+
**`rp-client`** — Generic HTTP client for Reporting.bi microservices. Both `rp-cli` and `rp-vscode` use it for API communication. Common API logic (service instantiation, endpoint methods, accounting context) lives here. Consumer packages only contain UI/interaction-specific code.
|
|
23
|
+
|
|
24
|
+
**Refactoring note:** Higher-level API methods currently in `rp-vscode/src/api.ts` (e.g. `getThreads`, `execSql`, `getAccountings`) are being moved into `rp-client` so they can be shared across consumers.
|
|
25
|
+
|
|
26
|
+
**`rp-auth-client-v2`** — Unified authentication client for all consumers (rp-cli, rp-vscode, rp-app-auth). Handles OAuth2 authorization code flow, token exchange, refresh, and revocation via `rp-ms-auth`.
|
|
27
|
+
|
|
28
|
+
Originally built for browser use (`rp-app-auth` login page), it may require adaptations for Node.js environments (e.g. token storage, redirect handling, `fetch` availability). Any changes must preserve backward compatibility with the browser-based login flow in `rp-app-auth`.
|
|
29
|
+
|
|
30
|
+
**Important:** `rp-vscode` currently has its own auth implementation (`src/auth.ts`) with VS Code-specific OAuth2 flow (local HTTP callback server, VS Code secrets storage). This will be refactored to use `rp-auth-client-v2` instead, keeping only VS Code-specific concerns (secrets API, URI handler) in the extension.
|
|
31
|
+
|
|
32
|
+
## Planned Features
|
|
33
|
+
|
|
34
|
+
- **Authentication** — Login via `rp-auth-client-v2` (OAuth2, token storage & refresh)
|
|
35
|
+
- **ETL management** — List, view, edit, and execute ETL threads
|
|
36
|
+
- **SQL execution** — Run SQL queries against Reporting.bi databases
|
|
37
|
+
- **Accounting management** — List and switch between accountings
|
|
38
|
+
- **Schema inspection** — Browse database objects (tables, procedures, functions)
|
|
39
|
+
- **Module management** — List accounting modules and definitions
|
|
40
|
+
|
|
41
|
+
## Tech Stack
|
|
42
|
+
|
|
43
|
+
- Node.js + TypeScript
|
|
44
|
+
- `@reporting/rp-auth-client-v2` — Shared authentication client (OAuth2)
|
|
45
|
+
- `@reporting/rp-client` — HTTP client for Reporting.bi microservices
|
|
46
|
+
- `@reporting/rp-types` — Shared TypeScript types
|
|
47
|
+
|
|
48
|
+
## Development
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
yarn build # compile TypeScript
|
|
52
|
+
yarn watch # compile in watch mode
|
|
53
|
+
```
|