Use the Moralis API via Moralis CLI directly inside your AI agent 🤖 while keeping your API key secure and enabling smooth interaction.
Follow these steps to start using Moralis CLI with your AI agent.
Install:
npm install -g moralis-cliUpdate to the latest version:
npm install -g moralis-cli@latestVerify the installed version:
moralis-cli --versionLogin:
moralis-cli loginEnter your Moralis API key when prompted (stored securely).
Check login status:
moralis-cli statusConnect to AI
Import the @moralis-cli skill into your AI agent and start making Moralis API calls securely.
› Please install this skill: https://raw.githubusercontent.com/MoralisWeb3/moralis-cli/refs/heads/main/.codex/skills/moralis-cli/SKILL.md
Codex:
› get my balance on solana chain kXB7FfzdrfZpAZEW3TZcp8a8CwQbsowa6BdfAHZ4gVs $moralis-cli
• Using the moralis-cli skill for this directly. I’ll run the Solana balance command on mainnet for that wallet and return the current value.
• Ran node bin/moralis-cli.js solana balance kXB7FfzdrfZpAZEW3TZcp8a8CwQbsowa6BdfAHZ4gVs
└ {
"lamports": "24544198",
"solana": "0.024544198"
}
──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
• moralis-cli Solana balance for kXB7FfzdrfZpAZEW3TZcp8a8CwQbsowa6BdfAHZ4gVs (mainnet):
- 0.024544198 SOL
- 24,544,198 lamportsMIT