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
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
| [feature-installer](https://github.com/devcontainer-community/devcontainer-features/tree/main/src/feature-installer) | `feature-installer` — install devcontainer features at runtime | curl | 1.0.0 |
| [fzf](https://github.com/devcontainer-community/devcontainer-features/tree/main/src/fzf) | `fzf` — general-purpose command-line fuzzy finder | gh release | 1.0.0 |
| [getdnote.com](https://github.com/devcontainer-community/devcontainer-features/tree/main/src/getdnote.com) | `dnote` — simple command-line notebook for developers | gh release | 1.0.0 |
| [gitagent.sh](https://github.com/devcontainer-community/devcontainer-features/tree/main/src/gitagent.sh) | `gitagent` — framework-agnostic, git-native standard for defining AI agents | bun | 1.0.0 |
| [github.com/cli](https://github.com/devcontainer-community/devcontainer-features/tree/main/src/github.com-cli) | `gh` — GitHub CLI | curl | 1.0.1 |
| [helix-editor.com](https://github.com/devcontainer-community/devcontainer-features/tree/main/src/helix-editor.com) | `hx` — modal text editor with built-in LSP | gh release | 1.0.0 |
| [hermes-agent.nousresearch.com](https://github.com/devcontainer-community/devcontainer-features/tree/main/src/hermes-agent.nousresearch.com) | `hermes` — self-improving AI agent by Nous Research | curl | 1.0.0 |
Expand Down
17 changes: 17 additions & 0 deletions src/gitagent.sh/NOTES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# gitagent

## Project

- [gitagent](https://gitagent.sh)

## Description

A framework-agnostic, git-native standard for defining AI agents. `gitagent` lets you clone a repo and get an agent — version control, branching, and collaboration built in.

## Installation Method

Installed as a global package via [Bun](https://bun.sh) (`bun install -g @shreyaskapale/gitagent`). Bun is automatically installed if not already present.

## Other Notes

_No additional notes._
17 changes: 17 additions & 0 deletions src/gitagent.sh/devcontainer-feature.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"name": "gitagent.sh",
"id": "gitagent.sh",
"version": "1.0.0",
"description": "Install \"gitagent\" binary",
"documentationURL": "https://github.com/devcontainer-community/devcontainer-features/tree/main/src/gitagent.sh",
"options": {
"version": {
"type": "string",
"default": "latest",
"proposals": [
"latest"
],
"description": "Version of \"gitagent\" to install."
}
}
}
59 changes: 59 additions & 0 deletions src/gitagent.sh/install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
#!/bin/bash
set -o errexit
set -o pipefail
set -o noclobber
set -o nounset
set -o allexport
readonly binaryName='gitagent'
readonly binaryTargetFolder='/usr/local/bin'
apt_get_update() {
if [ "$(find /var/lib/apt/lists/* | wc -l)" = "0" ]; then
echo "Running apt-get update..."
apt-get update -y
fi
}
apt_get_checkinstall() {
if ! dpkg -s "$@" >/dev/null 2>&1; then
apt_get_update
DEBIAN_FRONTEND=noninteractive apt-get -y install --no-install-recommends --no-install-suggests --option 'Debug::pkgProblemResolver=true' --option 'Debug::pkgAcquire::Worker=1' "$@"
fi
}
apt_get_cleanup() {
apt-get clean
rm -rf /var/lib/apt/lists/*
}
echo_banner() {
local text="$1"
echo -e "\e[1m\e[97m\e[41m$text\e[0m"
}
utils_check_version() {
local version=$1
if ! [[ "${version:-}" =~ ^(latest|[0-9]+\.[0-9]+\.[0-9]+)$ ]]; then
printf >&2 '=== [ERROR] Option "version" (value: "%s") is not "latest" or valid semantic version format "X.Y.Z" !\n' \
"$version"
exit 1
fi
}
bun_ensure_installed() {
if ! command -v bun >/dev/null 2>&1; then
echo "Bun is not installed. Installing bun to /usr/local..."
apt_get_checkinstall unzip curl ca-certificates
export BUN_INSTALL=/usr/local
curl -fsSL https://bun.sh/install | bash
fi
}
install() {
utils_check_version "$VERSION"
export BUN_INSTALL=/usr/local
bun_ensure_installed
if [ "$VERSION" == 'latest' ] || [ -z "$VERSION" ]; then
bun install -g @shreyaskapale/gitagent
else
bun install -g "@shreyaskapale/gitagent@${VERSION}"
fi
apt_get_cleanup
}
echo_banner "devcontainer.community"
echo "Installing $binaryName..."
install "$@"
echo "(*) Done!"
19 changes: 19 additions & 0 deletions test/gitagent.sh/test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/bash


set -e

# Optional: Import test library bundled with the devcontainer CLI
# See https://github.com/devcontainers/cli/blob/HEAD/docs/features/test.md#dev-container-features-test-lib
# Provides the 'check' and 'reportResults' commands.
source dev-container-features-test-lib

# Feature-specific tests
# The 'check' command comes from the dev-container-features-test-lib. Syntax is...
# check <LABEL> <cmd> [args...]

check "check existence" bash -c "ls -lah /usr/local/bin/gitagent"

# Report results
# If any of the checks above exited with a non-zero exit code, the test will fail.
reportResults
Loading