diff --git a/src/cli/cli.ts b/src/cli/cli.ts index 854e80ad9..b4595b10b 100644 --- a/src/cli/cli.ts +++ b/src/cli/cli.ts @@ -29,14 +29,13 @@ import { registerTelemetry } from './commands/telemetry'; import { registerTraces } from './commands/traces'; import { registerUpdate } from './commands/update'; import { registerValidate } from './commands/validate'; -import { PACKAGE_VERSION } from './constants'; +import { COMMAND_DESCRIPTIONS, PACKAGE_VERSION } from './constants'; import { isPreviewEnabled } from './feature-flags'; import { printPostCommandNotices, printTelemetryNotice } from './notices'; import { ALL_PRIMITIVES } from './primitives'; import { TelemetryClientAccessor } from './telemetry'; import { renderTUI, setupAltScreenCleanup } from './tui'; import { LayoutProvider } from './tui/context'; -import { COMMAND_DESCRIPTIONS } from './tui/copy'; import { clearExitMessage, getExitMessage } from './tui/exit-message'; import { requireTTY } from './tui/guards'; import { CommandListScreen } from './tui/screens/home'; diff --git a/src/cli/commands/add/command.tsx b/src/cli/commands/add/command.tsx index 4a98fa0d5..6ef794ed8 100644 --- a/src/cli/commands/add/command.tsx +++ b/src/cli/commands/add/command.tsx @@ -1,5 +1,5 @@ +import { COMMAND_DESCRIPTIONS } from '../../constants'; import { renderTUI } from '../../tui'; -import { COMMAND_DESCRIPTIONS } from '../../tui/copy'; import { requireProject, requireTTY } from '../../tui/guards'; import type { Command } from '@commander-js/extra-typings'; diff --git a/src/cli/commands/archive/command.tsx b/src/cli/commands/archive/command.tsx index 780883522..4cf042bee 100644 --- a/src/cli/commands/archive/command.tsx +++ b/src/cli/commands/archive/command.tsx @@ -1,8 +1,8 @@ import { deleteBatchEvaluation } from '../../aws/agentcore-batch-evaluation'; import { deleteRecommendation } from '../../aws/agentcore-recommendation'; +import { COMMAND_DESCRIPTIONS } from '../../constants'; import { getErrorMessage } from '../../errors'; import { deleteLocalBatchEvalRun, deleteLocalRecommendationRun } from '../../operations/archive/archive-storage'; -import { COMMAND_DESCRIPTIONS } from '../../tui/copy'; import { requireProject } from '../../tui/guards'; import { getRegion } from '../shared/region-utils'; import type { Command } from '@commander-js/extra-typings'; diff --git a/src/cli/commands/config/command.ts b/src/cli/commands/config/command.ts index c61e7fae6..8120fd806 100644 --- a/src/cli/commands/config/command.ts +++ b/src/cli/commands/config/command.ts @@ -1,4 +1,4 @@ -import { COMMAND_DESCRIPTIONS } from '../../tui/copy.js'; +import { COMMAND_DESCRIPTIONS } from '../../constants.js'; import { handleConfigGet, handleConfigList, handleConfigSet } from './actions.js'; import type { ConfigResult } from './types.js'; import type { Command } from '@commander-js/extra-typings'; diff --git a/src/cli/commands/create/command.tsx b/src/cli/commands/create/command.tsx index aa3f8e84e..fcac116fb 100644 --- a/src/cli/commands/create/command.tsx +++ b/src/cli/commands/create/command.tsx @@ -9,7 +9,7 @@ import type { TargetLanguage, } from '../../../schema'; import { LIFECYCLE_TIMEOUT_MAX, LIFECYCLE_TIMEOUT_MIN } from '../../../schema'; -import { ANSI } from '../../constants'; +import { ANSI, COMMAND_DESCRIPTIONS } from '../../constants'; import { getErrorMessage } from '../../errors'; import { isPreviewEnabled } from '../../feature-flags'; import { harnessPrimitive } from '../../primitives/registry'; @@ -26,7 +26,6 @@ import { standardize, } from '../../telemetry/schemas/common-shapes.js'; import { renderTUI } from '../../tui'; -import { COMMAND_DESCRIPTIONS } from '../../tui/copy'; import { requireTTY } from '../../tui/guards'; import { parseCommaSeparatedList } from '../shared/vpc-utils'; import { type ProgressCallback, createProject, createProjectWithAgent, getDryRunInfo } from './action'; diff --git a/src/cli/commands/deploy/command.tsx b/src/cli/commands/deploy/command.tsx index 914308768..594dc8a81 100644 --- a/src/cli/commands/deploy/command.tsx +++ b/src/cli/commands/deploy/command.tsx @@ -1,8 +1,8 @@ import { ConfigIO, serializeResult } from '../../../lib'; +import { COMMAND_DESCRIPTIONS } from '../../constants'; import { getErrorMessage } from '../../errors'; import { withCommandRunTelemetry } from '../../telemetry/cli-command-run.js'; import { renderTUI } from '../../tui'; -import { COMMAND_DESCRIPTIONS } from '../../tui/copy'; import { requireProject, requireTTY } from '../../tui/guards'; import { handleDeploy } from './actions'; import type { DeployOptions, DeployResult } from './types'; diff --git a/src/cli/commands/dev/command.tsx b/src/cli/commands/dev/command.tsx index ca34d00ef..13062d65e 100644 --- a/src/cli/commands/dev/command.tsx +++ b/src/cli/commands/dev/command.tsx @@ -7,6 +7,7 @@ import { getWorkingDirectory, } from '../../../lib'; import { failureResult } from '../../../lib/result.js'; +import { COMMAND_DESCRIPTIONS } from '../../constants'; import { getErrorMessage } from '../../errors'; import { detectContainerRuntime } from '../../external-requirements'; import { isPreviewEnabled } from '../../feature-flags'; @@ -31,7 +32,6 @@ import { OtelCollector, startOtelCollector } from '../../operations/dev/otel'; import { withCommandRunTelemetry } from '../../telemetry/cli-command-run.js'; import { AgentProtocol, standardize } from '../../telemetry/schemas/common-shapes.js'; import { LayoutProvider } from '../../tui/context'; -import { COMMAND_DESCRIPTIONS } from '../../tui/copy'; import { requireProject, requireTTY } from '../../tui/guards'; import { runCliDeploy } from '../deploy/progress'; import { parseHeaderFlags } from '../shared/header-utils'; diff --git a/src/cli/commands/eval/command.tsx b/src/cli/commands/eval/command.tsx index 4a086584b..ab1ef756b 100644 --- a/src/cli/commands/eval/command.tsx +++ b/src/cli/commands/eval/command.tsx @@ -1,8 +1,8 @@ import { serializeResult } from '../../../lib'; +import { COMMAND_DESCRIPTIONS } from '../../constants'; import { getErrorMessage } from '../../errors'; import { handleListEvalRuns } from '../../operations/eval'; import { getResultsPath } from '../../operations/eval/storage'; -import { COMMAND_DESCRIPTIONS } from '../../tui/copy'; import { requireProject } from '../../tui/guards'; import type { Command } from '@commander-js/extra-typings'; import { Text, render } from 'ink'; diff --git a/src/cli/commands/feedback/command.tsx b/src/cli/commands/feedback/command.tsx index e52ec41e7..408cef62d 100644 --- a/src/cli/commands/feedback/command.tsx +++ b/src/cli/commands/feedback/command.tsx @@ -1,5 +1,5 @@ +import { COMMAND_DESCRIPTIONS } from '../../constants'; import { runCliCommand } from '../../telemetry/cli-command-run.js'; -import { COMMAND_DESCRIPTIONS } from '../../tui/copy'; import { requireTTY } from '../../tui/guards/tty'; import { FeedbackScreen } from '../../tui/screens/feedback'; import { handleFeedback } from './action'; diff --git a/src/cli/commands/fetch/command.tsx b/src/cli/commands/fetch/command.tsx index 3b93dd924..e2e43cefb 100644 --- a/src/cli/commands/fetch/command.tsx +++ b/src/cli/commands/fetch/command.tsx @@ -1,5 +1,5 @@ +import { COMMAND_DESCRIPTIONS } from '../../constants'; import { getErrorMessage } from '../../errors'; -import { COMMAND_DESCRIPTIONS } from '../../tui/copy'; import { requireProject } from '../../tui/guards'; import { handleFetchAccess } from './action'; import type { FetchAccessResult } from './action'; diff --git a/src/cli/commands/invoke/command.tsx b/src/cli/commands/invoke/command.tsx index 4817a72b9..0c7780ca1 100644 --- a/src/cli/commands/invoke/command.tsx +++ b/src/cli/commands/invoke/command.tsx @@ -1,9 +1,9 @@ import { ValidationError, serializeResult } from '../../../lib'; +import { COMMAND_DESCRIPTIONS } from '../../constants'; import { getErrorMessage } from '../../errors'; import { isPreviewEnabled } from '../../feature-flags'; import { withCommandRunTelemetry } from '../../telemetry/cli-command-run.js'; import { renderTUI } from '../../tui'; -import { COMMAND_DESCRIPTIONS } from '../../tui/copy'; import { requireProject, requireTTY } from '../../tui/guards'; import { parseHeaderFlags } from '../shared/header-utils'; import { type InvokeContext, handleHarnessInvokeByArn, handleInvoke, loadInvokeConfig } from './action'; diff --git a/src/cli/commands/logs/command.tsx b/src/cli/commands/logs/command.tsx index ba6d1ef21..39a50f33b 100644 --- a/src/cli/commands/logs/command.tsx +++ b/src/cli/commands/logs/command.tsx @@ -1,7 +1,7 @@ +import { COMMAND_DESCRIPTIONS } from '../../constants'; import { getErrorMessage } from '../../errors'; import { handleLogsEval } from '../../operations/eval'; import type { LogsEvalOptions } from '../../operations/eval'; -import { COMMAND_DESCRIPTIONS } from '../../tui/copy'; import { requireProject } from '../../tui/guards'; import { handleLogs } from './action'; import type { LogsOptions } from './types'; diff --git a/src/cli/commands/package/command.tsx b/src/cli/commands/package/command.tsx index 6dcbeaf9c..4994e0178 100644 --- a/src/cli/commands/package/command.tsx +++ b/src/cli/commands/package/command.tsx @@ -1,5 +1,5 @@ +import { COMMAND_DESCRIPTIONS } from '../../constants'; import { getErrorMessage } from '../../errors'; -import { COMMAND_DESCRIPTIONS } from '../../tui/copy'; import { handlePackage, loadPackageConfig } from './action'; import type { Command } from '@commander-js/extra-typings'; import { Text, render } from 'ink'; diff --git a/src/cli/commands/pause/command.tsx b/src/cli/commands/pause/command.tsx index c60f87158..5ef404ed7 100644 --- a/src/cli/commands/pause/command.tsx +++ b/src/cli/commands/pause/command.tsx @@ -1,10 +1,10 @@ import { ConfigIO, serializeResult } from '../../../lib'; import { listABTests, updateABTest } from '../../aws/agentcore-ab-tests'; import { stopBatchEvaluation } from '../../aws/agentcore-batch-evaluation'; +import { COMMAND_DESCRIPTIONS } from '../../constants'; import { getErrorMessage } from '../../errors'; import { handlePauseResume } from '../../operations/eval'; import type { OnlineEvalActionOptions } from '../../operations/eval'; -import { COMMAND_DESCRIPTIONS } from '../../tui/copy'; import { requireProject } from '../../tui/guards'; import { getRegion } from '../shared/region-utils'; import { waitForRunningThenStop } from './promote-utils'; diff --git a/src/cli/commands/recommendations/command.tsx b/src/cli/commands/recommendations/command.tsx index bcf3b2784..cccbbc8f6 100644 --- a/src/cli/commands/recommendations/command.tsx +++ b/src/cli/commands/recommendations/command.tsx @@ -1,6 +1,6 @@ +import { COMMAND_DESCRIPTIONS } from '../../constants'; import { getErrorMessage } from '../../errors'; import { listAllRecommendations } from '../../operations/recommendation'; -import { COMMAND_DESCRIPTIONS } from '../../tui/copy'; import { requireProject } from '../../tui/guards'; import type { Command } from '@commander-js/extra-typings'; import { Text, render } from 'ink'; diff --git a/src/cli/commands/remove/command.tsx b/src/cli/commands/remove/command.tsx index c30d8b6ad..8c2b07f4a 100644 --- a/src/cli/commands/remove/command.tsx +++ b/src/cli/commands/remove/command.tsx @@ -1,8 +1,8 @@ import { ConfigIO, serializeResult, toError } from '../../../lib'; +import { COMMAND_DESCRIPTIONS } from '../../constants'; import { getErrorMessage } from '../../errors'; import { runCliCommand } from '../../telemetry/cli-command-run.js'; import { renderTUI } from '../../tui'; -import { COMMAND_DESCRIPTIONS } from '../../tui/copy'; import { requireProject, requireTTY } from '../../tui/guards'; import type { RemoveAllOptions, RemoveResult } from './types'; import { validateRemoveAllOptions } from './validate'; diff --git a/src/cli/commands/run/command.tsx b/src/cli/commands/run/command.tsx index 091d95727..dcac6dac1 100644 --- a/src/cli/commands/run/command.tsx +++ b/src/cli/commands/run/command.tsx @@ -1,5 +1,6 @@ import { serializeResult } from '../../../lib'; import type { RecommendationType } from '../../aws/agentcore-recommendation'; +import { COMMAND_DESCRIPTIONS } from '../../constants'; import { getErrorMessage } from '../../errors'; import { handleRunEval } from '../../operations/eval'; import type { RunEvalOptions } from '../../operations/eval'; @@ -14,7 +15,6 @@ import { runRecommendationCommand, saveRecommendationRun, } from '../../operations/recommendation'; -import { COMMAND_DESCRIPTIONS } from '../../tui/copy'; import { requireProject } from '../../tui/guards'; import type { Command } from '@commander-js/extra-typings'; import { Text, render } from 'ink'; diff --git a/src/cli/commands/status/command.tsx b/src/cli/commands/status/command.tsx index 94ed5328a..e1ed074e0 100644 --- a/src/cli/commands/status/command.tsx +++ b/src/cli/commands/status/command.tsx @@ -1,11 +1,11 @@ import { ValidationError, serializeResult } from '../../../lib'; +import { COMMAND_DESCRIPTIONS } from '../../constants'; import { getErrorMessage } from '../../errors'; import { isPreviewEnabled } from '../../feature-flags'; import { getDatasetStatus } from '../../operations/dataset'; import type { DatasetStatusResult } from '../../operations/dataset'; import { withCommandRunTelemetry } from '../../telemetry/cli-command-run.js'; import { FilterState, FilterType, standardize } from '../../telemetry/schemas/common-shapes.js'; -import { COMMAND_DESCRIPTIONS } from '../../tui/copy'; import { requireProject } from '../../tui/guards'; import type { ResourceStatusEntry } from './action'; import { handleProjectStatus, handleRuntimeLookup, loadStatusConfig } from './action'; diff --git a/src/cli/commands/stop/command.tsx b/src/cli/commands/stop/command.tsx index 74d6665f2..75f9d96cf 100644 --- a/src/cli/commands/stop/command.tsx +++ b/src/cli/commands/stop/command.tsx @@ -1,6 +1,6 @@ import { stopBatchEvaluation } from '../../aws/agentcore-batch-evaluation'; +import { COMMAND_DESCRIPTIONS } from '../../constants'; import { getErrorMessage } from '../../errors'; -import { COMMAND_DESCRIPTIONS } from '../../tui/copy'; import { getRegion } from '../shared/region-utils'; import type { Command } from '@commander-js/extra-typings'; import { Text, render } from 'ink'; diff --git a/src/cli/commands/telemetry/command.ts b/src/cli/commands/telemetry/command.ts index a3c286aed..1562257fc 100644 --- a/src/cli/commands/telemetry/command.ts +++ b/src/cli/commands/telemetry/command.ts @@ -1,4 +1,4 @@ -import { COMMAND_DESCRIPTIONS } from '../../tui/copy.js'; +import { COMMAND_DESCRIPTIONS } from '../../constants.js'; import { handleTelemetryStatus } from './actions.js'; import type { Command } from '@commander-js/extra-typings'; diff --git a/src/cli/commands/traces/command.tsx b/src/cli/commands/traces/command.tsx index 576a686b3..e15088d04 100644 --- a/src/cli/commands/traces/command.tsx +++ b/src/cli/commands/traces/command.tsx @@ -1,6 +1,6 @@ +import { COMMAND_DESCRIPTIONS } from '../../constants'; import { getErrorMessage } from '../../errors'; import { loadDeployedProjectConfig } from '../../operations/resolve-agent'; -import { COMMAND_DESCRIPTIONS } from '../../tui/copy'; import { requireProject } from '../../tui/guards'; import { handleTracesGet, handleTracesList } from './action'; import type { TracesGetOptions, TracesListOptions } from './types'; diff --git a/src/cli/commands/update/command.tsx b/src/cli/commands/update/command.tsx index 06bb9ebad..6c63e0fbc 100644 --- a/src/cli/commands/update/command.tsx +++ b/src/cli/commands/update/command.tsx @@ -1,5 +1,5 @@ +import { COMMAND_DESCRIPTIONS } from '../../constants'; import { getErrorMessage } from '../../errors'; -import { COMMAND_DESCRIPTIONS } from '../../tui/copy'; import { handleUpdate } from './action'; import type { Command } from '@commander-js/extra-typings'; import { Text, render } from 'ink'; diff --git a/src/cli/commands/validate/command.tsx b/src/cli/commands/validate/command.tsx index 4b13a4869..7842ec24a 100644 --- a/src/cli/commands/validate/command.tsx +++ b/src/cli/commands/validate/command.tsx @@ -1,5 +1,5 @@ +import { COMMAND_DESCRIPTIONS } from '../../constants'; import { withCommandRunTelemetry } from '../../telemetry/cli-command-run.js'; -import { COMMAND_DESCRIPTIONS } from '../../tui/copy'; import { handleValidate } from './action'; import type { Command } from '@commander-js/extra-typings'; import { Text, render } from 'ink'; diff --git a/src/cli/constants.ts b/src/cli/constants.ts index 1114f7f24..0f1ff83ed 100644 --- a/src/cli/constants.ts +++ b/src/cli/constants.ts @@ -5,6 +5,41 @@ const packageJson = require('../../package.json') as { version: string }; export const PACKAGE_VERSION: string = packageJson.version; +/** + * Command descriptions used in CLI help and TUI. + */ +export const COMMAND_DESCRIPTIONS = { + /** Main program description */ + program: 'Build and deploy Agentic AI applications on AgentCore', + /** Command descriptions */ + add: 'Add resources to project config.', + create: 'Create a new AgentCore project', + deploy: 'Deploy project infrastructure to AWS via CDK.', + dev: 'Launch local dev server, or invoke an agent locally.', + invoke: 'Invoke a deployed agent endpoint.', + logs: 'Stream or search agent runtime logs.', + package: 'Package agent artifacts without deploying.', + remove: 'Remove resources from project config.', + status: 'Show deployed resource details and status.', + traces: 'View and download agent traces.', + evals: 'View saved eval and batch eval results from past runs.', + feedback: 'Send feedback about the AgentCore CLI to the team.', + fetch: 'Fetch access info for deployed resources.', + pause: 'Pause a deployed resource (online eval config, A/B test).', + resume: 'Resume a paused resource (online eval config, A/B test).', + recommend: '[preview] Run optimization recommendations for system prompts and tool descriptions.', + recommendations: '[preview] View recommendation history from past runs.', + run: 'Run evaluations, batch evaluations, or optimization recommendations.', + stop: 'Stop a running batch evaluation or A/B test.', + import: 'Import a runtime, memory, or starter toolkit into this project. [experimental]', + telemetry: 'Manage anonymous usage analytics preferences.', + update: 'Check for and install CLI updates', + validate: 'Validate agentcore/ config files.', + 'config-bundle': '[preview] Manage configuration bundle versions and diffs.', + archive: '[preview] Archive (delete) a batch evaluation or recommendation on the service and clear local history.', + config: 'Adjust global configuration settings such as telemetry opt-out status', +} as const; + /** * Distribution mode for the CLI. * - PROD_DISTRO: Public npm registry (npmjs.org) diff --git a/src/cli/tui/copy.ts b/src/cli/tui/copy.ts index def2450b3..bf1509f4a 100644 --- a/src/cli/tui/copy.ts +++ b/src/cli/tui/copy.ts @@ -24,41 +24,6 @@ export const QUICK_START = { tip: 'Coding agents can implement project and config changes', } as const; -/** - * Command descriptions used in CLI help and TUI. - */ -export const COMMAND_DESCRIPTIONS = { - /** Main program description */ - program: 'Build and deploy Agentic AI applications on AgentCore', - /** Command descriptions */ - add: 'Add resources to project config.', - create: 'Create a new AgentCore project', - deploy: 'Deploy project infrastructure to AWS via CDK.', - dev: 'Launch local dev server, or invoke an agent locally.', - invoke: 'Invoke a deployed agent endpoint.', - logs: 'Stream or search agent runtime logs.', - package: 'Package agent artifacts without deploying.', - remove: 'Remove resources from project config.', - status: 'Show deployed resource details and status.', - traces: 'View and download agent traces.', - evals: 'View saved eval and batch eval results from past runs.', - feedback: 'Send feedback about the AgentCore CLI to the team.', - fetch: 'Fetch access info for deployed resources.', - pause: 'Pause a deployed resource (online eval config, A/B test).', - resume: 'Resume a paused resource (online eval config, A/B test).', - recommend: '[preview] Run optimization recommendations for system prompts and tool descriptions.', - recommendations: '[preview] View recommendation history from past runs.', - run: 'Run evaluations, batch evaluations, or optimization recommendations.', - stop: 'Stop a running batch evaluation or A/B test.', - import: 'Import a runtime, memory, or starter toolkit into this project. [experimental]', - telemetry: 'Manage anonymous usage analytics preferences.', - update: 'Check for and install CLI updates', - validate: 'Validate agentcore/ config files.', - 'config-bundle': '[preview] Manage configuration bundle versions and diffs.', - archive: '[preview] Archive (delete) a batch evaluation or recommendation on the service and clear local history.', - config: 'Adjust global configuration settings such as telemetry opt-out status', -} as const; - /** * CLI-only command examples and usage information. * These commands must run in the terminal, not in the TUI.