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
82 changes: 80 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,88 @@ jobs:
tar -czvf ${{ matrix.artifact }}.tar.gz agenttop
mv ${{ matrix.artifact }}.tar.gz ../../../

- name: Upload Release Asset
- name: Compute SHA256
run: |
if command -v sha256sum >/dev/null 2>&1; then
sha256sum ${{ matrix.artifact }}.tar.gz > ${{ matrix.artifact }}.tar.gz.sha256
else
shasum -a 256 ${{ matrix.artifact }}.tar.gz > ${{ matrix.artifact }}.tar.gz.sha256
fi
cat ${{ matrix.artifact }}.tar.gz.sha256

- name: Upload Release Assets
uses: softprops/action-gh-release@v1
with:
files: ${{ matrix.artifact }}.tar.gz
files: |
${{ matrix.artifact }}.tar.gz
${{ matrix.artifact }}.tar.gz.sha256

publish-homebrew:
name: Publish Homebrew formula
runs-on: ubuntu-latest
needs: build-release
# Requires HOMEBREW_TAP_TOKEN secret: a PAT with `repo` scope on
# tech4242/homebrew-agenttop. Skips silently if the secret isn't set
# so releases can ship even before the tap repo is wired up.
if: ${{ github.event.release.tag_name != '' }}
steps:
- uses: actions/checkout@v4

- name: Resolve version + SHAs
id: meta
run: |
TAG="${{ github.event.release.tag_name }}"
VERSION="${TAG#v}"
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
echo "Resolved version: $VERSION"

mkdir -p /tmp/shas
for artifact in agenttop-darwin-arm64 agenttop-darwin-x86_64 agenttop-linux-aarch64 agenttop-linux-x86_64; do
url="https://github.com/${{ github.repository }}/releases/download/${TAG}/${artifact}.tar.gz.sha256"
echo "Fetching $url"
# The .sha256 file format is "<hash> <filename>", take just the hash.
curl -fsSL "$url" | awk '{print $1}' > "/tmp/shas/${artifact}.sha"
done

echo "darwin_arm64=$(cat /tmp/shas/agenttop-darwin-arm64.sha)" >> "$GITHUB_OUTPUT"
echo "darwin_x86_64=$(cat /tmp/shas/agenttop-darwin-x86_64.sha)" >> "$GITHUB_OUTPUT"
echo "linux_aarch64=$(cat /tmp/shas/agenttop-linux-aarch64.sha)" >> "$GITHUB_OUTPUT"
echo "linux_x86_64=$(cat /tmp/shas/agenttop-linux-x86_64.sha)" >> "$GITHUB_OUTPUT"

- name: Render formula
run: |
mkdir -p /tmp/rendered
sed \
-e "s/REPLACE_VERSION/${{ steps.meta.outputs.version }}/g" \
-e "s/REPLACE_SHA256_DARWIN_ARM64/${{ steps.meta.outputs.darwin_arm64 }}/g" \
-e "s/REPLACE_SHA256_DARWIN_X86_64/${{ steps.meta.outputs.darwin_x86_64 }}/g" \
-e "s/REPLACE_SHA256_LINUX_AARCH64/${{ steps.meta.outputs.linux_aarch64 }}/g" \
-e "s/REPLACE_SHA256_LINUX_X86_64/${{ steps.meta.outputs.linux_x86_64 }}/g" \
homebrew/agenttop.rb > /tmp/rendered/agenttop.rb
echo "--- rendered formula ---"
cat /tmp/rendered/agenttop.rb

- name: Push to tap repo
env:
TAP_TOKEN: ${{ secrets.HOMEBREW_TAP_TOKEN }}
run: |
if [ -z "${TAP_TOKEN:-}" ]; then
echo "::warning::HOMEBREW_TAP_TOKEN not set — skipping tap update. Add the secret to publish."
exit 0
fi
git clone "https://x-access-token:${TAP_TOKEN}@github.com/tech4242/homebrew-agenttop.git" /tmp/tap
mkdir -p /tmp/tap/Formula
cp /tmp/rendered/agenttop.rb /tmp/tap/Formula/agenttop.rb
cd /tmp/tap
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
if git diff --quiet; then
echo "Formula unchanged — nothing to push."
exit 0
fi
git add Formula/agenttop.rb
git commit -m "agenttop ${{ steps.meta.outputs.version }}"
git push

# publish-crates:
# name: Publish to crates.io
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/target
examples*
.DS_Store
.claude
.claude
ROADMAP.md
48 changes: 46 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "agenttop"
version = "0.3.1"
version = "0.4.0"
edition = "2024"
description = "htop for AI coding agents - terminal observability dashboard"
authors = ["tech4242"]
Expand Down Expand Up @@ -48,6 +48,10 @@ regex = "1"
# Process / host vitals scraping (cross-platform)
sysinfo = "0.33"

# Read opencode's session DB at ~/.local/share/opencode/opencode.db.
# `bundled` ships sqlite3 statically so users don't need a system sqlite.
rusqlite = { version = "0.32", features = ["bundled"] }

# Build dependencies for protobuf
[build-dependencies]
prost-build = "0.13"
Expand Down
33 changes: 28 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
[![Ratatui](https://img.shields.io/badge/TUI-Ratatui-blue.svg)](https://ratatui.rs/)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

[Installation](#installation) • [Usage](#usage) • [Features](#features) • [How It Works](#how-it-works)
[Quick Start](#quick-start) • [Features](#features) • [Configuration](#configuration) • [How It Works](#how-it-works)

</div>

Expand All @@ -28,6 +28,23 @@ A terminal-native observability dashboard for AI coding agents. Real-time visibi

<img src="./docs/preview.png" />

## Quick Start

```bash
# macOS
brew install tech4242/agenttop/agenttop

# Linux (downloads matching binary to ~/.local/bin)
curl -fsSL https://raw.githubusercontent.com/tech4242/agenttop/main/scripts/install.sh | sh

# Run it — auto-configures Claude Code, opens the dashboard
agenttop
```

That's it. agenttop detects Claude Code, writes the right OTEL env vars into `~/.claude/settings.json` (with a `.bak` first), starts the OTLP receiver on port 4318, and renders the TUI. On the next prompt to Claude, tool calls + token usage start streaming in.

Other agents (Codex, Gemini, Qwen, Cline, Copilot Chat, opencode) need a one-time setup — see [Configuration](#configuration).

## Origin Story

This is the spiritual successor of an MCP logging and monitoring tool that I was building over at https://github.com/tech4242/mcphawk. After realising that the tool needs to wrap every MCP server call in e.g. Claude configs and the fact that we can only log useful information for local calls due to various OS limitations (esp. on macOS), I gave it a rest.
Expand Down Expand Up @@ -126,13 +143,19 @@ schema (please report).
- **Productivity Metrics** - Lines of code, commits
- **Cache Reuse Rate** - Prompt caching efficiency

## Installation
## Other install methods

The [Quick Start](#quick-start) covers brew (macOS) and the `install.sh` script (Linux). If you want something else, the options below all work.

### Cargo
### Cargo (from source)

```bash
cargo install --git https://github.com/tech4242/agenttop
```

Not published yet but you can run `cargo install --git https://github.com/tech4242/agenttop`
Not published to crates.io yet — tracked on the roadmap.

### Pre-built Binaries
### Pre-built binaries (direct download)

Download from [GitHub Releases](https://github.com/tech4242/agenttop/releases), or use curl:

Expand Down
44 changes: 44 additions & 0 deletions homebrew/agenttop.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# homebrew/agenttop.rb — source of truth for the Homebrew formula.
#
# The release workflow renders this template (substituting VERSION and the
# four SHA256s) and pushes the result to tech4242/homebrew-agenttop, so
# `brew install tech4242/agenttop/agenttop` installs the latest release.
#
# Placeholders below (REPLACE_*) are filled in by the release workflow.
# Hand-edits to this file should preserve the placeholder strings.
class Agenttop < Formula
desc "htop for AI coding agents — terminal observability for Claude, Codex, Gemini, and more"
homepage "https://github.com/tech4242/agenttop"
version "REPLACE_VERSION"
license "MIT"

on_macos do
on_arm do
url "https://github.com/tech4242/agenttop/releases/download/v#{version}/agenttop-darwin-arm64.tar.gz"
sha256 "REPLACE_SHA256_DARWIN_ARM64"
end
on_intel do
url "https://github.com/tech4242/agenttop/releases/download/v#{version}/agenttop-darwin-x86_64.tar.gz"
sha256 "REPLACE_SHA256_DARWIN_X86_64"
end
end

on_linux do
on_arm do
url "https://github.com/tech4242/agenttop/releases/download/v#{version}/agenttop-linux-aarch64.tar.gz"
sha256 "REPLACE_SHA256_LINUX_AARCH64"
end
on_intel do
url "https://github.com/tech4242/agenttop/releases/download/v#{version}/agenttop-linux-x86_64.tar.gz"
sha256 "REPLACE_SHA256_LINUX_X86_64"
end
end

def install
bin.install "agenttop"
end

test do
assert_match "agenttop #{version}", shell_output("#{bin}/agenttop --version")
end
end
Loading
Loading