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
10 changes: 10 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,16 @@ jobs:
- opencode
- ccc
- tmux
- fzf
- lazygit
- ripgrep
- fd
- rtk
- zoxide
- hyperfine
- glow
- fx
- hurl
baseImage:
- debian:latest
- ubuntu:latest
Expand Down
72 changes: 72 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,16 @@ This repository contains a _collection_ of Features.
| ccc | https://github.com/jsburckhardt/co-config | A TUI tool to interactively configure and view GitHub Copilot CLI settings. |
| Yazi | https://github.com/sxyazi/yazi | Blazing fast terminal file manager written in Rust, based on async I/O. |
| tmux | https://github.com/tmux/tmux | tmux is a terminal multiplexer. It lets you switch easily between several programs in one terminal. |
| fzf | https://github.com/junegunn/fzf | A command-line fuzzy finder. |
| lazygit | https://github.com/jesseduffield/lazygit | Simple terminal UI for git commands. |
| ripgrep | https://github.com/BurntSushi/ripgrep | Recursively searches directories for a regex pattern while respecting your gitignore. |
| fd | https://github.com/sharkdp/fd | A simple, fast and user-friendly alternative to 'find'. |
| rtk | https://github.com/rtk-ai/rtk | CLI proxy that reduces LLM token consumption by 60-90% on common dev commands. Single Rust binary, zero dependencies. |
| zoxide | https://github.com/ajeetdsouza/zoxide | A smarter cd command. Supports all major shells. |
| hyperfine | https://github.com/sharkdp/hyperfine | A command-line benchmarking tool. |
| Glow | https://github.com/charmbracelet/glow | Render markdown on the CLI, with pizzazz! 💅🏻 |
| fx | https://github.com/antonmedv/fx | Terminal JSON viewer & processor. |
| hurl | https://github.com/Orange-OpenSource/hurl | Run and test HTTP requests with plain text. |



Expand Down Expand Up @@ -391,3 +401,65 @@ Running `tmux -V` inside the built container will print the version of tmux.
```bash
tmux -V
```

### `fzf`

Running `fzf --version` inside the built container will print the version of fzf.
### `lazygit`

Running `lazygit --version` inside the built container will print the version of lazygit.
### `ripgrep`

Running `rg --version` inside the built container will print the version of ripgrep.
### `fd`

Running `fd --version` inside the built container will print the version of fd.
### `rtk`

Running `rtk --version` inside the built container will print the version of rtk.
### `zoxide`

Running `zoxide --version` inside the built container will print the version of zoxide.
### `hyperfine`

Running `hyperfine --version` inside the built container will print the version of hyperfine.
### `glow`

Running `glow --version` inside the built container will print the version of glow.
### `fx`

Running `fx --version` inside the built container will print the version of fx.
### `hurl`

Running `hurl --version` inside the built container will print the version of hurl.

```jsonc
{
"image": "mcr.microsoft.com/devcontainers/base:ubuntu",
"features": {
"ghcr.io/jsburckhardt/devcontainer-features/fzf:1": {}
"ghcr.io/jsburckhardt/devcontainer-features/lazygit:1": {}
"ghcr.io/jsburckhardt/devcontainer-features/ripgrep:1": {}
"ghcr.io/jsburckhardt/devcontainer-features/fd:1": {}
"ghcr.io/jsburckhardt/devcontainer-features/rtk:1": {}
"ghcr.io/jsburckhardt/devcontainer-features/zoxide:1": {}
"ghcr.io/jsburckhardt/devcontainer-features/hyperfine:1": {}
"ghcr.io/jsburckhardt/devcontainer-features/glow:1": {}
"ghcr.io/jsburckhardt/devcontainer-features/fx:1": {}
"ghcr.io/jsburckhardt/devcontainer-features/hurl:1": {}
}
}
```

```bash
fzf --version
lazygit --version
rg --version
fd --version
rtk --version
zoxide --version
hyperfine --version
glow --version
fx --version
hurl --version
```
13 changes: 13 additions & 0 deletions src/fd/devcontainer-feature.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"name": "fd",
"id": "fd",
"version": "1.0.0",
"description": "A simple, fast and user-friendly alternative to 'find'.",
"options": {
"version": {
"type": "string",
"default": "latest",
"description": "Version of fd to install from GitHub releases e.g. v10.2.0"
}
}
}
120 changes: 120 additions & 0 deletions src/fd/install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
#!/usr/bin/env bash

# Variables
REPO_OWNER="sharkdp"
REPO_NAME="fd"
BINARY_NAME="fd"
FD_VERSION="${VERSION:-"latest"}"
GITHUB_API_REPO_URL="https://api.github.com/repos/${REPO_OWNER}/${REPO_NAME}/releases"

set -e

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/*

# Checks if packages are installed and installs them if not
check_packages() {
if ! dpkg -s "$@" >/dev/null 2>&1; then
if [ "$(find /var/lib/apt/lists/* | wc -l)" = "0" ]; then
echo "Running apt-get update..."
apt-get update -y
fi
apt-get -y install --no-install-recommends "$@"
fi
}

# Make sure we have curl and jq
check_packages curl jq ca-certificates

# Function to get the latest version from GitHub API
get_latest_version() {
curl -s "${GITHUB_API_REPO_URL}/latest" | jq -r ".tag_name"
}

# Check if a version is passed as an argument
if [ -z "$FD_VERSION" ] || [ "$FD_VERSION" == "latest" ]; then
# No version provided, get the latest version
FD_VERSION=$(get_latest_version)
echo "No version provided or 'latest' specified, installing the latest version: $FD_VERSION"
else
echo "Installing version from environment variable: $FD_VERSION"
fi

# Determine the OS and architecture
OS=$(uname -s | tr '[:upper:]' '[:lower:]')
ARCH=$(uname -m)

case "$ARCH" in
x86_64)
ARCH="x86_64"
;;
i686)
ARCH="i686"
;;
aarch64)
ARCH="aarch64"
;;
armv7l)
ARCH="arm-unknown"
;;
*)
echo "Unsupported architecture: $ARCH"
exit 1
;;
esac

case "$OS" in
linux)
OS="unknown-linux-gnu"
;;
darwin)
OS="apple-darwin"
;;
*)
echo "Unsupported OS: $OS"
exit 1
;;
esac

# Construct the download URL
DOWNLOAD_URL="https://github.com/${REPO_OWNER}/${REPO_NAME}/releases/download/${FD_VERSION}/fd-${FD_VERSION}-${ARCH}-${OS}.tar.gz"

# Create a temporary directory for the download
TMP_DIR=$(mktemp -d)
cd "$TMP_DIR" || exit

echo "Downloading fd from $DOWNLOAD_URL"
curl -sSL "$DOWNLOAD_URL" -o "fd.tar.gz"

# Extract the tarball
echo "Extracting fd..."
tar -xzf "fd.tar.gz"

# Find the extracted directory (it should match the archive name pattern)
EXTRACTED_DIR=$(find . -name "fd-${FD_VERSION}-*" -type d | head -1)
if [ -z "$EXTRACTED_DIR" ]; then
echo "ERROR: Could not find extracted fd directory"
exit 1
fi

# Move the binary to /usr/local/bin
echo "Installing fd..."
mv "${EXTRACTED_DIR}/fd" /usr/local/bin/

# Cleanup
cd - || exit
rm -rf "$TMP_DIR"

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

# Verify installation
echo "Verifying installation..."
fd --version

echo "Done!"
13 changes: 13 additions & 0 deletions src/fx/devcontainer-feature.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"name": "fx",
"id": "fx",
"version": "1.0.0",
"description": "Terminal JSON viewer & processor",
"options": {
"version": {
"type": "string",
"default": "latest",
"description": "Version of fx to install from GitHub releases e.g. 39.2.0"
}
}
}
105 changes: 105 additions & 0 deletions src/fx/install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
#!/usr/bin/env bash

# Variables
REPO_OWNER="antonmedv"
REPO_NAME="fx"
BINARY_NAME="fx"
FX_VERSION="${VERSION:-"latest"}"
GITHUB_API_REPO_URL="https://api.github.com/repos/${REPO_OWNER}/${REPO_NAME}/releases"

set -e

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/*

# Checks if packages are installed and installs them if not
check_packages() {
if ! dpkg -s "$@" >/dev/null 2>&1; then
if [ "$(find /var/lib/apt/lists/* | wc -l)" = "0" ]; then
echo "Running apt-get update..."
apt-get update -y
fi
apt-get -y install --no-install-recommends "$@"
fi
}

# Make sure we have curl and jq
check_packages curl jq ca-certificates

# Function to get the latest version from GitHub API
get_latest_version() {
curl -s "${GITHUB_API_REPO_URL}/latest" | jq -r ".tag_name"
}

# Check if a version is passed as an argument
if [ -z "$FX_VERSION" ] || [ "$FX_VERSION" == "latest" ]; then
# No version provided, get the latest version
FX_VERSION=$(get_latest_version)
echo "No version provided or 'latest' specified, installing the latest version: $FX_VERSION"
else
echo "Installing version from environment variable: $FX_VERSION"
fi

# Determine the OS and architecture
OS=$(uname -s | tr '[:upper:]' '[:lower:]')
ARCH=$(uname -m)

case "$ARCH" in
x86_64)
ARCH="amd64"
;;
aarch64)
ARCH="arm64"
;;
*)
echo "Unsupported architecture: $ARCH"
exit 1
;;
esac

case "$OS" in
linux)
OS="linux"
;;
darwin)
OS="darwin"
;;
*)
echo "Unsupported OS: $OS"
exit 1
;;
esac

# Construct the download URL
# fx releases are plain binaries named fx_{os}_{arch}
DOWNLOAD_URL="https://github.com/${REPO_OWNER}/${REPO_NAME}/releases/download/${FX_VERSION}/fx_${OS}_${ARCH}"

# Create a temporary directory for the download
TMP_DIR=$(mktemp -d)
cd "$TMP_DIR" || exit

echo "Downloading fx from $DOWNLOAD_URL"
curl -sSL "$DOWNLOAD_URL" -o "fx"

# Move the binary to /usr/local/bin
echo "Installing fx..."
chmod +x fx
mv fx /usr/local/bin/

# Cleanup
cd - || exit
rm -rf "$TMP_DIR"

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

# Verify installation
echo "Verifying installation..."
fx --version

echo "Done!"
13 changes: 13 additions & 0 deletions src/fzf/devcontainer-feature.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"name": "fzf",
"id": "fzf",
"version": "1.0.0",
"description": "A command-line fuzzy finder.",
"options": {
"version": {
"type": "string",
"default": "latest",
"description": "Version of fzf to install from GitHub releases e.g. v0.72.0"
}
}
}
Loading
Loading