@base44-preview/cli 0.3.6-pr.704.e6240ba → 0.3.6-pr.706.15dfd19

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 CHANGED
@@ -83,9 +83,18 @@ These work with any command:
83
83
  | Flag | Description |
84
84
  | ---- | ----------- |
85
85
  | `--app-id <id>` | Target a Base44 app explicitly (overrides the linked project and `BASE44_APP_ID`) |
86
- | `--hostname <host>` | Send every request to this Base44 host instead of `app.base44.com`, e.g. `base44 login --hostname acme.base44.com` (overrides `BASE44_API_URL`; a full URL also works). `login` saves the host with the login, so later commands use it without the flag; `whoami` shows it and `logout` clears it |
87
86
  | `--json` | Emit machine-readable JSON to stdout and run in silent mode |
88
87
 
88
+ ### Another Base44 host
89
+
90
+ To use a Base44 host other than `app.base44.com` (for example a dedicated tenant), log in with `--hostname`:
91
+
92
+ ```bash
93
+ base44 login --hostname acme.base44.com
94
+ ```
95
+
96
+ The host is saved with the login, so every later command goes there; `whoami` shows it and `logout` clears it. A hostname or a full URL both work. In CI, set `BASE44_API_URL` alongside the credential env vars instead.
97
+
89
98
  ### `--json`
90
99
 
91
100
  Use `--json` for scripting and agent automation:
package/dist/cli/index.js CHANGED
@@ -225957,6 +225957,10 @@ var DEFAULT_API_URL = "https://app.base44.com";
225957
225957
  function getBase44ApiUrl() {
225958
225958
  return process.env.BASE44_API_URL || DEFAULT_API_URL;
225959
225959
  }
225960
+ function getAppsBackendUrl() {
225961
+ const apiUrl = getBase44ApiUrl();
225962
+ return apiUrl === DEFAULT_API_URL ? "https://base44.app" : apiUrl;
225963
+ }
225960
225964
  function getTestOverrides() {
225961
225965
  const raw = process.env.BASE44_CLI_TEST_OVERRIDES;
225962
225966
  if (!raw) {
@@ -229062,19 +229066,21 @@ function loadSavedLoginApiUrl(authFilePath = getAuthFilePath()) {
229062
229066
  }
229063
229067
 
229064
229068
  // src/cli/bootstrap-env.ts
229065
- function applyHostnameFlag(argv) {
229066
- const i = argv.findIndex((arg) => arg === "--hostname" || arg.startsWith("--hostname="));
229067
- if (i === -1) {
229069
+ function applyLoginHostnameFlag(argv) {
229070
+ const args = argv.slice(2);
229071
+ const login = args.indexOf("login");
229072
+ const i = args.findIndex((arg) => arg === "--hostname" || arg.startsWith("--hostname="));
229073
+ if (login === -1 || i < login) {
229068
229074
  return;
229069
229075
  }
229070
- const value = argv[i].includes("=") ? argv[i].slice("--hostname=".length) : argv[i + 1];
229076
+ const value = args[i].includes("=") ? args[i].slice("--hostname=".length) : args[i + 1];
229071
229077
  if (!value || value.startsWith("-")) {
229072
229078
  return;
229073
229079
  }
229074
229080
  const url = value.includes("://") ? value : `https://${value}`;
229075
229081
  process.env.BASE44_API_URL = url.replace(/\/+$/, "");
229076
229082
  }
229077
- applyHostnameFlag(process.argv);
229083
+ applyLoginHostnameFlag(process.argv);
229078
229084
  loadProjectEnvFiles();
229079
229085
  loadSavedLoginApiUrl();
229080
229086
 
@@ -250554,7 +250560,7 @@ function getLoginCommand() {
250554
250560
  return new Base44Command("login", {
250555
250561
  requireAuth: false,
250556
250562
  requireAppContext: false
250557
- }).description("Authenticate with Base44").action(login);
250563
+ }).description("Authenticate with Base44").option("--hostname <host>", "Base44 host to log in to and use from then on (default: app.base44.com)").action(login);
250558
250564
  }
250559
250565
 
250560
250566
  // src/cli/commands/auth/logout.ts
@@ -270975,7 +270981,6 @@ class WatchBase44 extends EventEmitter4 {
270975
270981
 
270976
270982
  // src/cli/dev/dev-server/main.ts
270977
270983
  var DEFAULT_PORT = 4400;
270978
- var BASE44_APP_URL = "https://base44.app";
270979
270984
  async function createDevServer(options) {
270980
270985
  const { port: userPort } = options;
270981
270986
  const port = userPort ?? await getPorts({
@@ -270985,7 +270990,7 @@ async function createDevServer(options) {
270985
270990
  const { functions, entities, project, siteUrl } = await options.loadResources();
270986
270991
  const app = import_express6.default();
270987
270992
  const remoteProxy = import_http_proxy_middleware2.createProxyMiddleware({
270988
- target: BASE44_APP_URL,
270993
+ target: getAppsBackendUrl(),
270989
270994
  changeOrigin: true
270990
270995
  });
270991
270996
  app.use(import_cors.default({
@@ -270995,7 +271000,7 @@ async function createDevServer(options) {
270995
271000
  const AUTH_ROUTE_PATTERN = /^\/api\/apps\/auth(\/|$)/;
270996
271001
  app.use((req, res, next) => {
270997
271002
  if (AUTH_ROUTE_PATTERN.test(req.path)) {
270998
- const targetUrl = new URL(req.originalUrl, BASE44_APP_URL);
271003
+ const targetUrl = new URL(req.originalUrl, getAppsBackendUrl());
270999
271004
  return res.redirect(targetUrl.toString());
271000
271005
  }
271001
271006
  next();
@@ -271302,7 +271307,7 @@ function inheritedEnv() {
271302
271307
  }
271303
271308
  return env;
271304
271309
  }
271305
- var appPreviewUrl = (appId) => `https://preview--${appId}.base44.app`;
271310
+ var appPreviewUrl = (appId) => getBase44ApiUrl() === DEFAULT_API_URL ? `https://preview--${appId}.base44.app` : getBase44ApiUrl();
271306
271311
  async function resolveAppBaseUrl(appId) {
271307
271312
  try {
271308
271313
  return await getSiteUrl();
@@ -271568,7 +271573,7 @@ function getEjectCommand() {
271568
271573
  // src/cli/program.ts
271569
271574
  function createProgram(context) {
271570
271575
  const program = new Command2;
271571
- program.name("base44").description("Base44 CLI - Unified interface for managing Base44 applications").version(package_default.version).option("--branch <name>", "Target an app branch by exact name (sandbox commands only)").addOption(new Option2("--app-id <id>", "Base44 app ID to use").env(BASE44_APP_ID_ENV_VAR)).option("--hostname <host>", "Base44 host to send every request to (overrides BASE44_API_URL)").addOption(new Option2("--json", "Output machine-readable JSON to stdout (status/logs go to stderr)"));
271576
+ program.name("base44").description("Base44 CLI - Unified interface for managing Base44 applications").version(package_default.version).option("--branch <name>", "Target an app branch by exact name (sandbox commands only)").addOption(new Option2("--app-id <id>", "Base44 app ID to use").env(BASE44_APP_ID_ENV_VAR)).addOption(new Option2("--json", "Output machine-readable JSON to stdout (status/logs go to stderr)"));
271572
271577
  program.configureHelp({
271573
271578
  sortSubcommands: true
271574
271579
  });
@@ -275658,4 +275663,4 @@ export {
275658
275663
  runCLI
275659
275664
  };
275660
275665
 
275661
- //# debugId=4071946F161FE21464756E2164756E21
275666
+ //# debugId=D50299D36725282164756E2164756E21