Categorygithub.com/StCredZero/asq
repository
0.0.0-20250120010121-e0dc6c1e7be4
Repository: https://github.com/stcredzero/asq.git
Documentation: pkg.go.dev

# Packages

No description provided by the author
No description provided by the author

# README

asq - Active Semantic Query Tool

A tool for semantic code querying using tree-sitter patterns. Extract and match code patterns in Go files using semantic queries.

Installation

Using Go

go install github.com/StCredZero/asq/cmd/asq@latest

Using Homebrew

Coming soon with first release

After the first release, you'll be able to install using:

brew tap StCredZero/asq
brew install asq

Usage

Generate a Tree-sitter Query

To generate a tree-sitter query from a Go file that contains code marked with //asq_start and //asq_end comments:

asq tree-sitter path/to/file.go

Example input file:

package example

func Example() {
    //asq_start
    e.Inst().Foo()
    //asq_end
}

Search Using Generated Query

To search for matches of the generated query in all Go files recursively from the current directory:

asq query path/to/file.go

The output will show matches with their file paths, line numbers, and column numbers:

//asq_match path/to/match1.go:10:4
e.Inst().Foo()
//asq_match path/to/match2.go:15:2
e.Inst().Foo()

License

MIT License - see LICENSE for details.