Skip to content

Add logcli tool for querying Grafana Loki logs#102

Merged
ooloth merged 2 commits intomainfrom
add-logcli-tool-for-querying-grafana-loki-logs
Nov 19, 2025
Merged

Add logcli tool for querying Grafana Loki logs#102
ooloth merged 2 commits intomainfrom
add-logcli-tool-for-querying-grafana-loki-logs

Conversation

@ooloth
Copy link
Owner

@ooloth ooloth commented Nov 19, 2025

💪 What

  • Add logcli tool module with install, update, and uninstall scripts
  • Update CLAUDE.md to reference eza and logcli as examples of simple Homebrew formula tools

🤔 Why

  • Enable querying Grafana Loki log aggregation systems using LogQL from the command line
  • Provide a clean example (alongside eza) of how to add a simple Homebrew-based tool to this dotfiles repository

👀 Usage

Once installed, use logcli to query Grafana Loki servers:

# Query logs with LogQL
logcli query '{app="myapp"}'

# Stream live logs
logcli tail '{job="myjob"}'

# Get labels
logcli labels

👩‍🔬 How to validate

  1. Ensure the DOTFILES environment variable is set (e.g., export DOTFILES=/path/to/dotfiles)
  2. Install logcli:
    ${DOTFILES}/tools/logcli/install.bash
  3. Verify installation:
    logcli --version
  4. Update logcli:
    ${DOTFILES}/tools/logcli/update.bash
  5. Uninstall logcli:
    ${DOTFILES}/tools/logcli/uninstall.bash
  6. Verify the scripts follow the same pattern as tools/eza/ (another simple Homebrew formula)

🔗 Related links

@ooloth ooloth marked this pull request as ready for review November 19, 2025 15:51
Copilot AI review requested due to automatic review settings November 19, 2025 15:51
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds support for the logcli tool, which enables command-line querying of Grafana Loki log aggregation systems using LogQL. The implementation follows the established pattern for simple Homebrew-based tools and updates documentation to reference it as an example alongside eza.

Key Changes:

  • New logcli tool module with installation, update, and uninstall scripts
  • Documentation update highlighting logcli and eza as reference examples for simple Homebrew formula tools

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
tools/logcli/utils.bash Defines tool-specific variables and version parsing function
tools/logcli/install.bash Installation script using Homebrew formula
tools/logcli/update.bash Update script with version checking
tools/logcli/uninstall.bash Uninstallation script for cleanup
CLAUDE.md Added reference to logcli as an example of simple Homebrew tools

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@ooloth ooloth merged commit 6308720 into main Nov 19, 2025
1 check passed
@ooloth ooloth deleted the add-logcli-tool-for-querying-grafana-loki-logs branch November 19, 2025 15:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants