Skip to content

Commit 5e035d0

Browse files
authored
refactor: move command descriptions out of TUI module (#1451)
* refactor: move command descriptions out of TUI module * fix: avoid duplicate import from constants.ts * fix(format): run npm run format
1 parent 77c3de3 commit 5e035d0

25 files changed

Lines changed: 58 additions & 60 deletions

File tree

src/cli/cli.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,13 @@ import { registerTelemetry } from './commands/telemetry';
2929
import { registerTraces } from './commands/traces';
3030
import { registerUpdate } from './commands/update';
3131
import { registerValidate } from './commands/validate';
32-
import { PACKAGE_VERSION } from './constants';
32+
import { COMMAND_DESCRIPTIONS, PACKAGE_VERSION } from './constants';
3333
import { isPreviewEnabled } from './feature-flags';
3434
import { printPostCommandNotices, printTelemetryNotice } from './notices';
3535
import { ALL_PRIMITIVES } from './primitives';
3636
import { TelemetryClientAccessor } from './telemetry';
3737
import { renderTUI, setupAltScreenCleanup } from './tui';
3838
import { LayoutProvider } from './tui/context';
39-
import { COMMAND_DESCRIPTIONS } from './tui/copy';
4039
import { clearExitMessage, getExitMessage } from './tui/exit-message';
4140
import { requireTTY } from './tui/guards';
4241
import { CommandListScreen } from './tui/screens/home';

src/cli/commands/add/command.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1+
import { COMMAND_DESCRIPTIONS } from '../../constants';
12
import { renderTUI } from '../../tui';
2-
import { COMMAND_DESCRIPTIONS } from '../../tui/copy';
33
import { requireProject, requireTTY } from '../../tui/guards';
44
import type { Command } from '@commander-js/extra-typings';
55

src/cli/commands/archive/command.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { deleteBatchEvaluation } from '../../aws/agentcore-batch-evaluation';
22
import { deleteRecommendation } from '../../aws/agentcore-recommendation';
3+
import { COMMAND_DESCRIPTIONS } from '../../constants';
34
import { getErrorMessage } from '../../errors';
45
import { deleteLocalBatchEvalRun, deleteLocalRecommendationRun } from '../../operations/archive/archive-storage';
5-
import { COMMAND_DESCRIPTIONS } from '../../tui/copy';
66
import { requireProject } from '../../tui/guards';
77
import { getRegion } from '../shared/region-utils';
88
import type { Command } from '@commander-js/extra-typings';

src/cli/commands/config/command.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { COMMAND_DESCRIPTIONS } from '../../tui/copy.js';
1+
import { COMMAND_DESCRIPTIONS } from '../../constants.js';
22
import { handleConfigGet, handleConfigList, handleConfigSet } from './actions.js';
33
import type { ConfigResult } from './types.js';
44
import type { Command } from '@commander-js/extra-typings';

src/cli/commands/create/command.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import type {
99
TargetLanguage,
1010
} from '../../../schema';
1111
import { LIFECYCLE_TIMEOUT_MAX, LIFECYCLE_TIMEOUT_MIN } from '../../../schema';
12-
import { ANSI } from '../../constants';
12+
import { ANSI, COMMAND_DESCRIPTIONS } from '../../constants';
1313
import { getErrorMessage } from '../../errors';
1414
import { isPreviewEnabled } from '../../feature-flags';
1515
import { harnessPrimitive } from '../../primitives/registry';
@@ -26,7 +26,6 @@ import {
2626
standardize,
2727
} from '../../telemetry/schemas/common-shapes.js';
2828
import { renderTUI } from '../../tui';
29-
import { COMMAND_DESCRIPTIONS } from '../../tui/copy';
3029
import { requireTTY } from '../../tui/guards';
3130
import { parseCommaSeparatedList } from '../shared/vpc-utils';
3231
import { type ProgressCallback, createProject, createProjectWithAgent, getDryRunInfo } from './action';

src/cli/commands/deploy/command.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { ConfigIO, serializeResult } from '../../../lib';
2+
import { COMMAND_DESCRIPTIONS } from '../../constants';
23
import { getErrorMessage } from '../../errors';
34
import { withCommandRunTelemetry } from '../../telemetry/cli-command-run.js';
45
import { renderTUI } from '../../tui';
5-
import { COMMAND_DESCRIPTIONS } from '../../tui/copy';
66
import { requireProject, requireTTY } from '../../tui/guards';
77
import { handleDeploy } from './actions';
88
import type { DeployOptions, DeployResult } from './types';

src/cli/commands/dev/command.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import {
77
getWorkingDirectory,
88
} from '../../../lib';
99
import { failureResult } from '../../../lib/result.js';
10+
import { COMMAND_DESCRIPTIONS } from '../../constants';
1011
import { getErrorMessage } from '../../errors';
1112
import { detectContainerRuntime } from '../../external-requirements';
1213
import { isPreviewEnabled } from '../../feature-flags';
@@ -31,7 +32,6 @@ import { OtelCollector, startOtelCollector } from '../../operations/dev/otel';
3132
import { withCommandRunTelemetry } from '../../telemetry/cli-command-run.js';
3233
import { AgentProtocol, standardize } from '../../telemetry/schemas/common-shapes.js';
3334
import { LayoutProvider } from '../../tui/context';
34-
import { COMMAND_DESCRIPTIONS } from '../../tui/copy';
3535
import { requireProject, requireTTY } from '../../tui/guards';
3636
import { runCliDeploy } from '../deploy/progress';
3737
import { parseHeaderFlags } from '../shared/header-utils';

src/cli/commands/eval/command.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { serializeResult } from '../../../lib';
2+
import { COMMAND_DESCRIPTIONS } from '../../constants';
23
import { getErrorMessage } from '../../errors';
34
import { handleListEvalRuns } from '../../operations/eval';
45
import { getResultsPath } from '../../operations/eval/storage';
5-
import { COMMAND_DESCRIPTIONS } from '../../tui/copy';
66
import { requireProject } from '../../tui/guards';
77
import type { Command } from '@commander-js/extra-typings';
88
import { Text, render } from 'ink';

src/cli/commands/feedback/command.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1+
import { COMMAND_DESCRIPTIONS } from '../../constants';
12
import { runCliCommand } from '../../telemetry/cli-command-run.js';
2-
import { COMMAND_DESCRIPTIONS } from '../../tui/copy';
33
import { requireTTY } from '../../tui/guards/tty';
44
import { FeedbackScreen } from '../../tui/screens/feedback';
55
import { handleFeedback } from './action';

src/cli/commands/fetch/command.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1+
import { COMMAND_DESCRIPTIONS } from '../../constants';
12
import { getErrorMessage } from '../../errors';
2-
import { COMMAND_DESCRIPTIONS } from '../../tui/copy';
33
import { requireProject } from '../../tui/guards';
44
import { handleFetchAccess } from './action';
55
import type { FetchAccessResult } from './action';

0 commit comments

Comments
 (0)