Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions src/cli/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
2 changes: 1 addition & 1 deletion src/cli/commands/add/command.tsx
Original file line number Diff line number Diff line change
@@ -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';

Expand Down
2 changes: 1 addition & 1 deletion src/cli/commands/archive/command.tsx
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
2 changes: 1 addition & 1 deletion src/cli/commands/config/command.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
3 changes: 1 addition & 2 deletions src/cli/commands/create/command.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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';
Expand Down
2 changes: 1 addition & 1 deletion src/cli/commands/deploy/command.tsx
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
2 changes: 1 addition & 1 deletion src/cli/commands/dev/command.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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';
Expand Down
2 changes: 1 addition & 1 deletion src/cli/commands/eval/command.tsx
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
2 changes: 1 addition & 1 deletion src/cli/commands/feedback/command.tsx
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
2 changes: 1 addition & 1 deletion src/cli/commands/fetch/command.tsx
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
2 changes: 1 addition & 1 deletion src/cli/commands/invoke/command.tsx
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
2 changes: 1 addition & 1 deletion src/cli/commands/logs/command.tsx
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
2 changes: 1 addition & 1 deletion src/cli/commands/package/command.tsx
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
2 changes: 1 addition & 1 deletion src/cli/commands/pause/command.tsx
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
2 changes: 1 addition & 1 deletion src/cli/commands/recommendations/command.tsx
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
2 changes: 1 addition & 1 deletion src/cli/commands/remove/command.tsx
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
2 changes: 1 addition & 1 deletion src/cli/commands/run/command.tsx
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -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';
Expand Down
2 changes: 1 addition & 1 deletion src/cli/commands/status/command.tsx
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -400,7 +400,7 @@
});
};

function ResourceEntry({ entry, showRuntime }: { entry: ResourceStatusEntry; showRuntime?: boolean }) {

Check warning on line 403 in src/cli/commands/status/command.tsx

View workflow job for this annotation

GitHub Actions / lint

Fast refresh only works when a file only exports components. Move your component(s) to a separate file. If all exports are HOCs, add them to the `extraHOCs` option
return (
<Text>
{' '}
Expand Down
2 changes: 1 addition & 1 deletion src/cli/commands/stop/command.tsx
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
2 changes: 1 addition & 1 deletion src/cli/commands/telemetry/command.ts
Original file line number Diff line number Diff line change
@@ -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';

Expand Down
2 changes: 1 addition & 1 deletion src/cli/commands/traces/command.tsx
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
2 changes: 1 addition & 1 deletion src/cli/commands/update/command.tsx
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
2 changes: 1 addition & 1 deletion src/cli/commands/validate/command.tsx
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
35 changes: 35 additions & 0 deletions src/cli/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
35 changes: 0 additions & 35 deletions src/cli/tui/copy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Loading