@tiny-fish/cli 0.1.2-next.16 → 0.1.3-next.17

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.
@@ -2,9 +2,11 @@ import { BASE_URL } from "./constants.js";
2
2
  import { ApiError } from "./output.js";
3
3
  const API_TIMEOUT_MS = 30_000;
4
4
  // ── Debug logging ─────────────────────────────────────────────────────────────
5
- const DEBUG_ENABLED = /^(1|true)$/i.test(process.env["TINYFISH_DEBUG"] ?? "");
5
+ function isDebugEnabled() {
6
+ return /^(1|true)$/i.test(process.env["TINYFISH_DEBUG"] ?? "");
7
+ }
6
8
  function debugLog(msg) {
7
- if (DEBUG_ENABLED) {
9
+ if (isDebugEnabled()) {
8
10
  process.stderr.write(`[debug] ${msg}\n`);
9
11
  }
10
12
  }
@@ -1,5 +1,19 @@
1
- /** Base URL for the TinyFish API. Override with TINYFISH_API_URL for staging/self-hosted. */
1
+ /** Base URL for the TinyFish API. Override with TINYFISH_API_URL for staging/self-hosted (must be https). */
2
2
  const apiUrlOverride = process.env["TINYFISH_API_URL"]?.trim();
3
+ if (apiUrlOverride) {
4
+ let parsed;
5
+ try {
6
+ parsed = new URL(apiUrlOverride);
7
+ }
8
+ catch {
9
+ process.stderr.write("Error: TINYFISH_API_URL must be a valid https URL\n");
10
+ process.exit(1);
11
+ }
12
+ if (parsed.protocol !== "https:") {
13
+ process.stderr.write(`Error: TINYFISH_API_URL must use https:// (got protocol "${parsed.protocol || "unknown"}")\n`);
14
+ process.exit(1);
15
+ }
16
+ }
3
17
  export const BASE_URL = apiUrlOverride || "https://agent.tinyfish.ai";
4
18
  /** URL where users can create and manage API keys */
5
19
  export const DASHBOARD_URL = `${BASE_URL}/api-keys`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tiny-fish/cli",
3
- "version": "0.1.2-next.16",
3
+ "version": "0.1.3-next.17",
4
4
  "description": "TinyFish CLI — run web automations from your terminal",
5
5
  "type": "module",
6
6
  "bin": {