diff --git a/docs/commands.md b/docs/commands.md index 41e58ee9..23c28448 100644 --- a/docs/commands.md +++ b/docs/commands.md @@ -68,6 +68,7 @@ agentcore create \ | Flag | Description | | ------------------------- | -------------------------------------------------------------------------------------------------------------- | | `--name ` | Project name (alphanumeric, starts with letter, max 23 chars) | +| `--description ` | Description for the agent created with the project (max 4096 chars) | | `--defaults` | Use defaults (Python, Strands, Bedrock, no memory) | | `--no-agent` | Skip agent creation | | `--type ` | `create` (default) or `import` | @@ -196,6 +197,7 @@ agentcore add agent \ | Flag | Description | | ------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | | `--name ` | Agent name (alphanumeric + underscores, starts with letter, max 48 chars) | +| `--description ` | Agent description (max 4096 chars) | | `--type ` | `create` (default), `byo`, or `import` | | `--build ` | `CodeZip` (default) or `Container` (see [Container Builds](container-builds.md)) | | `--language ` | `Python` (create); `Python`, `TypeScript`, `Other` (BYO) | diff --git a/docs/configuration.md b/docs/configuration.md index e636978b..872f14df 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -184,6 +184,7 @@ on the next deployment. { "type": "AgentCoreRuntime", "name": "MyAgent", + "description": "A helpful assistant agent", "build": "CodeZip", "entrypoint": "main.py", "codeLocation": "app/MyAgent/", @@ -200,6 +201,7 @@ on the next deployment. | ----------------- | -------- | -------------------------------------------------- | | `type` | Yes | Always `"AgentCoreRuntime"` | | `name` | Yes | Agent name (1-48 chars, alphanumeric + underscore) | +| `description` | No | Agent description (max 4096 chars) | | `build` | Yes | `"CodeZip"` or `"Container"` | | `entrypoint` | Yes | Entry file (e.g., `main.py` or `main.py:handler`) | | `codeLocation` | Yes | Directory containing agent code | diff --git a/schemas/agentcore.schema.v1.json b/schemas/agentcore.schema.v1.json index 9da99933..0503edca 100644 --- a/schemas/agentcore.schema.v1.json +++ b/schemas/agentcore.schema.v1.json @@ -47,6 +47,11 @@ "maxLength": 48, "pattern": "^[a-zA-Z][a-zA-Z0-9_]{0,47}$" }, + "description": { + "type": "string", + "minLength": 1, + "maxLength": 4096 + }, "build": { "type": "string", "enum": ["CodeZip", "Container"] diff --git a/src/cli/commands/add/types.ts b/src/cli/commands/add/types.ts index 51beeb11..2b0aeb71 100644 --- a/src/cli/commands/add/types.ts +++ b/src/cli/commands/add/types.ts @@ -12,6 +12,7 @@ import type { VpcOptions } from '../shared/vpc-utils'; // Agent types export interface AddAgentOptions extends VpcOptions { name?: string; + description?: string; type?: 'create' | 'byo' | 'import'; build?: string; language?: TargetLanguage; diff --git a/src/cli/commands/create/action.ts b/src/cli/commands/create/action.ts index b1d17f47..ccf7cc9f 100644 --- a/src/cli/commands/create/action.ts +++ b/src/cli/commands/create/action.ts @@ -106,6 +106,7 @@ type MemoryOption = 'none' | 'shortTerm' | 'longAndShortTerm'; export interface CreateWithAgentOptions { name: string; + description?: string; cwd: string; type?: 'create' | 'import'; buildType?: BuildType; @@ -132,6 +133,7 @@ export interface CreateWithAgentOptions { export async function createProjectWithAgent(options: CreateWithAgentOptions): Promise { const { name, + description, cwd, buildType, language, @@ -176,6 +178,7 @@ export async function createProjectWithAgent(options: CreateWithAgentOptions): P onProgress?.('Import agent from Bedrock', 'start'); const importResult = await executeImportAgent({ name, + description, framework: framework ?? 'Strands', memory, bedrockRegion: options.region, @@ -212,6 +215,7 @@ export async function createProjectWithAgent(options: CreateWithAgentOptions): P const generateConfig = { projectName: agentName, + description, buildType: buildType ?? ('CodeZip' as BuildType), sdk: resolvedFramework, modelProvider: resolvedModelProvider, diff --git a/src/cli/commands/create/command.tsx b/src/cli/commands/create/command.tsx index 7f4b5a1e..5c26746b 100644 --- a/src/cli/commands/create/command.tsx +++ b/src/cli/commands/create/command.tsx @@ -122,6 +122,7 @@ async function handleCreateCLI(options: CreateOptions): Promise { ? await createProject({ name: options.name!, cwd, skipGit: options.skipGit, onProgress }) : await createProjectWithAgent({ name: options.name!, + description: options.description, cwd, type: options.type as 'create' | 'import' | undefined, buildType: (options.build as BuildType) ?? 'CodeZip', @@ -160,6 +161,7 @@ export const registerCreate = (program: Command) => { .command('create') .description(COMMAND_DESCRIPTIONS.create) .option('--name ', 'Project name (start with letter, alphanumeric only, max 23 chars) [non-interactive]') + .option('--description ', 'Agent description (max 4096 chars) [non-interactive]') .option('--no-agent', 'Skip agent creation [non-interactive]') .option('--defaults', 'Use defaults (Python, Strands, Bedrock, no memory) [non-interactive]') .option('--build ', 'Build type: CodeZip or Container (default: CodeZip) [non-interactive]') diff --git a/src/cli/commands/create/types.ts b/src/cli/commands/create/types.ts index fd9fb13a..c508447b 100644 --- a/src/cli/commands/create/types.ts +++ b/src/cli/commands/create/types.ts @@ -2,6 +2,7 @@ import type { VpcOptions } from '../shared/vpc-utils'; export interface CreateOptions extends VpcOptions { name?: string; + description?: string; agent?: boolean; defaults?: boolean; type?: string; diff --git a/src/cli/operations/agent/generate/schema-mapper.ts b/src/cli/operations/agent/generate/schema-mapper.ts index 06d420de..5400ec78 100644 --- a/src/cli/operations/agent/generate/schema-mapper.ts +++ b/src/cli/operations/agent/generate/schema-mapper.ts @@ -114,6 +114,7 @@ export function mapGenerateConfigToAgent(config: GenerateConfig): AgentEnvSpec { return { name: config.projectName, + ...(config.description && { description: config.description }), build: config.buildType ?? 'CodeZip', entrypoint: DEFAULT_PYTHON_ENTRYPOINT as FilePath, codeLocation: codeLocation as DirectoryPath, diff --git a/src/cli/operations/agent/import/index.ts b/src/cli/operations/agent/import/index.ts index 5b13c4c2..9aee67f4 100644 --- a/src/cli/operations/agent/import/index.ts +++ b/src/cli/operations/agent/import/index.ts @@ -21,6 +21,7 @@ import { dirname, join } from 'path'; export interface ExecuteImportAgentParams { name: string; + description?: string; framework: SDKFramework; memory: MemoryOption; bedrockRegion: string; @@ -38,6 +39,7 @@ export async function executeImportAgent( ): Promise> { const { name, + description, framework, memory, bedrockRegion, @@ -88,6 +90,7 @@ export async function executeImportAgent( // 5. Write agent to project config (reuse existing write-agent-to-project) const generateConfig = { projectName: name, + description, buildType: 'CodeZip' as const, sdk: framework, modelProvider: 'Bedrock' as const, diff --git a/src/cli/primitives/AgentPrimitive.tsx b/src/cli/primitives/AgentPrimitive.tsx index b30dfe5e..0dba97bc 100644 --- a/src/cli/primitives/AgentPrimitive.tsx +++ b/src/cli/primitives/AgentPrimitive.tsx @@ -43,6 +43,7 @@ import { dirname, join } from 'path'; */ export interface AddAgentOptions extends VpcOptions { name: string; + description?: string; type: 'create' | 'byo' | 'import'; buildType: BuildType; language: TargetLanguage; @@ -200,6 +201,7 @@ export class AgentPrimitive extends BasePrimitive', 'Agent name (start with letter, alphanumeric + underscores, max 48 chars) [non-interactive]' ) + .option('--description ', 'Agent description (max 4096 chars) [non-interactive]') .option('--type ', 'Agent type: create, byo, or import [non-interactive]', 'create') .option('--build ', 'Build type: CodeZip or Container (default: CodeZip) [non-interactive]') .option('--language ', 'Language: Python (create), or Python/TypeScript/Other (BYO) [non-interactive]') @@ -260,6 +262,7 @@ export class AgentPrimitive extends BasePrimitive> { return executeImportAgent({ name: options.name, + description: options.description, framework: options.framework, memory: options.memory ?? 'none', bedrockRegion: options.bedrockRegion!, @@ -507,6 +512,7 @@ export class AgentPrimitive extends BasePrimitive