Skip to content

Commit 01bbb3a

Browse files
rawwerksclaude
andcommitted
Add one-liner install script and GitHub release workflow
- install.sh: Downloads pre-built binary for platform (Linux/macOS x86_64/aarch64) - .github/workflows/release.yml: Builds and uploads binaries on version tags - README.md: Add curl install method, fix typos, add --root-label to CLI ref Usage: curl -fsSL https://raw.githubusercontent.com/rawwerks/dirpack/master/install.sh | bash Release process: git tag v0.2.1 && git push --tags Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 956555d commit 01bbb3a

3 files changed

Lines changed: 180 additions & 1 deletion

File tree

.github/workflows/release.yml

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
build:
13+
name: Build ${{ matrix.target }}
14+
runs-on: ${{ matrix.os }}
15+
strategy:
16+
fail-fast: false
17+
matrix:
18+
include:
19+
- target: x86_64-unknown-linux-gnu
20+
os: ubuntu-latest
21+
name: dirpack-linux-x86_64
22+
- target: aarch64-unknown-linux-gnu
23+
os: ubuntu-latest
24+
name: dirpack-linux-aarch64
25+
- target: x86_64-apple-darwin
26+
os: macos-latest
27+
name: dirpack-macos-x86_64
28+
- target: aarch64-apple-darwin
29+
os: macos-latest
30+
name: dirpack-macos-aarch64
31+
32+
steps:
33+
- name: Checkout
34+
uses: actions/checkout@v4
35+
36+
- name: Install Rust
37+
uses: dtolnay/rust-action@stable
38+
with:
39+
targets: ${{ matrix.target }}
40+
41+
- name: Install cross-compilation tools (Linux aarch64)
42+
if: matrix.target == 'aarch64-unknown-linux-gnu'
43+
run: |
44+
sudo apt-get update
45+
sudo apt-get install -y gcc-aarch64-linux-gnu
46+
47+
- name: Build
48+
run: |
49+
if [ "${{ matrix.target }}" = "aarch64-unknown-linux-gnu" ]; then
50+
export CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc
51+
fi
52+
cargo build --release --target ${{ matrix.target }}
53+
54+
- name: Package
55+
run: |
56+
cp target/${{ matrix.target }}/release/dirpack ${{ matrix.name }}
57+
chmod +x ${{ matrix.name }}
58+
59+
- name: Upload artifact
60+
uses: actions/upload-artifact@v4
61+
with:
62+
name: ${{ matrix.name }}
63+
path: ${{ matrix.name }}
64+
65+
release:
66+
name: Create Release
67+
needs: build
68+
runs-on: ubuntu-latest
69+
steps:
70+
- name: Download all artifacts
71+
uses: actions/download-artifact@v4
72+
with:
73+
path: artifacts
74+
75+
- name: Create Release
76+
uses: softprops/action-gh-release@v1
77+
with:
78+
files: artifacts/**/*
79+
generate_release_notes: true
80+
env:
81+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

README.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
dirpack creates compressed directory representations that fit within token/byte budgets. Unlike other tools, it uses **progressive disclosure**—including structure first, then signatures, then content—stopping exactly when the budget is exhausted.
66

7-
dirpack was inpired by [recent research from Jude Gao at Vercel](https://vercel.com/blog/agents-md-outperforms-skills-in-our-agent-evals), which suggests that putting a "compressed" index of the directory directly inside `AGENTS.md` out performs the "progressive disclore" strategy recommended by [Agent Skills](https://github.com/agentskills/agentskills)
7+
dirpack was inspired by [recent research from Jude Gao at Vercel](https://vercel.com/blog/agents-md-outperforms-skills-in-our-agent-evals), which suggests that putting a "compressed" index of the directory directly inside `AGENTS.md` outperforms the "progressive disclosure" strategy recommended by [Agent Skills](https://github.com/agentskills/agentskills).
88

99
## Features
1010

@@ -16,6 +16,16 @@ dirpack was inpired by [recent research from Jude Gao at Vercel](https://vercel.
1616

1717
## Installation
1818

19+
### Quick Install (recommended)
20+
21+
```bash
22+
curl -fsSL https://raw.githubusercontent.com/rawwerks/dirpack/master/install.sh | bash
23+
```
24+
25+
This downloads a pre-built binary for your platform and installs it to `~/.local/bin`.
26+
27+
### Using Cargo
28+
1929
```bash
2030
cargo install dirpack
2131

@@ -125,6 +135,7 @@ dirpack pack [PATH] [OPTIONS]
125135
-f, --format <FORMAT> Output: pipe, full, json
126136
-o, --output <FILE> Write to file instead of stdout
127137
-c, --config <FILE> Custom config path
138+
--root-label <LABEL> Override root path in output (e.g., '.')
128139
--no-git Don't use git ls-files
129140
--no-signatures Skip tree-sitter extraction
130141
-v, --verbose Show stats

install.sh

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
4+
REPO="rawwerks/dirpack"
5+
API_URL="https://api.github.com/repos/${REPO}/releases/latest"
6+
7+
fail() {
8+
echo "install.sh: $*" >&2
9+
exit 1
10+
}
11+
12+
require_cmd() {
13+
command -v "$1" >/dev/null 2>&1 || fail "missing required command: $1"
14+
}
15+
16+
require_cmd curl
17+
require_cmd uname
18+
19+
tag="$(
20+
curl -fsSL "$API_URL" | grep -m1 '"tag_name"' | sed -E 's/.*"tag_name": *"([^"]+)".*/\1/'
21+
)"
22+
23+
if [ -z "$tag" ]; then
24+
fail "could not determine latest release tag"
25+
fi
26+
27+
os="$(uname -s)"
28+
case "$os" in
29+
Linux) os="linux" ;;
30+
Darwin) os="macos" ;;
31+
*) fail "unsupported OS: $os" ;;
32+
esac
33+
34+
arch="$(uname -m)"
35+
case "$arch" in
36+
x86_64|amd64) arch="x86_64" ;;
37+
arm64|aarch64) arch="aarch64" ;;
38+
*) fail "unsupported architecture: $arch" ;;
39+
esac
40+
41+
asset="dirpack-${os}-${arch}"
42+
url="https://github.com/${REPO}/releases/download/${tag}/${asset}"
43+
44+
tmpfile="$(mktemp)"
45+
cleanup() {
46+
rm -f "$tmpfile"
47+
}
48+
trap cleanup EXIT
49+
50+
echo "Downloading ${asset} from ${url}"
51+
curl -fL --progress-bar "$url" -o "$tmpfile" || fail "download failed"
52+
53+
chmod +x "$tmpfile"
54+
55+
install_dir="${HOME}/.local/bin"
56+
use_sudo=false
57+
58+
if [ ! -d "$install_dir" ]; then
59+
mkdir -p "$install_dir" 2>/dev/null || true
60+
fi
61+
62+
if [ ! -w "$install_dir" ]; then
63+
install_dir="/usr/local/bin"
64+
use_sudo=true
65+
fi
66+
67+
dest="${install_dir}/dirpack"
68+
69+
if [ "$use_sudo" = true ]; then
70+
require_cmd sudo
71+
sudo mv "$tmpfile" "$dest"
72+
else
73+
mv "$tmpfile" "$dest"
74+
fi
75+
76+
version="$("$dest" --version 2>/dev/null || true)"
77+
if [ -z "$version" ]; then
78+
fail "dirpack did not run successfully after install"
79+
fi
80+
81+
echo "Installed ${version} to ${dest}"
82+
83+
if ! command -v dirpack >/dev/null 2>&1; then
84+
echo "Note: ${install_dir} is not on your PATH."
85+
echo "Add this to your shell profile:"
86+
echo " export PATH=\"${install_dir}:\$PATH\""
87+
fi

0 commit comments

Comments
 (0)