I have a software which uses cli commands on linux. The cli's in turn call C methods.
Is there a way we can use swagger for the documentation of such cli's and publish it online? Or is there any other alternative which I can think of.
Swagger tools are for REST APIs, which are HTTP-based web services.
To document CLI tools you can use any general-purpose documentation tool.