Skip to content

Commit 1ff6828

Browse files
committed
kind field on our custom commands
1 parent 2423253 commit 1ff6828

7 files changed

Lines changed: 27 additions & 14 deletions

File tree

packages/cli/src/ui/commands/fallbackImprovedCommand.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,14 @@
55
*/
66

77
import { t } from '@thacio/auditaria-cli-core';
8-
import { type SlashCommand } from './types.js';
8+
import { type SlashCommand, CommandKind } from './types.js';
99

1010
export const fallbackImprovedCommand: SlashCommand = {
1111
name: 'fallback-improved',
12-
description: 'toggle between improved fallback strategy (7 attempts, 2s delays, reset to Pro) and original Google behavior (2 attempts, exponential backoff)',
12+
get description() {
13+
return t('commands.fallback_improved.description', 'toggle between improved fallback strategy (7 attempts, 2s delays, reset to Pro) and original Google behavior (2 attempts, exponential backoff)');
14+
},
15+
kind: CommandKind.BUILT_IN,
1316
action: async (context, _args) => {
1417
const { config } = context.services;
1518
if (!config) return;

packages/cli/src/ui/commands/languageCommand.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,15 @@
44
* SPDX-License-Identifier: Apache-2.0
55
*/
66

7-
import { type SlashCommand } from './types.js';
7+
import { type SlashCommand, CommandKind } from './types.js';
8+
import { t } from '@thacio/auditaria-cli-core';
89

910
export const languageCommand: SlashCommand = {
1011
name: 'language',
11-
description: 'change language preference',
12+
get description() {
13+
return t('commands.language.description', 'change language preference');
14+
},
15+
kind: CommandKind.BUILT_IN,
1216
action: (_context, _args) => ({
1317
type: 'dialog',
1418
dialog: 'language',

packages/cli/src/ui/commands/modelSwitchCommand.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,14 @@
55
*/
66

77
import { DEFAULT_GEMINI_MODEL, DEFAULT_GEMINI_FLASH_MODEL, t } from '@thacio/auditaria-cli-core';
8-
import { type SlashCommand } from './types.js';
8+
import { type SlashCommand, CommandKind } from './types.js';
99

1010
export const modelSwitchCommand: SlashCommand = {
1111
name: 'model-switch',
12-
description: 'switch between Gemini Pro and Flash models',
12+
get description() {
13+
return t('commands.model_switch.description', 'switch between Gemini Pro and Flash models');
14+
},
15+
kind: CommandKind.BUILT_IN,
1316
action: async (context, _args) => {
1417
const { config } = context.services;
1518
if (!config) return;

packages/cli/src/ui/commands/stayProCommand.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,14 @@
55
*/
66

77
import { t } from '@thacio/auditaria-cli-core';
8-
import { type SlashCommand } from './types.js';
8+
import { type SlashCommand, CommandKind } from './types.js';
99

1010
export const stayProCommand: SlashCommand = {
1111
name: 'stay-pro',
12-
description: 'toggle whether to stay on Pro model (disable/enable fallback to Flash)',
12+
get description() {
13+
return t('commands.stay_pro.description', 'toggle whether to stay on Pro model (disable/enable fallback to Flash)');
14+
},
15+
kind: CommandKind.BUILT_IN,
1316
action: async (context, _args) => {
1417
const { config } = context.services;
1518
if (!config) return;

packages/cli/src/utils/userStartupWarnings.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,17 +39,15 @@ const rootDirectoryCheck: WarningCheck = {
3939
check: async (workspaceRoot: string) => {
4040
try {
4141
const workspaceRealPath = await fs.realpath(workspaceRoot);
42-
const errorMessage =
43-
'Warning: You are running Gemini CLI in the root directory. Your entire folder structure will be used for context. It is strongly recommended to run in a project-specific directory.';
4442

4543
// Check for Unix root directory
4644
if (path.dirname(workspaceRealPath) === workspaceRealPath) {
47-
return errorMessage;
45+
return t('startup.root_directory_warning', 'Warning: You are running Auditaria CLI in the root directory. Your entire folder structure will be used for context. It is strongly recommended to run in a project-specific directory.');
4846
}
4947

5048
return null;
5149
} catch (_err: unknown) {
52-
return 'Could not verify the current directory due to a file system error.';
50+
return t('startup.directory_verification_error', 'Could not verify the current directory due to a file system error.');
5351
}
5452
},
5553
};

packages/core/src/i18n/locales/en.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -697,7 +697,8 @@
697697
"not_loaded": "No hierarchical memory (GEMINI.md or other context files) is currently loaded."
698698
},
699699
"startup": {
700-
"home_directory_warning": "You are running Gemini CLI in your home directory. It is recommended to run in a project-specific directory.",
700+
"home_directory_warning": "You are running Auditaria CLI in your home directory. It is recommended to run in a project-specific directory.",
701+
"root_directory_warning": "Warning: You are running Auditaria CLI in the root directory. Your entire folder structure will be used for context. It is strongly recommended to run in a project-specific directory.",
701702
"directory_verification_error": "Could not verify the current directory due to a file system error.",
702703
"cannot_delete_warnings_file": "Warning: Could not delete temporary warnings file.",
703704
"error_reading_warnings_file": "Error checking/reading warnings file: {error}"

packages/core/src/i18n/locales/pt.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -666,7 +666,8 @@
666666
"not_loaded": "Nenhuma memória hierárquica (GEMINI.md ou outros arquivos de contexto) está atualmente carregada."
667667
},
668668
"startup": {
669-
"home_directory_warning": "Você está executando o Gemini CLI no seu diretório home. É recomendado executar em um diretório específico do projeto.",
669+
"home_directory_warning": "Você está executando o Auditaria CLI no seu diretório home. É recomendado executar em um diretório específico do projeto.",
670+
"root_directory_warning": "Aviso: Você está executando o Auditaria CLI no diretório raiz. Toda a estrutura de pastas será usada para contexto. É fortemente recomendado executar em um diretório específico do projeto.",
670671
"directory_verification_error": "Não foi possível verificar o diretório atual devido a um erro do sistema de arquivos.",
671672
"cannot_delete_warnings_file": "Aviso: Não foi possível deletar o arquivo temporário de avisos.",
672673
"error_reading_warnings_file": "Erro ao verificar/ler arquivo de avisos: {error}"

0 commit comments

Comments
 (0)