# Is there a cli tool to read documentation?

**URL:** <https://forum.crystal-lang.org/t/is-there-a-cli-tool-to-read-documentation/3454>\
**Category:** Help & Support\
**Created:** [July 2, 2021, 12:28pm UTC](https://forum.crystal-lang.org/t/is-there-a-cli-tool-to-read-documentation/3454 "2021-07-02T12:28:15Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![szabgab](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.crystal-lang.org/szabgab/32/1278_2.png) [@szabgab](https://forum.crystal-lang.org/u/szabgab)\
**Post date:** [July 2, 2021, 12:28pm UTC](https://forum.crystal-lang.org/t/is-there-a-cli-tool-to-read-documentation/3454/1 "2021-07-02T12:28:15Z")

</div>

Is there a command-line tool (like man) that would display the relevant documentation of Crystal or that would take me to correct page in my browser? e.g. one that I could run

```auto
crystal docs --html HTTP::Client::Response

```

that would open my browser at [HTTP::Client - Crystal 1.0.0](https://crystal-lang.org/api/HTTP/Client.html)

Or

```auto
crystal docs --show HTTP::Client::Response

```

that would pipe the document through `less` on Linux.

---

<div class="post-metadata">

**Author:** ![straight-shoota](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.crystal-lang.org/straight-shoota/32/36_2.png) [@straight-shoota](https://forum.crystal-lang.org/u/straight-shoota)\
**Post date:** [July 2, 2021, 1:09pm UTC](https://forum.crystal-lang.org/t/is-there-a-cli-tool-to-read-documentation/3454/2 "2021-07-02T13:09:50Z")

</div>

The former is pretty trivial. That’s essentially just `open "docs/${1//::/\/}.html"`.

---

<div class="post-metadata">

**Author:** ![straight-shoota](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.crystal-lang.org/straight-shoota/32/36_2.png) [@straight-shoota](https://forum.crystal-lang.org/u/straight-shoota)\
**Post date:** [July 2, 2021, 1:11pm UTC](https://forum.crystal-lang.org/t/is-there-a-cli-tool-to-read-documentation/3454/3 "2021-07-02T13:11:27Z")

</div>

A while ago I did some experiments with consuming the API docs JSON data. It also includes a CLI for extracting information. I don’t think the feature you’re looking for is exactly implemented, but it shouldn’t be hard to do. The data is all there.  
Code is at [GitHub - straight-shoota/crystal-api](https://github.com/straight-shoota/crystal-api), but I haven’t tested it in a while, probably needs some updates.

---

<div class="post-metadata">

**Author:** ![hvnsweeting](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.crystal-lang.org/hvnsweeting/32/1359_2.png) [@hvnsweeting](https://forum.crystal-lang.org/u/hvnsweeting)\
**Post date:** [July 23, 2021, 4:03pm UTC](https://forum.crystal-lang.org/t/is-there-a-cli-tool-to-read-documentation/3454/4 "2021-07-23T16:03:50Z")

</div>

Hey, I just wrote a CLI tool to do this:

> **[GitHub - hvnsweeting/crydoc: CLI doc for Crystal lang](https://github.com/hvnsweeting/crydoc)**
>
> CLI doc for Crystal lang. Contribute to hvnsweeting/crydoc development by creating an account on GitHub.

I’m learning Crystal from Python background and this also what I’m looking for,  
so I decided to make it my first project in Crystal.

The tool is just functioning today,  
next step is porting it to crystal. (and use new name `crdoc`)

Feedback is welcome.
