Skip to content

The open alternative to Salesforce, designed for AI.

Display which remote is used when twenty-sdk runs command (#20969)

martmull926448082414
diff --git a/packages/twenty-sdk/src/cli/commands/app/deploy.ts b/packages/twenty-sdk/src/cli/commands/app/deploy.ts
index b4035e48054..629961f321c 100644
--- a/packages/twenty-sdk/src/cli/commands/app/deploy.ts
+++ b/packages/twenty-sdk/src/cli/commands/app/deploy.ts
@@ -52,7 +52,9 @@ export class DeployCommand {
await checkSdkVersionCompatibility(appPath);
- console.log(chalk.blue('Deploying application...'));
+ const remoteName = options.remote ?? ConfigService.getActiveRemote();
+
+ console.log(chalk.blue(`Deploying application on ${remoteName}...`));
console.log(chalk.gray(`App path: ${appPath}\n`));
const onProgress = (message: string) => console.log(chalk.gray(message));
@@ -85,7 +87,6 @@ export class DeployCommand {
const appName = packageJson?.name ?? result.data.name;
const appVersion = packageJson?.version ?? 'unknown';
- const remoteName = ConfigService.getActiveRemote();
console.log(
chalk.green(`\nβœ“ Published ${appName} v${appVersion} to ${remoteName}\n`),
diff --git a/packages/twenty-sdk/src/cli/commands/app/install.ts b/packages/twenty-sdk/src/cli/commands/app/install.ts
index b9dee11bdb8..53ccb258eb0 100644
--- a/packages/twenty-sdk/src/cli/commands/app/install.ts
+++ b/packages/twenty-sdk/src/cli/commands/app/install.ts
@@ -1,4 +1,5 @@
import { appInstall } from '@/cli/operations/install';
+import { ConfigService } from '@/cli/utilities/config/config-service';
import { CURRENT_EXECUTION_DIRECTORY } from '@/cli/utilities/config/current-execution-directory';
import { checkSdkVersionCompatibility } from '@/cli/utilities/version/check-sdk-version-compatibility';
import { checkServerVersionCompatibility } from '@/cli/utilities/version/check-server-version-compatibility';
@@ -16,7 +17,9 @@ export class AppInstallCommand {
await checkSdkVersionCompatibility(appPath);
await checkServerVersionCompatibility();
- console.log(chalk.blue('Installing application...'));
+ const remoteName = options.remote ?? ConfigService.getActiveRemote();
+
+ console.log(chalk.blue(`Installing application on ${remoteName}...`));
console.log(chalk.gray(`App path: ${appPath}\n`));
const result = await appInstall({
diff --git a/packages/twenty-sdk/src/cli/commands/app/uninstall.ts b/packages/twenty-sdk/src/cli/commands/app/uninstall.ts
index 1dc41aadfa1..592fc7a5c73 100644
--- a/packages/twenty-sdk/src/cli/commands/app/uninstall.ts
+++ b/packages/twenty-sdk/src/cli/commands/app/uninstall.ts
@@ -1,5 +1,6 @@
import { appUninstall } from '@/cli/operations/uninstall';
import { type ApiResponse } from '@/cli/utilities/api/api-response-type';
+import { ConfigService } from '@/cli/utilities/config/config-service';
import { CURRENT_EXECUTION_DIRECTORY } from '@/cli/utilities/config/current-execution-directory';
import chalk from 'chalk';
import inquirer from 'inquirer';
@@ -12,7 +13,9 @@ export class AppUninstallCommand {
appPath?: string;
askForConfirmation: boolean;
}): Promise<ApiResponse<any>> {
- console.log(chalk.blue('πŸš€ Uninstall Twenty Application'));
+ const remoteName = ConfigService.getActiveRemote();
+
+ console.log(chalk.blue(`πŸš€ Uninstall Twenty Application on ${remoteName}`));
console.log(chalk.gray(`πŸ“ App Path: ${appPath}\n`));
if (askForConfirmation && !(await this.confirmationPrompt())) {
diff --git a/packages/twenty-sdk/src/cli/commands/dev/catalog-sync.ts b/packages/twenty-sdk/src/cli/commands/dev/catalog-sync.ts
index 2ef4c1fcc39..f16313159b2 100644
--- a/packages/twenty-sdk/src/cli/commands/dev/catalog-sync.ts
+++ b/packages/twenty-sdk/src/cli/commands/dev/catalog-sync.ts
@@ -12,7 +12,9 @@ export class CatalogSyncCommand {
ConfigService.setActiveRemote(options.remote);
}
- console.log(chalk.blue('Syncing marketplace catalog...'));
+ const remoteName = ConfigService.getActiveRemote();
+
+ console.log(chalk.blue(`Syncing marketplace catalog on ${remoteName}...`));
const apiService = new ApiService();
diff --git a/packages/twenty-sdk/src/cli/commands/dev/dev-once.ts b/packages/twenty-sdk/src/cli/commands/dev/dev-once.ts
index 5d335d4860c..daf64950cc3 100644
--- a/packages/twenty-sdk/src/cli/commands/dev/dev-once.ts
+++ b/packages/twenty-sdk/src/cli/commands/dev/dev-once.ts
@@ -1,4 +1,5 @@
import { appDevOnce } from '@/cli/operations/dev-once';
+import { ConfigService } from '@/cli/utilities/config/config-service';
import { CURRENT_EXECUTION_DIRECTORY } from '@/cli/utilities/config/current-execution-directory';
import { checkSdkVersionCompatibility } from '@/cli/utilities/version/check-sdk-version-compatibility';
import chalk from 'chalk';
@@ -14,7 +15,9 @@ export class AppDevOnceCommand {
await checkSdkVersionCompatibility(appPath);
- console.log(chalk.blue('Syncing application...'));
+ const remoteName = ConfigService.getActiveRemote();
+
+ console.log(chalk.blue(`Syncing application on ${remoteName}...`));
console.log(chalk.gray(`App path: ${appPath}\n`));
const result = await appDevOnce({
diff --git a/packages/twenty-sdk/src/cli/commands/dev/exec.ts b/packages/twenty-sdk/src/cli/commands/dev/exec.ts
index 0b182efa56e..5c9e9672f6e 100644
--- a/packages/twenty-sdk/src/cli/commands/dev/exec.ts
+++ b/packages/twenty-sdk/src/cli/commands/dev/exec.ts
@@ -1,5 +1,6 @@
import { functionExecute } from '@/cli/operations/execute';
import { APP_ERROR_CODES, FUNCTION_ERROR_CODES } from '@/cli/types';
+import { ConfigService } from '@/cli/utilities/config/config-service';
import { CURRENT_EXECUTION_DIRECTORY } from '@/cli/utilities/config/current-execution-directory';
import chalk from 'chalk';
import { isDefined } from 'twenty-shared/utils';
@@ -36,7 +37,11 @@ export class LogicFunctionExecuteCommand {
? 'pre install'
: (functionUniversalIdentifier ?? functionName);
- console.log(chalk.blue(`πŸš€ Executing function "${identifier}"...`));
+ const remoteName = ConfigService.getActiveRemote();
+
+ console.log(
+ chalk.blue(`πŸš€ Executing function "${identifier}" on ${remoteName}...`),
+ );
console.log(chalk.gray(` Payload: ${JSON.stringify(parsedPayload)}\n`));
const executeOptions = postInstall
diff --git a/packages/twenty-sdk/src/cli/commands/dev/logs.ts b/packages/twenty-sdk/src/cli/commands/dev/logs.ts
index 5b172be4b07..ebb4be61efe 100644
--- a/packages/twenty-sdk/src/cli/commands/dev/logs.ts
+++ b/packages/twenty-sdk/src/cli/commands/dev/logs.ts
@@ -1,4 +1,5 @@
import { ApiService } from '@/cli/utilities/api/api-service';
+import { ConfigService } from '@/cli/utilities/config/config-service';
import { CURRENT_EXECUTION_DIRECTORY } from '@/cli/utilities/config/current-execution-directory';
import chalk from 'chalk';
import { readManifestFromFile } from '@/cli/utilities/build/manifest/manifest-reader';
@@ -58,8 +59,12 @@ export class LogicFunctionLogsCommand {
? `function "${functionUniversalIdentifier || functionName}"`
: 'functions';
+ const remoteName = ConfigService.getActiveRemote();
+
console.log(
- chalk.blue(`πŸš€ Watching ${appPath} ${functionIdentifier} logs:\n`),
+ chalk.blue(
+ `πŸš€ Watching ${appPath} ${functionIdentifier} logs on ${remoteName}:\n`,
+ ),
);
}
}
diff --git a/packages/twenty-sdk/src/cli/utilities/dev/orchestrator/dev-mode-orchestrator.ts b/packages/twenty-sdk/src/cli/utilities/dev/orchestrator/dev-mode-orchestrator.ts
index d8c0e7855bf..8a10435355a 100644
--- a/packages/twenty-sdk/src/cli/utilities/dev/orchestrator/dev-mode-orchestrator.ts
+++ b/packages/twenty-sdk/src/cli/utilities/dev/orchestrator/dev-mode-orchestrator.ts
@@ -91,14 +91,20 @@ export class DevModeOrchestrator {
await ensureDir(outputDir);
await emptyDir(outputDir);
+ this.state.addEvent({
+ message: `Using remote "${ConfigService.getActiveRemote()}"`,
+ status: 'info',
+ });
+
if (!this.verbose) {
this.state.addEvent({
message: 'Add --verbose to see fully detailed logs',
status: 'info',
});
- this.state.notify();
}
+ this.state.notify();
+
await this.startWatchersStep.start();
this.serverCheckInterval = setInterval(() => {