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)
import asynciofrom agentipy.tools.rugcheck import RugCheckManagerasyncdefmain(): 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())exceptExceptionas 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.