Skip to content

macebake/iq

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

   ,---,    ,----..      
,`--.' |   /   /   \     
|   :  :  /   .     :    
:   |  ' .   /   ;.  \   
|   :  |.   ;   /  ` ;   
'   '  ;;   |  ; \ ; |   
|   |  ||   :  | ; | '   
'   :  ;.   |  ' ' ' :   
|   |  ''   ;  \; /  |   
'   :  | \   \  ',  . \  
;   |.'   ;   :      ; | 
'---'      \   \ .'`--"  
            `---`     

iq

iq is a Gemini wrapper of jq, which converts your natural language questions into jq commands and runs them for you.

Install

# Install
cargo install --git https://github.com/macebake/iq

# Setup (get free key: https://aistudio.google.com/app/apikey)
export GEMINI_API_KEY="your-key-here"

Usage

iq "find all error logs" --path server.jsonl
iq "show users from last week" --path data/*.jsonl
iq "count requests by status code" --path access.log

Example

$ iq "find failed API calls" --path logs.jsonl

Sampling...
Extracts API calls where status indicates failure (4xx/5xx codes)

Run:
jq -s '[.[] | select(.status >= 400)] | sort_by(.timestamp)'
[y/N] y

[
  {"timestamp": "2024-01-15", "status": 404, "path": "/api/users"},
  {"timestamp": "2024-01-15", "status": 500, "path": "/api/orders"}
]

Safety

  • Validates commands before execution
  • Always asks permission
  • No dangerous operations allowed
  • Works with jq expressions only

Requirements

About

JQ wrapped in Gemini

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages