Skip to content

sbyware/svq

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

svq

service query engine

Installation

Windows

x64

curl -L https://github.com/sbyware/svq/releases/download/latest/svq-windows-x64.exe -o ~/.svq.exe && curl -L https://raw.githubusercontent.com/sbyware/svq/main/db.json -o ~/.svq

ARM

curl -L https://github.com/sbyware/svq/releases/download/latest/svq-windows-arm64.exe -o svq.exe && curl -L https://raw.githubusercontent.com/sbyware/svq/main/db.json -o ~/.svq

Linux

x64

curl -L https://github.com/sbyware/svq/releases/download/latest/svq-linux-x64 -o ~/.local/bin/svq && curl -L https://raw.githubusercontent.com/sbyware/svq/main/db.json -o ~/.svq

ARM

curl -L https://github.com/sbyware/svq/releases/download/latest/svq-linux-arm64 -o ~/.local/bin/svq && curl -L https://raw.githubusercontent.com/sbyware/svq/main/db.json -o ~/.svq

macOS

Intel (x64)

curl -L https://github.com/sbyware/svq/releases/download/latest/svq-macos-x64 -o ~/.local/bin/svq && curl -L https://raw.githubusercontent.com/sbyware/svq/main/db.json -o ~/.svq

Apple Silicon (ARM)

curl -L https://github.com/sbyware/svq/releases/download/latest/svq-macos-arm64 -o ~/.local/bin/svq && curl -L https://raw.githubusercontent.com/sbyware/svq/main/db.json -o ~/.svq

Configuration

The .svq file (copied to ~/.svq) contains the list of services and their respective ports. The file is a JSON array with the following structure:

[
  {
    "name": "http",
    "port": 80
  },
  {
    "name": "https",
    "port": 443
  }
]

the -select flag

The -select flag allows you to filter the output of svq by a specific field. The flag takes a string as an argument and will filter the output based on the value of the field.

Get all services with port 80 or 443

svq -p 80,443 -select port

Get all services with port 80 or 443

svq -p 80,443 -select name

the -j flag, with jq

You can use jq to filter the output of svq when using the -j flag.

Get all services with port 80 or 443

svq -j -p 80,443 | jq '.[] | select(.name == "http")'

Get all ports for services that match "http"

svq -j -m "http" | jq -r '.[].port'

Get just the first description for services on port 443

svq -j -p 443 | jq -r '.[].description' | head -n 1

## License

MIT