@shipdit/cli 0.4.0 → 0.4.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.
Files changed (2) hide show
  1. package/dist/index.mjs +4 -3
  2. package/package.json +1 -1
package/dist/index.mjs CHANGED
@@ -7,6 +7,8 @@ import { z } from "zod";
7
7
  import { createJiti } from "jiti";
8
8
 
9
9
  //#region src/lib/config.ts
10
+ /** Hosted control plane. Used when no flag, env, project, global, or credential URL is set. */
11
+ const DEFAULT_API_URL = "https://api.useshipd.com";
10
12
  function readJsonFile(filePath) {
11
13
  if (!fs.existsSync(filePath)) return null;
12
14
  return JSON.parse(fs.readFileSync(filePath, "utf8"));
@@ -60,7 +62,7 @@ function resolveRuntimeConfig(flags, options) {
60
62
  const ci = flags.ci === true || flags.yes === true || process.env.CI === "1" || process.env.CI === "true" || process.env.SHIPD_CI === "1";
61
63
  const defaultConfigFile = fs.existsSync(path.join(projectRoot, "shipd.config.ts")) ? path.join(projectRoot, "shipd.config.ts") : path.join(cwd, "shipd.config.ts");
62
64
  return {
63
- apiUrl: flags.apiUrl ?? process.env.SHIPD_API_URL ?? projectConfig.apiUrl ?? globalConfig.apiUrl ?? credentials.apiUrl ?? options?.defaultApiUrl ?? "http://localhost:8000",
65
+ apiUrl: flags.apiUrl ?? process.env.SHIPD_API_URL ?? projectConfig.apiUrl ?? globalConfig.apiUrl ?? credentials.apiUrl ?? options?.defaultApiUrl ?? "https://api.useshipd.com",
64
66
  appUrl: process.env.SHIPD_APP_URL ?? projectConfig.appUrl ?? globalConfig.appUrl ?? "http://localhost:5173",
65
67
  apiKey: process.env.SHIPD_API_KEY ?? credentials.apiKey,
66
68
  org: flags.org ?? process.env.SHIPD_ORG ?? projectConfig.org ?? globalConfig.org,
@@ -4384,7 +4386,6 @@ function e(e) {
4384
4386
  //#region src/commands/auth.ts
4385
4387
  const CLIENT_ID = "shipd-cli";
4386
4388
  const MANAGEMENT_KEY_PREFIX = "shipd_mgmt_";
4387
- const DEFAULT_API_URL = "https://api.useshipd.com";
4388
4389
  function registerAuthCommands(program) {
4389
4390
  program.command("login").description("Authenticate via browser device authorization").addOption(new Option("--api-url <url>", `API origin (default: ${DEFAULT_API_URL})`).env("SHIPD_API_URL")).action(async (_opts, command) => {
4390
4391
  const runtime = getRuntime(command, { defaultApiUrl: DEFAULT_API_URL });
@@ -5376,7 +5377,7 @@ function registerTypesCommands(program) {
5376
5377
  //#region src/index.ts
5377
5378
  /** Detected before parse so usage errors can suppress Commander text under `--json`. */
5378
5379
  const jsonRequested = process.argv.includes("--json");
5379
- const program = new Command().name("shipd").description("shipd CLI — flags as code").option("--json", "Machine-readable JSON output", false).option("--yes", "Skip confirmation prompts", false).option("--ci", "Non-interactive mode (same as --yes / CI=1)", false).option("--api-url <url>", "API origin").option("--org <slug>", "Organization slug (session: select; API key: must match)").option("--project <slug>", "Project slug").option("--env <slug>", "Environment slug").option("--config <path>", "Project settings JSON (.shipd/config.json shape)").option("--flags-config <path>", "Path to shipd.config.ts").exitOverride().showHelpAfterError(!jsonRequested);
5380
+ const program = new Command().name("shipd").description("shipd CLI — flags as code").option("--json", "Machine-readable JSON output", false).option("--yes", "Skip confirmation prompts", false).option("--ci", "Non-interactive mode (same as --yes / CI=1)", false).option("--api-url <url>", `API origin (default: ${DEFAULT_API_URL})`).option("--org <slug>", "Organization slug (session: select; API key: must match)").option("--project <slug>", "Project slug").option("--env <slug>", "Environment slug").option("--config <path>", "Project settings JSON (.shipd/config.json shape)").option("--flags-config <path>", "Path to shipd.config.ts").exitOverride().showHelpAfterError(!jsonRequested);
5380
5381
  if (jsonRequested) program.configureOutput({
5381
5382
  writeErr: () => {},
5382
5383
  writeOut: () => {}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shipdit/cli",
3
- "version": "0.4.0",
3
+ "version": "0.4.1",
4
4
  "description": "shipd's command-line interface",
5
5
  "homepage": "https://docs.useshipd.com",
6
6
  "bugs": {