beskay / ethernaut-cli

Ai agent cli with web3 capabilities

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ethernaut-cli

Dynamic JSON Badge GitHub Actions Workflow Status codecov

The ethernaut-cli is basically an ai agent that is given access to web3 actions through hardhat tasks. It is a cli meant to be installed globally, and used like:

ethernaut what is the total supply of USDC

or

ethernaut complete level 2 of the ethernaut challenges

It can also be used as a regular cli:

ethernaut util unit 5 --from ether --to wei

And also features an interactive mode that allows easy navigation of tasks and collection of task arguments.

Installation

npm i -g ethernaut-cli

Warning!!! This software is in beta, and very experimental atm.

danger

Packages

Title Description Coverage
ethernaut-ai AI assistant that interprets user input and executes hardhat tasks codecov
ethernaut-ai-ui Ui extensions for the ethernaut-ai package codecov
ethernaut-cli Main hardhat project codecov
ethernaut-challenges Tasks for playing the Open Zeppelin Ethernaut challenges from the CLI codecov
ethernaut-common Common utils used by several ethernaut-cli plugins codecov
ethernaut-interact Tasks for sending transactions and interacting with contracts codecov
ethernaut-interact-ui Ui extensions for the ethernaut-interact package codecov
ethernaut-network Tasks for interacting with different networks codecov
ethernaut-network-ui Ui extensions for the ethernaut-network package codecov
ethernaut-ui Intuitive navigation and interactive param collection for hardhat tasks codecov
ethernaut-util Simple, everyday utilities for Ethereum devs codecov
ethernaut-util-ui Ui extensions for the ethernaut-util package codecov
ethernaut-wallet Tasks for interacting from different Ethereum accounts codecov
ethernaut-wallet-ui Ui extensions for the ethernaut-wallet package codecov

Tutorials

Intuitive navigation

No more man pages. No more --help.

Just type ethernaut and jump straight into an enquirer based navigation mode. Select a scope, select a task, and boom.

Enquirer navigation

Smart interactive mode

Once in a task, interactive mode kicks in, and parameters are collected through enquirer prompts.

Enquirer param collection

Normal CLI interaction

This is still a regular CLI app, so commands can be called without all the fancy ui or ai stuff:

Normal CLI mode

Ui extensions

Plugins of plugins? Why not.

Plugins that enhance parameter collection prompts in other plugins with even cooler prompts, smart suggestions, etc.

For example, the ui extension of the interact plugin can fetch the abi from Etherscan if you didn't provide an abi:

Etherscan custom abi prompt

But after you've interacted with the contract, it already has the abi, so the abi is instead suggested:

Abi suggestion

Another example is the extension for the model param in ethernaut ai config --model, which queries the openai API and presents a list of available models.

Natural language to cli commands

If that wasn't easy enough, just type whatever you want and AI will kick in to try to make sense of what you typed, and the right command or sequence of commands will be executed.

Ai natural language interpretation

You want the AI to also teach you how the commands work? Sure.

Ai command explanation

You want the AI to also teach you about Ethereum. Also sure.

Complete level 1

Extensibility through hardhat plugins

Interesting toy ain't it?

You don't have to use this entire plethora of features tho. You can use a single feature in your regular hardhat project with exactly what you need. This is because the ethernaut-cli is completely built with hardhat plugins.

You just want task navigation and interactive mode in your project: use the ethernaut-ui plugin.

Or the ai stuff: use ethernaut-ai plugin.

All the plugins combined conform the ethernaut-cli.

About

Ai agent cli with web3 capabilities


Languages

Language:JavaScript 72.6%Language:Solidity 27.2%Language:Shell 0.2%