raykit 0.0.0-stage → 0.3.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 +129 -2
- package/THIRD_PARTY_NOTICES.txt +1888 -0
- package/bin/raykit.mjs +33 -0
- package/lib/platform.mjs +16 -0
- package/native/raykit-darwin-amd64 +0 -0
- package/native/raykit-darwin-arm64 +0 -0
- package/native/raykit-linux-amd64 +0 -0
- package/native/raykit-linux-arm64 +0 -0
- package/native/raykit-windows-amd64.exe +0 -0
- package/package.json +22 -4
package/README.md
CHANGED
|
@@ -1,3 +1,130 @@
|
|
|
1
|
-
#
|
|
1
|
+
# raykit
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
A Go-powered CLI with two command names: **`kit`** and **`raykit`**.
|
|
4
|
+
|
|
5
|
+
```sh
|
|
6
|
+
npm install -g raykit --registry=https://registry.npmjs.org
|
|
7
|
+
kit --help
|
|
8
|
+
raykit version
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
Requires Node.js 20 or later. Go is not required. The package includes native
|
|
12
|
+
binaries for macOS arm64/x64, Linux arm64/x64, and Windows x64. Installation
|
|
13
|
+
does not run a download script or fetch binaries from a separate website.
|
|
14
|
+
|
|
15
|
+
## Production SQL
|
|
16
|
+
|
|
17
|
+
Production SQL access requires an authorized company DingTalk account. Install
|
|
18
|
+
Google Chrome or Chromium before starting browser login.
|
|
19
|
+
|
|
20
|
+
```sh
|
|
21
|
+
kit sql prod auth login
|
|
22
|
+
kit sql prod auth status --online
|
|
23
|
+
kit sql prod db list
|
|
24
|
+
kit sql prod query --help
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Use `query --db <instance-id> --schema <schema-name> --file query.sql` to run a
|
|
28
|
+
single read-only statement. Production commands do not support writes.
|
|
29
|
+
The SQL service is organization-specific; installing this public package does
|
|
30
|
+
not grant an account or database permissions.
|
|
31
|
+
|
|
32
|
+
Raykit automatically opens DingTalk login when the shared session
|
|
33
|
+
is missing, expired, or rejected. Complete browser authorization and the CLI
|
|
34
|
+
resumes the operation without another command or chat confirmation. It attempts
|
|
35
|
+
login at most once per command. `--auth-wait` (default 5 minutes) and
|
|
36
|
+
`--auth-browser` control automatic login. Local status, logout, SQL operations
|
|
37
|
+
dry-run and test execution dry-run stay offline. DDL generation dry-run reads
|
|
38
|
+
live metadata. Ambiguous SQL submissions are not replayed.
|
|
39
|
+
|
|
40
|
+
## SQL operations submissions
|
|
41
|
+
|
|
42
|
+
`sql ops` reuses `sql prod auth login` and submits a task for review through the SQL
|
|
43
|
+
operations service. It does not approve or execute the task.
|
|
44
|
+
|
|
45
|
+
```sh
|
|
46
|
+
kit sql ops targets
|
|
47
|
+
kit sql ops submit --title 'Cloud account fix' --target cloud-zdf --file fix.sql --dry-run
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
Remove `--dry-run` to submit. Each SQL statement must occupy one line and end
|
|
51
|
+
with `;`. Use `cloud-main`, `cloud-1`, or `cloud-zdf` for the cloud-account
|
|
52
|
+
presets, or specify `--schema` explicitly. For another RDS, also provide both
|
|
53
|
+
`--rds-name` and `--rds-url`. A timeout is not proof of failure: check the task
|
|
54
|
+
system before resubmitting.
|
|
55
|
+
|
|
56
|
+
## Test MySQL
|
|
57
|
+
|
|
58
|
+
Test commands connect to the configured organization's test MySQL host.
|
|
59
|
+
Use your authorized test database account and supply the password through stdin:
|
|
60
|
+
|
|
61
|
+
```sh
|
|
62
|
+
kit sql test config init --user YOUR_USER --password-stdin < password.txt
|
|
63
|
+
kit sql test ping
|
|
64
|
+
kit sql test db list
|
|
65
|
+
kit sql test query --db YOUR_DATABASE --file query.sql
|
|
66
|
+
kit sql test exec --db YOUR_DATABASE --file change.sql --dry-run
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
Removing `--dry-run` submits and commits the modification. Both SQL inputs accept
|
|
70
|
+
`--sql` or `--file`; use `--file -` to read stdin. Results default to JSON;
|
|
71
|
+
`--output table` displays successful query rows as a table.
|
|
72
|
+
|
|
73
|
+
## Company information
|
|
74
|
+
|
|
75
|
+
Use `company info --name NAME` or `company info --id ID`
|
|
76
|
+
to look up company identity, trade/report database shards, table shards and
|
|
77
|
+
cloud-account routing. Use `--all-tables` to include the complete table-shard
|
|
78
|
+
map. It shares the SQL login session.
|
|
79
|
+
|
|
80
|
+
## Local credentials
|
|
81
|
+
|
|
82
|
+
Each user authenticates independently. Cookies and passwords are stored in that
|
|
83
|
+
user's configuration directory, with private file permissions on POSIX systems.
|
|
84
|
+
They are not part of this npm package. Production sessions have a maximum local
|
|
85
|
+
lifetime of 12 hours. `--config-dir` or `RAYKIT_CONFIG_DIR` selects an independent
|
|
86
|
+
configuration directory.
|
|
87
|
+
|
|
88
|
+
```sh
|
|
89
|
+
kit sql prod auth logout
|
|
90
|
+
npm install -g raykit@latest --registry=https://registry.npmjs.org
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
Source code licensing has not been granted for Raykit (`UNLICENSED`). Licenses
|
|
94
|
+
and source references for bundled third-party components are provided in
|
|
95
|
+
`THIRD_PARTY_NOTICES.txt`.
|
|
96
|
+
|
|
97
|
+
## Cloud-account batch DDL
|
|
98
|
+
|
|
99
|
+
`sql ddl generate --file change.sql` expands table DDL across two test schemas
|
|
100
|
+
and three production schemas. Existing-table changes use real metadata; CREATE
|
|
101
|
+
TABLE uses tenant routing. It prints and saves test SQL and submits production
|
|
102
|
+
SQL for review, one task per nonempty schema. It never directly executes DDL.
|
|
103
|
+
Use `--dry-run` to discover metadata and generate files without submitting.
|
|
104
|
+
Default output is grouped SQL text; `--output json` includes per-schema status.
|
|
105
|
+
Run artifacts preserve partial submission results; check them before rerunning a
|
|
106
|
+
failed batch.
|
|
107
|
+
|
|
108
|
+
## Project compilation and deployment
|
|
109
|
+
|
|
110
|
+
```sh
|
|
111
|
+
kit project compile YOUR_PROJECT_GRAY3
|
|
112
|
+
kit project deploy YOUR_PROJECT_GRAY3
|
|
113
|
+
kit project compile 云账灰度3web --branch feature/example
|
|
114
|
+
kit project auth set
|
|
115
|
+
kit project auth status
|
|
116
|
+
kit project auth logout
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
Replace `YOUR_PROJECT_GRAY3` with the actual project local name containing
|
|
120
|
+
`gray1` through `gray8`; production projects are not supported. `compile`
|
|
121
|
+
(alias `build`) only compiles. `deploy` (alias `publish`) compiles before
|
|
122
|
+
deploying and waits for the result. Multiple project names run sequentially.
|
|
123
|
+
Omitting `--branch` uses each project's effective saved branch, with the locked
|
|
124
|
+
branch taking precedence. `--timeout` and `--wait-timeout` default to 30 minutes.
|
|
125
|
+
|
|
126
|
+
The release service uses a separate local publishing code. Interactive commands
|
|
127
|
+
prompt when it is missing; automation can save it with
|
|
128
|
+
`kit project auth set --code-stdin`. Do not put credentials in command arguments.
|
|
129
|
+
Progress is written to stderr and the final result to stdout. On an uncertain
|
|
130
|
+
result, check the release service before repeating a compilation or deployment.
|