Skip to content

CLI command to get Clarity documentation #2275

@hugo-stacks

Description

@hugo-stacks

AI coding agents don't know Clarity well.
They are not specifically trained for it, and there's low training data.

I've seen agents struggling with Clarity 4 at-block? especially.

They can check the online docs, but also, Clarinet already contains the whole Clarity language reference here (from the core repo).

This doc can be read in the LSP or in the clarinet console with

::functions                             Display all the native functions available in clarity
::keywords                              Display all the native keywords available in clarity
::describe <function> | <keyword>       Display documentation for a given native function or keyword

But this isn't really helpful to a coding agent.

Hypothese

Would it actually help AI agents if they could easily access the Clarity language reference from the CLI?

Idea

Something like:

$ clarinet doc ls functions # (or functions ls)
$ clarinet doc ls keyword
$ clarinet doc describe <function|keyword>

clarinet doc ls should only show the functions and keywords of the current Clarity version (clarinet_defaults::DEFAULT_CLARITY_VERSION), otherwise, it shows functions or keywords that are not valid anymore (can be super confusing for as-contract? vs as-contract).
It could accept a --clarity-version=<v> argument.
It should clearly state that it's "showing functions for Clarity "

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions