Skip to content
Open
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 .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ jobs:
- strix
- colibri
- gitai
- floci
baseImage:
- debian:latest
- ubuntu:latest
Expand Down
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ This repository contains a _collection_ of Features.
| strix | https://github.com/usestrix/strix | Open-source AI penetration testing tool to find and fix your app's vulnerabilities. |
| colibri | https://github.com/JustVugg/colibri | Run GLM-5.2 (744B MoE) on a consumer machine — pure C, zero deps, experts streamed from disk. |
| gitai | https://github.com/git-ai-project/git-ai | A Git extension for tracking AI-generated code through every commit, merge, rebase, cherry-pick, etc. |
| floci | https://github.com/floci-io/floci-cli | Official CLI for managing Floci local cloud emulators. |



Expand Down Expand Up @@ -809,3 +810,20 @@ Running `git-ai` inside the built container will print the version of the Git AI
```bash
git-ai --version
```

### `floci`

Running `floci` inside the built container provides the official CLI for managing Floci local cloud emulators.

```jsonc
{
"image": "mcr.microsoft.com/devcontainers/base:ubuntu",
"features": {
"ghcr.io/jsburckhardt/devcontainer-features/floci:1": {}
}
}
```

```bash
floci --version
```
13 changes: 13 additions & 0 deletions src/floci/devcontainer-feature.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"name": "floci",
"id": "floci",
"version": "1.0.0",
"description": "Official CLI for managing Floci local cloud emulators.",
"options": {
"version": {
"type": "string",
"default": "latest",
"description": "Version of floci to install (for example, latest or 0.2.3)."
}
}
}
93 changes: 93 additions & 0 deletions src/floci/install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
#!/usr/bin/env bash

set -euo pipefail

# Variables
REPO_OWNER="floci-io"
REPO_NAME="floci-cli"
BINARY_NAME="floci"
VERSION="${VERSION:-latest}"

# Root check
if [ "$(id -u)" -ne 0 ]; then
echo -e 'Script must be run as root. Use sudo, su, or add "USER root" to your Dockerfile before running this script.'
exit 1
fi

# Clean up
rm -rf /var/lib/apt/lists/*

check_packages() {
if ! dpkg -s "$@" >/dev/null 2>&1; then
if [ "$(find /var/lib/apt/lists -mindepth 1 -maxdepth 1 | wc -l)" = "0" ]; then
echo "Running apt-get update..."
apt-get update -y
fi
apt-get -y install --no-install-recommends "$@"
fi
}

# Ensure required packages are installed
check_packages curl jq ca-certificates

# Query the latest GitHub release, falling back to the releases list if needed.
get_latest_version() {
local response version

response="$(curl -fsSL "https://api.github.com/repos/${REPO_OWNER}/${REPO_NAME}/releases/latest" || true)"
version="$(printf '%s' "$response" | jq -r '.tag_name // empty' 2>/dev/null || true)"

if [ -z "$version" ]; then
response="$(curl -fsSL "https://api.github.com/repos/${REPO_OWNER}/${REPO_NAME}/releases?per_page=1" || true)"
version="$(printf '%s' "$response" | jq -r '.[0].tag_name // empty' 2>/dev/null || true)"
fi

printf '%s\n' "$version"
}

# Resolve version
if [ -z "$VERSION" ] || [ "$VERSION" = "latest" ]; then
VERSION="$(get_latest_version)"
if [ -z "$VERSION" ]; then
echo "Failed to resolve the latest floci version from the GitHub API." >&2
exit 1
fi
echo "No version provided or latest specified, installing the latest version: $VERSION"
else
echo "Installing floci version: $VERSION"
fi

# Upstream publishes floci-{linux,darwin}-{amd64,arm64} binaries.
OS_RAW="$(uname -s)"
case "$OS_RAW" in
Linux) OS="linux" ;;
Darwin) OS="darwin" ;;
*) echo "Unsupported OS: $OS_RAW" >&2; exit 1 ;;
esac

ARCH_RAW="$(uname -m)"
case "$ARCH_RAW" in
x86_64|amd64) ARCH="amd64" ;;
aarch64|arm64) ARCH="arm64" ;;
*) echo "Unsupported architecture: $ARCH_RAW" >&2; exit 1 ;;
esac

ASSET_NAME="${BINARY_NAME}-${OS}-${ARCH}"
DOWNLOAD_URL="https://github.com/${REPO_OWNER}/${REPO_NAME}/releases/download/${VERSION}/${ASSET_NAME}"
TMP_DIR="$(mktemp -d)"

cleanup() {
rm -rf "$TMP_DIR"
rm -rf /var/lib/apt/lists/*
}
trap cleanup EXIT

cd "$TMP_DIR"
echo "Downloading $BINARY_NAME from $DOWNLOAD_URL"
curl -fsSL -o "$BINARY_NAME" "$DOWNLOAD_URL"
chmod +x "$BINARY_NAME"
mv "$BINARY_NAME" /usr/local/bin/

# Verify installation
echo "Verifying installation"
"$BINARY_NAME" --version
1 change: 1 addition & 0 deletions test/_global/all-tools.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,6 @@ check "officecli" officecli --version
check "strix" strix --version
check "colibri" bash -c "command -v colibri"
check "gitai" git-ai --version
check "floci" floci --version

reportResults
9 changes: 9 additions & 0 deletions test/_global/floci-specific-version.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash

set -e

source dev-container-features-test-lib

check "floci with specific version" /bin/bash -c "floci --version | grep 'floci 0.2.3'"

reportResults
11 changes: 10 additions & 1 deletion test/_global/scenarios.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@
"officecli": {},
"strix": {},
"colibri": {},
"gitai": {}
"gitai": {},
"floci": {}
}
},
"flux-specific-version": {
Expand Down Expand Up @@ -399,5 +400,13 @@
"version": "v1.6.21"
}
}
},
"floci-specific-version": {
"image": "mcr.microsoft.com/devcontainers/base:ubuntu",
"features": {
"floci": {
"version": "0.2.3"
}
}
}
}
9 changes: 9 additions & 0 deletions test/floci/test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash

set -e

source dev-container-features-test-lib

check "floci" floci --version

reportResults