> For the complete documentation index, see [llms.txt](https://docs.agentipy.fun/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.agentipy.fun/examples/rugcheck-cli-example.md).

# RugCheck CLI Example

The **RugCheck CLI Tool** is a command-line interface (CLI) application that allows users to fetch and display RugCheck reports for Solana tokens by entering their Contract Address (CA). The tool uses Agentipy's `RugCheckManager` (which wraps the RugCheck API) to provide detailed information about a token's risks, score, and LP lockers.

## Features

* **Fetch RugCheck Reports**:
  * Get a summary report for a token, including its risk score, identified risks, and creator tokens.
* **Fetch LP Lockers**:
  * Retrieve information about the token's LP (Liquidity Pool) lockers and total locked value.
* **User-Friendly Output**:
  * Display results in an easy-to-read format.
* **Error Handling**:
  * Provide clear error messages for invalid inputs or API issues.

## Code (`rugcheck_cli.py`)

```python
import asyncio
from agentipy.tools.rugcheck import RugCheckManager

async def main():
    api_key = "YOUR_API_KEY"  # Replace with your actual RugCheck API key
    rugcheck = RugCheckManager(api_key)

    print("Enter the Contract Address (CA) of the token.")
    print("Example CA: So11111111111111111111111111111111111111112 (Wrapped SOL)")
    user_input = input("Your input: ").strip()

    try:
        print("\nFetching RugCheck report...\n")

        report = await rugcheck.fetch_token_report_summary(user_input)
        print(report.to_user_friendly_string())

        lockers = await rugcheck.fetch_token_lp_lockers(user_input)
        print("\n" + lockers.to_user_friendly_string())

    except Exception as e:
        print(f"\nError: {e}")
        print("Please ensure you entered a valid Contract Address (CA).")
        print("Example CA: So11111111111111111111111111111111111111112 (Wrapped SOL)")

if __name__ == "__main__":
    asyncio.run(main())
```

**Note:** You need to replace `"YOUR_API_KEY"` in the script with your actual RugCheck API key for the example to work. Some RugCheck endpoints might work without an API key but could be rate-limited or offer less data.

## Source Files

You can find the source files for this example (including its original `readme.md` with setup and usage instructions) on GitHub: <https://github.com/niceberginc/agentipy/blob/main/examples/rugCheck/>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.agentipy.fun/examples/rugcheck-cli-example.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
