@nestica/cli 0.1.0 → 0.3.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 +3 -2
- package/dist/cli.js +38 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -32,7 +32,7 @@ Firebase tokens and the default profile. Precedence for every setting:
|
|
|
32
32
|
| Setting | Flag | Environment | Default |
|
|
33
33
|
| --- | --- | --- | --- |
|
|
34
34
|
| API base URL | `-H, --base-url` | `NESTICA_BASE_URL` | deployed API |
|
|
35
|
-
| Firebase web API key | `--api-key` | `FIREBASE_API_KEY` |
|
|
35
|
+
| Firebase web API key | `--api-key` | `FIREBASE_API_KEY` | the Nestica project's web key |
|
|
36
36
|
| Google OAuth client id | `--google-client-id` | `GOOGLE_CLIENT_ID` | — |
|
|
37
37
|
| Google OAuth client secret | `--google-client-secret` | `GOOGLE_CLIENT_SECRET` | — |
|
|
38
38
|
| Auth emulator | — | `FIREBASE_AUTH_EMULATOR_HOST` | inferred from a localhost base URL |
|
|
@@ -68,7 +68,8 @@ Global flags: `-H/--base-url`, `--api-key`, `--profile`,
|
|
|
68
68
|
### login
|
|
69
69
|
|
|
70
70
|
- Email/password (prompted when omitted; the password is not echoed):
|
|
71
|
-
`nestica login --
|
|
71
|
+
`nestica login --email dev@example.com` (the Firebase web API key
|
|
72
|
+
defaults to the Nestica project's own key)
|
|
72
73
|
- Google, in the browser (OAuth + PKCE against a loopback redirect;
|
|
73
74
|
needs the Firebase project's web OAuth client id):
|
|
74
75
|
`nestica login --google --google-client-id <id> --api-key <key>`
|
package/dist/cli.js
CHANGED
|
@@ -3377,6 +3377,41 @@ function useColor() {
|
|
|
3377
3377
|
// ../node_modules/.pnpm/commander@15.0.0/node_modules/commander/index.js
|
|
3378
3378
|
var program = new Command();
|
|
3379
3379
|
|
|
3380
|
+
// package.json
|
|
3381
|
+
var package_default = {
|
|
3382
|
+
name: "@nestica/cli",
|
|
3383
|
+
version: "0.3.0",
|
|
3384
|
+
type: "module",
|
|
3385
|
+
description: "Command-line client for the Nestica REST API",
|
|
3386
|
+
license: "MIT",
|
|
3387
|
+
engines: {
|
|
3388
|
+
node: ">=22.12"
|
|
3389
|
+
},
|
|
3390
|
+
bin: {
|
|
3391
|
+
nestica: "dist/cli.js"
|
|
3392
|
+
},
|
|
3393
|
+
files: [
|
|
3394
|
+
"dist"
|
|
3395
|
+
],
|
|
3396
|
+
publishConfig: {
|
|
3397
|
+
access: "public"
|
|
3398
|
+
},
|
|
3399
|
+
scripts: {
|
|
3400
|
+
build: "tsc -p tsconfig.build.json && node scripts/bundle.mjs",
|
|
3401
|
+
test: "vitest run",
|
|
3402
|
+
start: "node dist/cli.js",
|
|
3403
|
+
prepublishOnly: "pnpm build"
|
|
3404
|
+
},
|
|
3405
|
+
devDependencies: {
|
|
3406
|
+
"@nestica/models": "workspace:*",
|
|
3407
|
+
"@types/node": "^22.20.1",
|
|
3408
|
+
commander: "^15.0.0",
|
|
3409
|
+
esbuild: "^0.25.0",
|
|
3410
|
+
typescript: "^5.9.3",
|
|
3411
|
+
vitest: "^4.1.10"
|
|
3412
|
+
}
|
|
3413
|
+
};
|
|
3414
|
+
|
|
3380
3415
|
// src/body.ts
|
|
3381
3416
|
import { readFileSync } from "node:fs";
|
|
3382
3417
|
var BodyError = class extends Error {
|
|
@@ -3478,6 +3513,7 @@ import { chmodSync, mkdirSync, readFileSync as readFileSync2, rmSync, writeFileS
|
|
|
3478
3513
|
import { homedir } from "node:os";
|
|
3479
3514
|
import { dirname, join } from "node:path";
|
|
3480
3515
|
var DEFAULT_BASE_URL = "https://api-tjnuhxmzkq-uc.a.run.app/api/v1.0";
|
|
3516
|
+
var DEFAULT_FIREBASE_API_KEY = "AIzaSyCFltgXUHKKNtFt1QbsOhHZeP8ug_tr4t8";
|
|
3481
3517
|
function sessionPath() {
|
|
3482
3518
|
const override = process.env["NESTICA_CONFIG"];
|
|
3483
3519
|
if (override) {
|
|
@@ -3510,7 +3546,7 @@ function removeSession(path2 = sessionPath()) {
|
|
|
3510
3546
|
function resolveConnection(overrides, session) {
|
|
3511
3547
|
return {
|
|
3512
3548
|
baseUrl: overrides.baseUrl ?? process.env["NESTICA_BASE_URL"] ?? session.baseUrl ?? DEFAULT_BASE_URL,
|
|
3513
|
-
apiKey: overrides.apiKey ?? process.env["FIREBASE_API_KEY"] ?? session.apiKey,
|
|
3549
|
+
apiKey: overrides.apiKey ?? process.env["FIREBASE_API_KEY"] ?? session.apiKey ?? DEFAULT_FIREBASE_API_KEY,
|
|
3514
3550
|
profileId: overrides.profile ?? session.defaultProfileId
|
|
3515
3551
|
};
|
|
3516
3552
|
}
|
|
@@ -19017,7 +19053,7 @@ function defaultContext(opts) {
|
|
|
19017
19053
|
}
|
|
19018
19054
|
function buildProgram(context = defaultContext) {
|
|
19019
19055
|
const program2 = new Command();
|
|
19020
|
-
program2.name("nestica").description("Command-line client for the Nestica REST API").version(
|
|
19056
|
+
program2.name("nestica").description("Command-line client for the Nestica REST API").version(package_default.version).option("-H, --base-url <url>", "API base URL (default: the deployed API)").option("--api-key <key>", "Firebase web API key (env: FIREBASE_API_KEY)").option(
|
|
19021
19057
|
"--profile <uuid>",
|
|
19022
19058
|
"profile for scoped resources (beats the stored default)"
|
|
19023
19059
|
).option("-F, --format <format>", "output format: pretty, json or table").option("--no-color", "disable colored output");
|