8 releases (stable)
Uses new Rust 2024
| 1.5.0 | Feb 10, 2026 |
|---|---|
| 1.4.0 | Feb 10, 2026 |
| 1.3.0 | Dec 30, 2025 |
| 0.1.1 | Dec 26, 2025 |
#191 in Development tools
37KB
661 lines
git-seek CLI
A command-line tool for querying Git repositories using Trustfall's GraphQL-like syntax.
Installation
From crates.io
cargo install git-seek
From source
git clone git@github.com:starfy84/git-seek.git
cd git-seek
cargo build --release -p git-seek
Usage
Basic Queries
# Query repository name
git-seek --query '{repository {name @output}}'
# Query all branches
git-seek --query '{repository {branches {name @output}}}'
# Query commits with their messages
git-seek --query '{repository {commits {hash @output message @output}}}'
Input Methods
You can provide queries in three ways:
-
Inline query (using
--queryor-q):git-seek --query '{repository {name @output}}' -
From file (using
--fileor-f):git-seek --file my-query.graphql -
Via stdin (pipe input):
echo '{repository {name @output}}' | git-seek
Variables
Use variables in your queries with --var:
git-seek --query '{repository {name @output}}' --var repo_name=my-repo
Output Formats
Control the output format with --format:
raw(default) - Raw debug outputjson- Pretty-printed JSONtable- Human-readable table
# JSON output
git-seek --query '{repository {branches {name @output}}}' --format json
# Table output
git-seek --query '{repository {commits {hash @output message @output}}}' --format table
Examples
Repository Information
git-seek --query '{
repository {
name @output
}
}' --format json
Branch Listing with Latest Commits
git-seek --query '{
repository {
branches {
name @output
commit {
hash @output
message @output
}
}
}
}' --format table
Recent Commits
git-seek --query '{
repository {
commits {
hash @output
message @output
}
}
}' --format table
Limited Commit History
# Get only the last 5 commits
git-seek --query '{
repository {
commits(limit: 5) {
hash @output
message @output
author @output
date @output
}
}
}' --format table
Author and Committer Details
# Show author and committer info for recent commits
git-seek --query '{
repository {
commits(limit: 5) {
hash @output
author @output
author_email @output
committer @output
committer_email @output
}
}
}' --format table
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
cargo test -p git-seek
# Build in debug mode
cargo build -p git-seek
# Run with debug output
RUST_LOG=debug git-seek --query '{repository {name @output}}'
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
Dependencies
~27MB
~581K SLoC