@rawdash/cli 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/LICENSE +202 -0
- package/README.md +67 -0
- package/dist/bin.js +388 -0
- package/dist/bin.js.map +1 -0
- package/package.json +43 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright [yyyy] [name of copyright owner]
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|
package/README.md
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
# @rawdash/cli
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/@rawdash/cli)
|
|
4
|
+
[](https://github.com/rawdash/rawdash/blob/main/LICENSE)
|
|
5
|
+
|
|
6
|
+
Deploy and manage your rawdash config from the terminal.
|
|
7
|
+
|
|
8
|
+
## What it is
|
|
9
|
+
|
|
10
|
+
`@rawdash/cli` is the command-line interface for rawdash. It lets you validate your config locally, deploy it to the rawdash server, and manage secrets — all from your terminal or CI pipeline. It reads your `rawdash.config.ts` file and communicates with the rawdash API.
|
|
11
|
+
|
|
12
|
+
## Install
|
|
13
|
+
|
|
14
|
+
```sh
|
|
15
|
+
npm install -g @rawdash/cli
|
|
16
|
+
# or use without installing:
|
|
17
|
+
npx @rawdash/cli <command>
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
Requires Node.js 24+.
|
|
21
|
+
|
|
22
|
+
## Quick example
|
|
23
|
+
|
|
24
|
+
```sh
|
|
25
|
+
# Validate your config file locally (no network)
|
|
26
|
+
npx @rawdash/cli validate
|
|
27
|
+
|
|
28
|
+
# Preview what would change before deploying
|
|
29
|
+
npx @rawdash/cli deploy --dry-run
|
|
30
|
+
|
|
31
|
+
# Deploy to the server
|
|
32
|
+
RAWDASH_API_KEY=your-key npx @rawdash/cli deploy
|
|
33
|
+
|
|
34
|
+
# Manage secrets
|
|
35
|
+
npx @rawdash/cli secrets set GITHUB_TOKEN ghp_...
|
|
36
|
+
npx @rawdash/cli secrets list
|
|
37
|
+
npx @rawdash/cli secrets remove GITHUB_TOKEN
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## Commands
|
|
41
|
+
|
|
42
|
+
| Command | Description |
|
|
43
|
+
| ---------------------------- | -------------------------------------------------------------------------------- |
|
|
44
|
+
| `validate` | Validate `rawdash.config.ts` locally without network access |
|
|
45
|
+
| `deploy` | Deploy config to the server (use `--dry-run` to preview, `--yes` to skip prompt) |
|
|
46
|
+
| `secrets set <name> [value]` | Set a secret (reads from stdin if value is omitted) |
|
|
47
|
+
| `secrets list` | List all secret names and last-rotation timestamps |
|
|
48
|
+
| `secrets remove <name>` | Delete a secret |
|
|
49
|
+
|
|
50
|
+
## Configuration
|
|
51
|
+
|
|
52
|
+
The CLI expects the following environment variables:
|
|
53
|
+
|
|
54
|
+
| Variable | Required | Description |
|
|
55
|
+
| ----------------- | ------------------------ | ------------------------------------------------ |
|
|
56
|
+
| `RAWDASH_API_KEY` | Yes (for deploy/secrets) | API key for the rawdash server |
|
|
57
|
+
| `RAWDASH_URL` | No | Server base URL (defaults to the hosted service) |
|
|
58
|
+
|
|
59
|
+
## Links
|
|
60
|
+
|
|
61
|
+
- [rawdash docs](https://rawdash.dev)
|
|
62
|
+
- [GitHub](https://github.com/rawdash/rawdash)
|
|
63
|
+
- [Issues](https://github.com/rawdash/rawdash/issues)
|
|
64
|
+
|
|
65
|
+
## License
|
|
66
|
+
|
|
67
|
+
Apache-2.0
|
package/dist/bin.js
ADDED
|
@@ -0,0 +1,388 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
// src/bin.ts
|
|
4
|
+
import { Command as Command4 } from "commander";
|
|
5
|
+
|
|
6
|
+
// src/commands/deploy.ts
|
|
7
|
+
import { confirm, isCancel, spinner } from "@clack/prompts";
|
|
8
|
+
import { Command } from "commander";
|
|
9
|
+
|
|
10
|
+
// src/lib/env.ts
|
|
11
|
+
function getEnv() {
|
|
12
|
+
return {
|
|
13
|
+
url: process.env["RAWDASH_URL"] ?? "https://api.rawdash.dev",
|
|
14
|
+
apiKey: process.env["RAWDASH_API_KEY"]
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
function requireApiKey() {
|
|
18
|
+
const { apiKey } = getEnv();
|
|
19
|
+
if (!apiKey) {
|
|
20
|
+
console.error("RAWDASH_API_KEY is not set. Set it in your environment.");
|
|
21
|
+
process.exit(3);
|
|
22
|
+
}
|
|
23
|
+
return apiKey;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
// src/lib/api-client.ts
|
|
27
|
+
var DEFAULT_TIMEOUT_MS = 1e4;
|
|
28
|
+
var ApiError = class extends Error {
|
|
29
|
+
constructor(message, status) {
|
|
30
|
+
super(message);
|
|
31
|
+
this.status = status;
|
|
32
|
+
this.name = "ApiError";
|
|
33
|
+
}
|
|
34
|
+
status;
|
|
35
|
+
};
|
|
36
|
+
async function postConfig(config, dryRun) {
|
|
37
|
+
const { url, apiKey } = getEnv();
|
|
38
|
+
const endpoint = `${url}/config${dryRun ? "?dryRun=true" : ""}`;
|
|
39
|
+
let res;
|
|
40
|
+
try {
|
|
41
|
+
res = await fetch(endpoint, {
|
|
42
|
+
method: "POST",
|
|
43
|
+
headers: {
|
|
44
|
+
"Content-Type": "application/json",
|
|
45
|
+
Authorization: `Bearer ${apiKey ?? ""}`
|
|
46
|
+
},
|
|
47
|
+
body: JSON.stringify(config),
|
|
48
|
+
signal: AbortSignal.timeout(DEFAULT_TIMEOUT_MS)
|
|
49
|
+
});
|
|
50
|
+
} catch (err) {
|
|
51
|
+
const isTimeout = err instanceof Error && (err.name === "AbortError" || err.name === "TimeoutError");
|
|
52
|
+
return {
|
|
53
|
+
ok: false,
|
|
54
|
+
error: isTimeout ? "Request timed out" : `Network error: ${err instanceof Error ? err.message : String(err)}`,
|
|
55
|
+
status: 0
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
if (res.ok) {
|
|
59
|
+
return res.json();
|
|
60
|
+
}
|
|
61
|
+
return buildDeployFailure(res);
|
|
62
|
+
}
|
|
63
|
+
async function buildDeployFailure(res) {
|
|
64
|
+
let body = {};
|
|
65
|
+
try {
|
|
66
|
+
body = await res.json();
|
|
67
|
+
} catch (e) {
|
|
68
|
+
console.warn("Could not parse error response body:", e);
|
|
69
|
+
}
|
|
70
|
+
const rawMessage = body.error ?? body.message ?? res.statusText;
|
|
71
|
+
let error;
|
|
72
|
+
if (res.status === 401) {
|
|
73
|
+
error = `API key invalid or revoked. Check RAWDASH_API_KEY. (${rawMessage})`;
|
|
74
|
+
} else if (res.status === 403) {
|
|
75
|
+
error = `Key lacks config:write scope. Get a new key with broader scope. (${rawMessage})`;
|
|
76
|
+
} else if (res.status === 409) {
|
|
77
|
+
error = `Org is in ui source-of-truth mode. Switch to git mode in cloud settings, or push UI changes back into your config first.`;
|
|
78
|
+
} else if (res.status === 422) {
|
|
79
|
+
error = `Validation failed: ${rawMessage}`;
|
|
80
|
+
} else {
|
|
81
|
+
error = `Request failed (${res.status}): ${rawMessage}`;
|
|
82
|
+
}
|
|
83
|
+
return { ok: false, error, status: res.status, conflicts: body.conflicts };
|
|
84
|
+
}
|
|
85
|
+
async function setSecret(name, value) {
|
|
86
|
+
const { url, apiKey } = getEnv();
|
|
87
|
+
let res;
|
|
88
|
+
try {
|
|
89
|
+
res = await fetch(`${url}/secrets`, {
|
|
90
|
+
method: "POST",
|
|
91
|
+
headers: {
|
|
92
|
+
"Content-Type": "application/json",
|
|
93
|
+
Authorization: `Bearer ${apiKey ?? ""}`
|
|
94
|
+
},
|
|
95
|
+
body: JSON.stringify({ name, value }),
|
|
96
|
+
signal: AbortSignal.timeout(DEFAULT_TIMEOUT_MS)
|
|
97
|
+
});
|
|
98
|
+
} catch (err) {
|
|
99
|
+
throw new ApiError(wrapFetchError(err), 0);
|
|
100
|
+
}
|
|
101
|
+
if (!res.ok) {
|
|
102
|
+
await throwApiError(res);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
async function listSecrets() {
|
|
106
|
+
const { url, apiKey } = getEnv();
|
|
107
|
+
let res;
|
|
108
|
+
try {
|
|
109
|
+
res = await fetch(`${url}/secrets`, {
|
|
110
|
+
headers: { Authorization: `Bearer ${apiKey ?? ""}` },
|
|
111
|
+
signal: AbortSignal.timeout(DEFAULT_TIMEOUT_MS)
|
|
112
|
+
});
|
|
113
|
+
} catch (err) {
|
|
114
|
+
throw new ApiError(wrapFetchError(err), 0);
|
|
115
|
+
}
|
|
116
|
+
if (!res.ok) {
|
|
117
|
+
await throwApiError(res);
|
|
118
|
+
}
|
|
119
|
+
return res.json();
|
|
120
|
+
}
|
|
121
|
+
async function removeSecret(name) {
|
|
122
|
+
const { url, apiKey } = getEnv();
|
|
123
|
+
let res;
|
|
124
|
+
try {
|
|
125
|
+
res = await fetch(`${url}/secrets/${encodeURIComponent(name)}`, {
|
|
126
|
+
method: "DELETE",
|
|
127
|
+
headers: { Authorization: `Bearer ${apiKey ?? ""}` },
|
|
128
|
+
signal: AbortSignal.timeout(DEFAULT_TIMEOUT_MS)
|
|
129
|
+
});
|
|
130
|
+
} catch (err) {
|
|
131
|
+
throw new ApiError(wrapFetchError(err), 0);
|
|
132
|
+
}
|
|
133
|
+
if (!res.ok) {
|
|
134
|
+
await throwApiError(res);
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
function wrapFetchError(err) {
|
|
138
|
+
if (err instanceof Error && (err.name === "AbortError" || err.name === "TimeoutError")) {
|
|
139
|
+
return "Request timed out";
|
|
140
|
+
}
|
|
141
|
+
return `Network error: ${err instanceof Error ? err.message : String(err)}`;
|
|
142
|
+
}
|
|
143
|
+
async function throwApiError(res) {
|
|
144
|
+
let message = res.statusText;
|
|
145
|
+
try {
|
|
146
|
+
const body = await res.json();
|
|
147
|
+
message = body.error ?? body.message ?? message;
|
|
148
|
+
} catch (e) {
|
|
149
|
+
console.warn("Could not parse error response body:", e);
|
|
150
|
+
}
|
|
151
|
+
throw new ApiError(`API error (${res.status}): ${message}`, res.status);
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
// src/lib/config-loader.ts
|
|
155
|
+
import { defineConfig } from "@rawdash/core";
|
|
156
|
+
import { existsSync } from "fs";
|
|
157
|
+
import { dirname, join, resolve } from "path";
|
|
158
|
+
import { tsImport } from "tsx/esm/api";
|
|
159
|
+
async function findConfigFile(explicitPath) {
|
|
160
|
+
if (explicitPath) {
|
|
161
|
+
const abs = resolve(explicitPath);
|
|
162
|
+
if (!existsSync(abs)) {
|
|
163
|
+
throw new Error(`Config file not found: ${abs}`);
|
|
164
|
+
}
|
|
165
|
+
return abs;
|
|
166
|
+
}
|
|
167
|
+
let dir = process.cwd();
|
|
168
|
+
for (; ; ) {
|
|
169
|
+
const candidate = join(dir, "rawdash.config.ts");
|
|
170
|
+
if (existsSync(candidate)) {
|
|
171
|
+
return candidate;
|
|
172
|
+
}
|
|
173
|
+
const parent = dirname(dir);
|
|
174
|
+
if (parent === dir) {
|
|
175
|
+
break;
|
|
176
|
+
}
|
|
177
|
+
dir = parent;
|
|
178
|
+
}
|
|
179
|
+
throw new Error(
|
|
180
|
+
"Could not find rawdash.config.ts. Pass --config <path> to specify it explicitly."
|
|
181
|
+
);
|
|
182
|
+
}
|
|
183
|
+
async function loadConfig(configPath) {
|
|
184
|
+
const mod = await tsImport(configPath, import.meta.url);
|
|
185
|
+
const config = mod.default ?? mod.config;
|
|
186
|
+
if (!config || typeof config !== "object") {
|
|
187
|
+
throw new Error(
|
|
188
|
+
`${configPath} must export a default config (result of defineConfig())`
|
|
189
|
+
);
|
|
190
|
+
}
|
|
191
|
+
return defineConfig(config);
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
// src/lib/output.ts
|
|
195
|
+
import pc from "picocolors";
|
|
196
|
+
function printDiff(diff) {
|
|
197
|
+
if (diff.added.length === 0 && diff.removed.length === 0 && diff.modified.length === 0) {
|
|
198
|
+
console.log(" (no changes)");
|
|
199
|
+
return;
|
|
200
|
+
}
|
|
201
|
+
for (const item of diff.added) {
|
|
202
|
+
console.log(pc.green(` + ${item}`));
|
|
203
|
+
}
|
|
204
|
+
for (const item of diff.modified) {
|
|
205
|
+
console.log(pc.yellow(` ~ ${item}`));
|
|
206
|
+
}
|
|
207
|
+
for (const item of diff.removed) {
|
|
208
|
+
console.log(pc.red(` - ${item}`));
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
function printError(message) {
|
|
212
|
+
console.error(pc.red(`\u2717 ${message}`));
|
|
213
|
+
}
|
|
214
|
+
function printSuccess(message) {
|
|
215
|
+
console.log(pc.green(`\u2713 ${message}`));
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
// src/commands/deploy.ts
|
|
219
|
+
var deployCommand = new Command("deploy").description("Deploy rawdash.config.ts to the server").option("--config <path>", "path to rawdash.config.ts").option("--dry-run", "validate and diff without persisting").option("--yes", "skip confirmation prompt (useful in CI)").action(
|
|
220
|
+
async (opts) => {
|
|
221
|
+
requireApiKey();
|
|
222
|
+
const configPath = await findConfigFile(opts.config).catch(
|
|
223
|
+
(err) => {
|
|
224
|
+
printError(err instanceof Error ? err.message : String(err));
|
|
225
|
+
process.exit(2);
|
|
226
|
+
}
|
|
227
|
+
);
|
|
228
|
+
const s = spinner();
|
|
229
|
+
s.start("Loading config...");
|
|
230
|
+
const config = await loadConfig(configPath).catch((err) => {
|
|
231
|
+
s.stop("Failed to load config");
|
|
232
|
+
printError(err instanceof Error ? err.message : String(err));
|
|
233
|
+
process.exit(2);
|
|
234
|
+
});
|
|
235
|
+
s.stop("Config loaded");
|
|
236
|
+
s.start("Fetching diff...");
|
|
237
|
+
const previewResult = await postConfig(config, true);
|
|
238
|
+
s.stop("");
|
|
239
|
+
if (!previewResult.ok) {
|
|
240
|
+
printError(previewResult.error);
|
|
241
|
+
process.exit(exitCodeForStatus(previewResult.status));
|
|
242
|
+
}
|
|
243
|
+
printDiff(previewResult.diff);
|
|
244
|
+
if (opts.dryRun) {
|
|
245
|
+
printSuccess("Dry run complete \u2014 no changes applied");
|
|
246
|
+
return;
|
|
247
|
+
}
|
|
248
|
+
if (!opts.yes) {
|
|
249
|
+
const confirmed = await confirm({ message: "Apply this diff?" });
|
|
250
|
+
if (isCancel(confirmed) || !confirmed) {
|
|
251
|
+
console.log("Aborted.");
|
|
252
|
+
process.exit(0);
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
s.start("Deploying...");
|
|
256
|
+
const deployResult = await postConfig(config, false);
|
|
257
|
+
s.stop("");
|
|
258
|
+
if (!deployResult.ok) {
|
|
259
|
+
printError(deployResult.error);
|
|
260
|
+
process.exit(exitCodeForStatus(deployResult.status));
|
|
261
|
+
}
|
|
262
|
+
printSuccess(`Deployed \u2014 version ${deployResult.version}`);
|
|
263
|
+
}
|
|
264
|
+
);
|
|
265
|
+
function exitCodeForStatus(status) {
|
|
266
|
+
if (status === 401 || status === 403) {
|
|
267
|
+
return 3;
|
|
268
|
+
}
|
|
269
|
+
if (status === 409) {
|
|
270
|
+
return 4;
|
|
271
|
+
}
|
|
272
|
+
if (status === 422) {
|
|
273
|
+
return 2;
|
|
274
|
+
}
|
|
275
|
+
return 1;
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
// src/commands/secrets.ts
|
|
279
|
+
import { spinner as spinner2 } from "@clack/prompts";
|
|
280
|
+
import { Command as Command2 } from "commander";
|
|
281
|
+
var secretsCommand = new Command2("secrets").description(
|
|
282
|
+
"Manage secrets"
|
|
283
|
+
);
|
|
284
|
+
secretsCommand.command("set <name> [value]").description("Set a secret (reads value from stdin if not provided)").action(async (name, value) => {
|
|
285
|
+
requireApiKey();
|
|
286
|
+
let secretValue = value;
|
|
287
|
+
if (secretValue === void 0) {
|
|
288
|
+
secretValue = await readStdin();
|
|
289
|
+
if (!secretValue) {
|
|
290
|
+
printError("No value provided. Pass as argument or via stdin.");
|
|
291
|
+
process.exit(1);
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
const s = spinner2();
|
|
295
|
+
s.start(`Setting secret ${name}...`);
|
|
296
|
+
try {
|
|
297
|
+
await setSecret(name, secretValue);
|
|
298
|
+
s.stop("");
|
|
299
|
+
printSuccess(`Secret ${name} set`);
|
|
300
|
+
} catch (err) {
|
|
301
|
+
s.stop("");
|
|
302
|
+
printError(err instanceof Error ? err.message : String(err));
|
|
303
|
+
process.exit(authExitCode(err));
|
|
304
|
+
}
|
|
305
|
+
});
|
|
306
|
+
secretsCommand.command("list").description("List all secrets (names and last-rotated timestamps)").action(async () => {
|
|
307
|
+
requireApiKey();
|
|
308
|
+
const s = spinner2();
|
|
309
|
+
s.start("Fetching secrets...");
|
|
310
|
+
try {
|
|
311
|
+
const secrets = await listSecrets();
|
|
312
|
+
s.stop("");
|
|
313
|
+
if (secrets.length === 0) {
|
|
314
|
+
console.log("No secrets configured.");
|
|
315
|
+
return;
|
|
316
|
+
}
|
|
317
|
+
for (const { name, lastRotatedAt } of secrets) {
|
|
318
|
+
const ts = lastRotatedAt ? new Date(lastRotatedAt).toLocaleString() : "never";
|
|
319
|
+
console.log(` ${name} (last rotated: ${ts})`);
|
|
320
|
+
}
|
|
321
|
+
} catch (err) {
|
|
322
|
+
s.stop("");
|
|
323
|
+
printError(err instanceof Error ? err.message : String(err));
|
|
324
|
+
process.exit(authExitCode(err));
|
|
325
|
+
}
|
|
326
|
+
});
|
|
327
|
+
secretsCommand.command("remove <name>").description("Remove a secret").action(async (name) => {
|
|
328
|
+
requireApiKey();
|
|
329
|
+
const s = spinner2();
|
|
330
|
+
s.start(`Removing secret ${name}...`);
|
|
331
|
+
try {
|
|
332
|
+
await removeSecret(name);
|
|
333
|
+
s.stop("");
|
|
334
|
+
printSuccess(`Secret ${name} removed`);
|
|
335
|
+
} catch (err) {
|
|
336
|
+
s.stop("");
|
|
337
|
+
printError(err instanceof Error ? err.message : String(err));
|
|
338
|
+
process.exit(authExitCode(err));
|
|
339
|
+
}
|
|
340
|
+
});
|
|
341
|
+
async function readStdin() {
|
|
342
|
+
return new Promise((resolve2, reject) => {
|
|
343
|
+
const chunks = [];
|
|
344
|
+
process.stdin.on("data", (chunk) => chunks.push(chunk));
|
|
345
|
+
process.stdin.on(
|
|
346
|
+
"end",
|
|
347
|
+
() => resolve2(Buffer.concat(chunks).toString("utf8"))
|
|
348
|
+
);
|
|
349
|
+
process.stdin.on("error", reject);
|
|
350
|
+
});
|
|
351
|
+
}
|
|
352
|
+
function authExitCode(err) {
|
|
353
|
+
if (err instanceof ApiError && (err.status === 401 || err.status === 403)) {
|
|
354
|
+
return 3;
|
|
355
|
+
}
|
|
356
|
+
return 1;
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
// src/commands/validate.ts
|
|
360
|
+
import { Command as Command3 } from "commander";
|
|
361
|
+
var validateCommand = new Command3("validate").description("Validate rawdash.config.ts locally without network access").option("--config <path>", "path to rawdash.config.ts").action(async (opts) => {
|
|
362
|
+
const configPath = await findConfigFile(opts.config).catch(
|
|
363
|
+
(err) => {
|
|
364
|
+
printError(err instanceof Error ? err.message : String(err));
|
|
365
|
+
process.exit(2);
|
|
366
|
+
}
|
|
367
|
+
);
|
|
368
|
+
try {
|
|
369
|
+
const config = await loadConfig(configPath);
|
|
370
|
+
console.log(JSON.stringify(config, null, 2));
|
|
371
|
+
printSuccess("Config is valid");
|
|
372
|
+
} catch (err) {
|
|
373
|
+
printError(err instanceof Error ? err.message : String(err));
|
|
374
|
+
process.exit(2);
|
|
375
|
+
}
|
|
376
|
+
});
|
|
377
|
+
|
|
378
|
+
// src/bin.ts
|
|
379
|
+
var program = new Command4();
|
|
380
|
+
program.name("rawdash").description("Rawdash CLI \u2014 deploy and manage your dashboard config").version("0.0.0");
|
|
381
|
+
program.addCommand(deployCommand);
|
|
382
|
+
program.addCommand(secretsCommand);
|
|
383
|
+
program.addCommand(validateCommand);
|
|
384
|
+
program.parseAsync(process.argv).catch((err) => {
|
|
385
|
+
console.error(err instanceof Error ? err.message : String(err));
|
|
386
|
+
process.exit(1);
|
|
387
|
+
});
|
|
388
|
+
//# sourceMappingURL=bin.js.map
|
package/dist/bin.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/bin.ts","../src/commands/deploy.ts","../src/lib/env.ts","../src/lib/api-client.ts","../src/lib/config-loader.ts","../src/lib/output.ts","../src/commands/secrets.ts","../src/commands/validate.ts"],"sourcesContent":["import { Command } from 'commander';\n\nimport { deployCommand } from './commands/deploy';\nimport { secretsCommand } from './commands/secrets';\nimport { validateCommand } from './commands/validate';\n\nconst program = new Command();\n\nprogram\n .name('rawdash')\n .description('Rawdash CLI — deploy and manage your dashboard config')\n .version('0.0.0');\n\nprogram.addCommand(deployCommand);\nprogram.addCommand(secretsCommand);\nprogram.addCommand(validateCommand);\n\nprogram.parseAsync(process.argv).catch((err: unknown) => {\n console.error(err instanceof Error ? err.message : String(err));\n process.exit(1);\n});\n","import { confirm, isCancel, spinner } from '@clack/prompts';\nimport { Command } from 'commander';\n\nimport { postConfig } from '../lib/api-client';\nimport { findConfigFile, loadConfig } from '../lib/config-loader';\nimport { requireApiKey } from '../lib/env';\nimport { printDiff, printError, printSuccess } from '../lib/output';\n\nexport const deployCommand = new Command('deploy')\n .description('Deploy rawdash.config.ts to the server')\n .option('--config <path>', 'path to rawdash.config.ts')\n .option('--dry-run', 'validate and diff without persisting')\n .option('--yes', 'skip confirmation prompt (useful in CI)')\n .action(\n async (opts: { config?: string; dryRun?: boolean; yes?: boolean }) => {\n requireApiKey();\n\n const configPath = await findConfigFile(opts.config).catch(\n (err: unknown) => {\n printError(err instanceof Error ? err.message : String(err));\n process.exit(2);\n },\n );\n\n const s = spinner();\n s.start('Loading config...');\n\n const config = await loadConfig(configPath).catch((err: unknown) => {\n s.stop('Failed to load config');\n printError(err instanceof Error ? err.message : String(err));\n process.exit(2);\n });\n s.stop('Config loaded');\n\n s.start('Fetching diff...');\n const previewResult = await postConfig(config, true);\n s.stop('');\n\n if (!previewResult.ok) {\n printError(previewResult.error);\n process.exit(exitCodeForStatus(previewResult.status));\n }\n\n printDiff(previewResult.diff);\n\n if (opts.dryRun) {\n printSuccess('Dry run complete — no changes applied');\n return;\n }\n\n if (!opts.yes) {\n const confirmed = await confirm({ message: 'Apply this diff?' });\n if (isCancel(confirmed) || !confirmed) {\n console.log('Aborted.');\n process.exit(0);\n }\n }\n\n s.start('Deploying...');\n const deployResult = await postConfig(config, false);\n s.stop('');\n\n if (!deployResult.ok) {\n printError(deployResult.error);\n process.exit(exitCodeForStatus(deployResult.status));\n }\n\n printSuccess(`Deployed — version ${deployResult.version}`);\n },\n );\n\nfunction exitCodeForStatus(status: number): number {\n if (status === 401 || status === 403) {\n return 3;\n }\n if (status === 409) {\n return 4;\n }\n if (status === 422) {\n return 2;\n }\n return 1;\n}\n","export function getEnv(): { url: string; apiKey: string | undefined } {\n return {\n url: process.env['RAWDASH_URL'] ?? 'https://api.rawdash.dev',\n apiKey: process.env['RAWDASH_API_KEY'],\n };\n}\n\nexport function requireApiKey(): string {\n const { apiKey } = getEnv();\n if (!apiKey) {\n console.error('RAWDASH_API_KEY is not set. Set it in your environment.');\n process.exit(3);\n }\n return apiKey;\n}\n","import { getEnv } from './env';\n\nconst DEFAULT_TIMEOUT_MS = 10_000;\n\nexport interface DeploySuccess {\n ok: true;\n version: number;\n diff: {\n added: string[];\n removed: string[];\n modified: string[];\n };\n}\n\nexport interface DeployFailure {\n ok: false;\n error: string;\n status: number;\n conflicts?: string[];\n}\n\nexport type DeployResult = DeploySuccess | DeployFailure;\n\nexport interface SecretEntry {\n name: string;\n lastRotatedAt: string | null;\n}\n\nexport class ApiError extends Error {\n constructor(\n message: string,\n public readonly status: number,\n ) {\n super(message);\n this.name = 'ApiError';\n }\n}\n\nexport async function postConfig(\n config: unknown,\n dryRun: boolean,\n): Promise<DeployResult> {\n const { url, apiKey } = getEnv();\n const endpoint = `${url}/config${dryRun ? '?dryRun=true' : ''}`;\n\n let res: Response;\n try {\n res = await fetch(endpoint, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n Authorization: `Bearer ${apiKey ?? ''}`,\n },\n body: JSON.stringify(config),\n signal: AbortSignal.timeout(DEFAULT_TIMEOUT_MS),\n });\n } catch (err) {\n const isTimeout =\n err instanceof Error &&\n (err.name === 'AbortError' || err.name === 'TimeoutError');\n return {\n ok: false,\n error: isTimeout\n ? 'Request timed out'\n : `Network error: ${err instanceof Error ? err.message : String(err)}`,\n status: 0,\n };\n }\n\n if (res.ok) {\n return res.json() as Promise<DeploySuccess>;\n }\n\n return buildDeployFailure(res);\n}\n\nasync function buildDeployFailure(res: Response): Promise<DeployFailure> {\n let body: { error?: string; message?: string; conflicts?: string[] } = {};\n try {\n body = (await res.json()) as typeof body;\n } catch (e) {\n console.warn('Could not parse error response body:', e);\n }\n\n const rawMessage = body.error ?? body.message ?? res.statusText;\n\n let error: string;\n if (res.status === 401) {\n error = `API key invalid or revoked. Check RAWDASH_API_KEY. (${rawMessage})`;\n } else if (res.status === 403) {\n error = `Key lacks config:write scope. Get a new key with broader scope. (${rawMessage})`;\n } else if (res.status === 409) {\n error = `Org is in ui source-of-truth mode. Switch to git mode in cloud settings, or push UI changes back into your config first.`;\n } else if (res.status === 422) {\n error = `Validation failed: ${rawMessage}`;\n } else {\n error = `Request failed (${res.status}): ${rawMessage}`;\n }\n\n return { ok: false, error, status: res.status, conflicts: body.conflicts };\n}\n\nexport async function setSecret(name: string, value: string): Promise<void> {\n const { url, apiKey } = getEnv();\n\n let res: Response;\n try {\n res = await fetch(`${url}/secrets`, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n Authorization: `Bearer ${apiKey ?? ''}`,\n },\n body: JSON.stringify({ name, value }),\n signal: AbortSignal.timeout(DEFAULT_TIMEOUT_MS),\n });\n } catch (err) {\n throw new ApiError(wrapFetchError(err), 0);\n }\n\n if (!res.ok) {\n await throwApiError(res);\n }\n}\n\nexport async function listSecrets(): Promise<SecretEntry[]> {\n const { url, apiKey } = getEnv();\n\n let res: Response;\n try {\n res = await fetch(`${url}/secrets`, {\n headers: { Authorization: `Bearer ${apiKey ?? ''}` },\n signal: AbortSignal.timeout(DEFAULT_TIMEOUT_MS),\n });\n } catch (err) {\n throw new ApiError(wrapFetchError(err), 0);\n }\n\n if (!res.ok) {\n await throwApiError(res);\n }\n return res.json() as Promise<SecretEntry[]>;\n}\n\nexport async function removeSecret(name: string): Promise<void> {\n const { url, apiKey } = getEnv();\n\n let res: Response;\n try {\n res = await fetch(`${url}/secrets/${encodeURIComponent(name)}`, {\n method: 'DELETE',\n headers: { Authorization: `Bearer ${apiKey ?? ''}` },\n signal: AbortSignal.timeout(DEFAULT_TIMEOUT_MS),\n });\n } catch (err) {\n throw new ApiError(wrapFetchError(err), 0);\n }\n\n if (!res.ok) {\n await throwApiError(res);\n }\n}\n\nfunction wrapFetchError(err: unknown): string {\n if (\n err instanceof Error &&\n (err.name === 'AbortError' || err.name === 'TimeoutError')\n ) {\n return 'Request timed out';\n }\n return `Network error: ${err instanceof Error ? err.message : String(err)}`;\n}\n\nasync function throwApiError(res: Response): Promise<never> {\n let message = res.statusText;\n try {\n const body = (await res.json()) as { error?: string; message?: string };\n message = body.error ?? body.message ?? message;\n } catch (e) {\n console.warn('Could not parse error response body:', e);\n }\n throw new ApiError(`API error (${res.status}): ${message}`, res.status);\n}\n","import { type DashboardConfig, defineConfig } from '@rawdash/core';\nimport { existsSync } from 'node:fs';\nimport { dirname, join, resolve } from 'node:path';\nimport { tsImport } from 'tsx/esm/api';\n\nexport async function findConfigFile(explicitPath?: string): Promise<string> {\n if (explicitPath) {\n const abs = resolve(explicitPath);\n if (!existsSync(abs)) {\n throw new Error(`Config file not found: ${abs}`);\n }\n return abs;\n }\n\n let dir = process.cwd();\n for (;;) {\n const candidate = join(dir, 'rawdash.config.ts');\n if (existsSync(candidate)) {\n return candidate;\n }\n const parent = dirname(dir);\n if (parent === dir) {\n break;\n }\n dir = parent;\n }\n\n throw new Error(\n 'Could not find rawdash.config.ts. Pass --config <path> to specify it explicitly.',\n );\n}\n\nexport async function loadConfig(configPath: string): Promise<DashboardConfig> {\n const mod = await tsImport(configPath, import.meta.url);\n const config: unknown =\n (mod as { default?: unknown; config?: unknown }).default ??\n (mod as { config?: unknown }).config;\n if (!config || typeof config !== 'object') {\n throw new Error(\n `${configPath} must export a default config (result of defineConfig())`,\n );\n }\n return defineConfig(config as Parameters<typeof defineConfig>[0]);\n}\n","import pc from 'picocolors';\n\nexport interface Diff {\n added: string[];\n removed: string[];\n modified: string[];\n}\n\nexport function printDiff(diff: Diff): void {\n if (\n diff.added.length === 0 &&\n diff.removed.length === 0 &&\n diff.modified.length === 0\n ) {\n console.log(' (no changes)');\n return;\n }\n for (const item of diff.added) {\n console.log(pc.green(` + ${item}`));\n }\n for (const item of diff.modified) {\n console.log(pc.yellow(` ~ ${item}`));\n }\n for (const item of diff.removed) {\n console.log(pc.red(` - ${item}`));\n }\n}\n\nexport function printError(message: string): void {\n console.error(pc.red(`✗ ${message}`));\n}\n\nexport function printSuccess(message: string): void {\n console.log(pc.green(`✓ ${message}`));\n}\n","import { spinner } from '@clack/prompts';\nimport { Command } from 'commander';\n\nimport {\n ApiError,\n listSecrets,\n removeSecret,\n setSecret,\n} from '../lib/api-client';\nimport { requireApiKey } from '../lib/env';\nimport { printError, printSuccess } from '../lib/output';\n\nexport const secretsCommand = new Command('secrets').description(\n 'Manage secrets',\n);\n\nsecretsCommand\n .command('set <name> [value]')\n .description('Set a secret (reads value from stdin if not provided)')\n .action(async (name: string, value?: string) => {\n requireApiKey();\n\n let secretValue = value;\n if (secretValue === undefined) {\n secretValue = await readStdin();\n if (!secretValue) {\n printError('No value provided. Pass as argument or via stdin.');\n process.exit(1);\n }\n }\n\n const s = spinner();\n s.start(`Setting secret ${name}...`);\n try {\n await setSecret(name, secretValue);\n s.stop('');\n printSuccess(`Secret ${name} set`);\n } catch (err) {\n s.stop('');\n printError(err instanceof Error ? err.message : String(err));\n process.exit(authExitCode(err));\n }\n });\n\nsecretsCommand\n .command('list')\n .description('List all secrets (names and last-rotated timestamps)')\n .action(async () => {\n requireApiKey();\n\n const s = spinner();\n s.start('Fetching secrets...');\n try {\n const secrets = await listSecrets();\n s.stop('');\n if (secrets.length === 0) {\n console.log('No secrets configured.');\n return;\n }\n for (const { name, lastRotatedAt } of secrets) {\n const ts = lastRotatedAt\n ? new Date(lastRotatedAt).toLocaleString()\n : 'never';\n console.log(` ${name} (last rotated: ${ts})`);\n }\n } catch (err) {\n s.stop('');\n printError(err instanceof Error ? err.message : String(err));\n process.exit(authExitCode(err));\n }\n });\n\nsecretsCommand\n .command('remove <name>')\n .description('Remove a secret')\n .action(async (name: string) => {\n requireApiKey();\n\n const s = spinner();\n s.start(`Removing secret ${name}...`);\n try {\n await removeSecret(name);\n s.stop('');\n printSuccess(`Secret ${name} removed`);\n } catch (err) {\n s.stop('');\n printError(err instanceof Error ? err.message : String(err));\n process.exit(authExitCode(err));\n }\n });\n\nasync function readStdin(): Promise<string> {\n return new Promise((resolve, reject) => {\n const chunks: Buffer[] = [];\n process.stdin.on('data', (chunk: Buffer) => chunks.push(chunk));\n process.stdin.on('end', () =>\n resolve(Buffer.concat(chunks).toString('utf8')),\n );\n process.stdin.on('error', reject);\n });\n}\n\nfunction authExitCode(err: unknown): number {\n if (err instanceof ApiError && (err.status === 401 || err.status === 403)) {\n return 3;\n }\n return 1;\n}\n","import { Command } from 'commander';\n\nimport { findConfigFile, loadConfig } from '../lib/config-loader';\nimport { printError, printSuccess } from '../lib/output';\n\nexport const validateCommand = new Command('validate')\n .description('Validate rawdash.config.ts locally without network access')\n .option('--config <path>', 'path to rawdash.config.ts')\n .action(async (opts: { config?: string }) => {\n const configPath = await findConfigFile(opts.config).catch(\n (err: unknown) => {\n printError(err instanceof Error ? err.message : String(err));\n process.exit(2);\n },\n );\n\n try {\n const config = await loadConfig(configPath);\n console.log(JSON.stringify(config, null, 2));\n printSuccess('Config is valid');\n } catch (err) {\n printError(err instanceof Error ? err.message : String(err));\n process.exit(2);\n }\n });\n"],"mappings":";;;AAAA,SAAS,WAAAA,gBAAe;;;ACAxB,SAAS,SAAS,UAAU,eAAe;AAC3C,SAAS,eAAe;;;ACDjB,SAAS,SAAsD;AACpE,SAAO;AAAA,IACL,KAAK,QAAQ,IAAI,aAAa,KAAK;AAAA,IACnC,QAAQ,QAAQ,IAAI,iBAAiB;AAAA,EACvC;AACF;AAEO,SAAS,gBAAwB;AACtC,QAAM,EAAE,OAAO,IAAI,OAAO;AAC1B,MAAI,CAAC,QAAQ;AACX,YAAQ,MAAM,yDAAyD;AACvE,YAAQ,KAAK,CAAC;AAAA,EAChB;AACA,SAAO;AACT;;;ACZA,IAAM,qBAAqB;AA0BpB,IAAM,WAAN,cAAuB,MAAM;AAAA,EAClC,YACE,SACgB,QAChB;AACA,UAAM,OAAO;AAFG;AAGhB,SAAK,OAAO;AAAA,EACd;AAAA,EAJkB;AAKpB;AAEA,eAAsB,WACpB,QACA,QACuB;AACvB,QAAM,EAAE,KAAK,OAAO,IAAI,OAAO;AAC/B,QAAM,WAAW,GAAG,GAAG,UAAU,SAAS,iBAAiB,EAAE;AAE7D,MAAI;AACJ,MAAI;AACF,UAAM,MAAM,MAAM,UAAU;AAAA,MAC1B,QAAQ;AAAA,MACR,SAAS;AAAA,QACP,gBAAgB;AAAA,QAChB,eAAe,UAAU,UAAU,EAAE;AAAA,MACvC;AAAA,MACA,MAAM,KAAK,UAAU,MAAM;AAAA,MAC3B,QAAQ,YAAY,QAAQ,kBAAkB;AAAA,IAChD,CAAC;AAAA,EACH,SAAS,KAAK;AACZ,UAAM,YACJ,eAAe,UACd,IAAI,SAAS,gBAAgB,IAAI,SAAS;AAC7C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AAW,aAAa;AAChC,QAAQ,WAAW,cAAc;AACjC,QAAQ,WAAW,eAAe;AAElC,QAAQ,WAAW,QAAQ,IAAI,EAAE,MAAM,CAAC,QAAiB;AACvD,UAAQ,MAAM,eAAe,QAAQ,IAAI,UAAU,OAAO,GAAG,CAAC;AAC9D,UAAQ,KAAK,CAAC;AAChB,CAAC;","names":["Command","spinner","Command","Command","spinner","resolve","Command","Command","Command"]}
|
package/package.json
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@rawdash/cli",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Rawdash CLI — deploy and manage your dashboard config",
|
|
5
|
+
"license": "Apache-2.0",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "https://github.com/rawdash/rawdash.git",
|
|
10
|
+
"directory": "packages/cli"
|
|
11
|
+
},
|
|
12
|
+
"files": [
|
|
13
|
+
"dist",
|
|
14
|
+
"README.md",
|
|
15
|
+
"LICENSE"
|
|
16
|
+
],
|
|
17
|
+
"engines": {
|
|
18
|
+
"node": ">=24"
|
|
19
|
+
},
|
|
20
|
+
"bin": {
|
|
21
|
+
"rawdash": "./dist/bin.js"
|
|
22
|
+
},
|
|
23
|
+
"exports": {
|
|
24
|
+
".": "./dist/bin.js"
|
|
25
|
+
},
|
|
26
|
+
"dependencies": {
|
|
27
|
+
"@clack/prompts": "^0.9.0",
|
|
28
|
+
"commander": "^13.0.0",
|
|
29
|
+
"picocolors": "^1.1.0",
|
|
30
|
+
"tsx": "^4.19.4",
|
|
31
|
+
"@rawdash/core": "0.1.0"
|
|
32
|
+
},
|
|
33
|
+
"devDependencies": {
|
|
34
|
+
"@types/node": "^22.0.0",
|
|
35
|
+
"tsup": "^8.0.0",
|
|
36
|
+
"typescript": "^5.7.2"
|
|
37
|
+
},
|
|
38
|
+
"scripts": {
|
|
39
|
+
"build": "tsup",
|
|
40
|
+
"typecheck": "tsc --noEmit",
|
|
41
|
+
"lint": "eslint src"
|
|
42
|
+
}
|
|
43
|
+
}
|