I need only list metrics names from agents or collectors (not metrics groups)
You should be able to perform something similar to below. Of course your regex will differ but this should get you what you need.
get historical data from agents matching [REGULAR EXPRESSION] and metrics matching [REGULAR EXPRESSION] between [EXACT MATCH] and [EXACT MATCH] with frequency of [EXACT MATCH] (second|seconds|sec|secs|s)
get historical data from agents matching (.*weblogic.*) and metrics matching (Servlets:Responses Per Interval) between \"2011-10-12 00:00:00\" and \"2011-10-12 00:10:00\" with frequency of 60 seconds
CLW Command Reference - CA Application Performance Management - 10.5 - CA Technologies Documentation
Marking as answered since a very good lead was provided.
Please let us know if Matt's answer helped and if you have any followup questions. And let us know how you made out in doing this!