implement as command line: generate and filter