git-seek CLI
A command-line tool for querying Git repositories using Trustfall's GraphQL-like syntax.
Installation
From crates.io
From source
Usage
Preset Queries
Run common queries without writing Trustfall:
# List all available presets
# Show recent commits (default: last 10)
# Show last 5 commits in table format
# List all branches with their latest commit
# List all tags
# Find commits by a specific author
# Search commit messages with regex
Available Presets
| Preset | Description | Parameters |
|---|---|---|
recent-commits |
Show recent commits | --param limit=N (default: 10) |
branches |
List all branches with latest commit | (none) |
tags |
List all tags with their commit | (none) |
commits-by-author |
Commits by a specific author | --param author=NAME (required) |
search-commits |
Search commit messages by regex | --param pattern=REGEX (required) |
Custom Queries
Write your own Trustfall queries for full control:
# Query repository name
# Query all branches
# Query commits with their messages
Input Methods
You can provide custom queries in three ways:
-
Inline query (using
--queryor-q): -
From file (using
--fileor-f): -
Via stdin (pipe input):
|
Variables
Use variables in your custom queries with --var:
Output Formats
Control the output format with --format:
raw(default) - Raw debug outputjson- Pretty-printed JSONtable- Human-readable table
# JSON output
# Table output
Examples
Repository Information
Branch Listing with Latest Commits
Recent Commits
Limited Commit History
# Get only the last 5 commits
Tag Listing
Tags with Commits
Author and Committer Details
# Show author and committer info for recent commits
Error Handling
The tool provides helpful error messages:
- If no query is provided and stdin is a terminal, it will prompt for input method
- Invalid Trustfall syntax will show parsing errors
- Git repository errors (e.g., not in a Git repo) are clearly reported
Development
# Run tests
# Build in debug mode
# Run with debug output
RUST_LOG=debug
Dependencies
trustfall_git_adapter- The Git adapter libraryclap- Command-line argument parsinggit2- Git repository accessserde_json- JSON serializationcomfy-table- Table formattinganyhow- Error handling
License
BSD-3-Clause