Skip to content

Using SYNG from the command-line

Using syng on the command line requires two parameters: the query to run, and paths to source files to run it against.

syng '(id x)' files...

The query can be read from a file instead of a parameter through the --query or -q option:

syng -q ./query.lisp files...


If you want to pass multiple files while using the --query flag, you must separate the options from the files using --:

syng -q ./query.lisp -- file1 file2 fileN

This is a limitation with the current CLI parser and may be lifted in the future.

stdin can be used as a source file by specifying -, which can act as a playground as you're working on the query itself:

# for bash:
syng '(var)' - <<< 'var x = 5;'

# for other shells:
echo 'var x = 5' | syng '(var)' -

Run syng --help to see the available options.

Copyright © 2022-present Semantic Works, Inc.