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
2 changes: 1 addition & 1 deletion .devcontainer/scripts/postCreate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ set -euo pipefail
echo "🔧 Installing devcontainer CLI..."
npm install -g @devcontainers/cli

FEATURES=("ag" "amazon-q-cli" "aws-sam-cli" "gcloud-cli" "zip")
FEATURES=("ag" "agentcore-cli" "amazon-q-cli" "aws-sam-cli" "gcloud-cli" "zip")
BASE_IMAGES=("debian:latest" "ubuntu:latest" "mcr.microsoft.com/devcontainers/base:ubuntu")

# Run autogenerated tests for each image
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ jobs:
matrix:
features:
- ag
- agentcore-cli
- amazon-q-cli
- aws-sam-cli
- gcloud-cli
Expand All @@ -38,6 +39,7 @@ jobs:
matrix:
features:
- ag
- agentcore-cli
- amazon-q-cli
- aws-sam-cli
- gcloud-cli
Expand Down
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
This repository contains following features:

- [ag](./src/ag/README.md): Installs ag (The Silver Searcher), a fast grep-like text search tool
- [agentcore-cli](./src/agentcore-cli/README.md): Installs the Amazon Bedrock AgentCore CLI (`@aws/agentcore`) from npm
- [amazon-q-cli](./src/amazon-q-cli/README.md): Install Amazon Q CLI for AWS development
- [aws-sam-cli](./src/aws-sam-cli/README.md): Installs AWS SAM CLI for serverless application development
- [gcloud-cli](./src/gcloud-cli/README.md): Installs Google Cloud CLI (gcloud) for Google Cloud Platform development
Expand All @@ -21,6 +22,7 @@ These examples show how to use features from this repository in a devcontainer:
"image": "mcr.microsoft.com/devcontainers/base:ubuntu",
"features": {
"ghcr.io/jajera/features/ag:1": {},
"ghcr.io/jajera/features/agentcore-cli:1": {},
"ghcr.io/jajera/features/amazon-q-cli:1": {},
"ghcr.io/jajera/features/aws-sam-cli:1": {},
"ghcr.io/jajera/features/gcloud-cli:1": {},
Expand Down Expand Up @@ -50,6 +52,10 @@ Similar to the [`devcontainers/features`](https://github.com/devcontainers/featu
│ │ ├── devcontainer-feature.json
│ │ ├── install.sh
│ │ └── README.md
│ ├── agentcore-cli
│ │ ├── devcontainer-feature.json
│ │ ├── install.sh
│ │ └── README.md
│ ├── amazon-q-cli
│ │ ├── devcontainer-feature.json
│ │ ├── install.sh
Expand All @@ -68,6 +74,7 @@ Similar to the [`devcontainers/features`](https://github.com/devcontainers/featu
│ │ └── README.md
├── test
│ ├── ag
│ ├── agentcore-cli
│ ├── amazon-q-cli
│ ├── aws-sam-cli
│ ├── gcloud-cli
Expand Down
50 changes: 50 additions & 0 deletions src/agentcore-cli/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# AgentCore CLI (`agentcore-cli`)

This feature installs the [Amazon Bedrock AgentCore CLI](https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/agentcore-get-started-cli.html) from npm (`@aws/agentcore`). Source repository: [aws/agentcore-cli](https://github.com/aws/agentcore-cli).

## Dependencies

Node.js is declared as a **hard** dependency in `devcontainer-feature.json` via `dependsOn` on `ghcr.io/devcontainers/features/node:1` with `version: lts`, so the LTS Node line is installed before this feature and satisfies the AgentCore requirement of Node.js 20 or later.

`installsAfter` includes `common-utils` for consistent ordering when you also add that feature to your dev container.

## Options

| Option | Type | Default | Description |
| ----------------- | ------ | ------- | ---------------------------------------------------------- |
| `packageVersion` | string | `""` | npm semver or dist-tag for `@aws/agentcore`; empty = latest |

## Usage

Add the feature to `.devcontainer/devcontainer.json`. You only need to reference this feature; Node is pulled in automatically.

```jsonc
{
"image": "mcr.microsoft.com/devcontainers/base:ubuntu",
"features": {
"ghcr.io/jajera/features/agentcore-cli:1": {
"packageVersion": ""
}
}
}
```

Pin an npm version when needed:

```jsonc
"ghcr.io/jajera/features/agentcore-cli:1": {
"packageVersion": "1.0.0"
}
```

## Verification

After the container builds:

```bash
agentcore --version
```

## Notes

- This feature does not configure AWS credentials, the AWS CLI, Python, or CDK; add other features or image setup as needed for `agentcore deploy` and local development.
23 changes: 23 additions & 0 deletions src/agentcore-cli/devcontainer-feature.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"name": "AgentCore CLI",
"id": "agentcore-cli",
"version": "1.0.0",
"description": "Installs the Amazon Bedrock AgentCore CLI (@aws/agentcore) from npm.",
"documentationURL": "https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/agentcore-get-started-cli.html",
"dependsOn": {
"ghcr.io/devcontainers/features/node:1": {
"version": "lts"
}
},
"installsAfter": [
"ghcr.io/devcontainers/features/common-utils"
],
"options": {
"packageVersion": {
"type": "string",
"default": "",
"proposals": ["", "latest"],
"description": "npm version or dist-tag for @aws/agentcore (empty = latest from registry)."
}
}
}
44 changes: 44 additions & 0 deletions src/agentcore-cli/install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#!/bin/sh
set -e

echo "Activating feature 'agentcore-cli'"

PACKAGEVERSION="${PACKAGEVERSION:-}"

if command -v agentcore >/dev/null 2>&1; then
echo "AgentCore CLI is already installed. Skipping install."
agentcore --version
exit 0
fi

if ! command -v node >/dev/null 2>&1; then
echo "ERROR: node is not on PATH. The node feature (dependsOn) should install it."
exit 1
fi

if ! command -v npm >/dev/null 2>&1; then
echo "ERROR: npm is not on PATH."
exit 1
fi

NODE_MAJOR=$(node -p 'parseInt(process.versions.node.split(".")[0], 10)' 2>/dev/null || echo 0)
if [ "$NODE_MAJOR" -lt 20 ]; then
echo "ERROR: Node.js 20 or later is required for AgentCore CLI (found $(node --version 2>/dev/null || echo unknown))."
exit 1
fi

SPEC='@aws/agentcore'
if [ -n "$PACKAGEVERSION" ]; then
SPEC="@aws/agentcore@${PACKAGEVERSION}"
fi

echo "Installing AgentCore CLI (${SPEC}) via npm..."
npm install -g "$SPEC"

if ! command -v agentcore >/dev/null 2>&1; then
echo "ERROR: agentcore was not found on PATH after npm install."
exit 1
fi

echo "AgentCore CLI installed successfully."
agentcore --version
11 changes: 11 additions & 0 deletions test/agentcore-cli/test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash
set -e

# Import test library
source dev-container-features-test-lib

check "agentcore command exists" bash -c 'command -v agentcore'

check "agentcore command works" agentcore --version

reportResults
Loading