An illegally-made, genetically-engineered, extraterrestrial lifeform which interacts with Ethereum
Ainte is a command line tool that allows you to interact with the Ethereum blockchain. It is built with Bun and uses an LLM to generate bash commands for you. It is able to interoperate between the EthereumRPC, the Etherscan API and the foundry tooling to get you the information you need.
Interacting with blockchains is currently a complex process. There are two main methods: blockchain explorers and CLI tools. Explorers are great for basic tasks like calling getter functions or viewing simple transactions, but they're limited for more complex operations. On the other hand, CLI tools like Hardhat and Foundry are more powerful, but they can be cumbersome to use. The vision is to utilize the power of LLMs to interact with the Ethereum blockchain in a more natural and intuitive way.
Hopefully, as LLMs become more powerful, this tool can evolve to a one-stop-shop for the blockchain needs of any developer for both everyday tasks like deploying contracts and decoding transactions, as well as more complex tasks like telemetry data analysis and contract fuzzing.
Currently this is a proof of concept that shows that it is possible to interact with the Ethereum blockchain in a more natural and intuitive way. There is still a lot of work to be done to make this a reality, but the basics are there.
Namely, it is currently possible to:
Query EthereumRPC for transactions, addresses and more
Query the Etherscan API for contract related information
Use cast along with the APIs to perform complex tasks
Answer questions that it already knows the answer to
Perform multistep tasks while keeping context from previous steps
Example:
Example 2:
Apart from these basic functionalities, it also:
This CLI tool creates a blockchain-specialized OpenAI assistant with access to a custom knowledge base including Ethereum RPC, Etherscan API, and Foundry toolset. The assistant provides four types of responses:
The assistant operates through the Ainte CLI tool, which provides a Read-Eval-Print Loop (REPL) for chat interactions. Upon receiving a user message, Ainte propagates the message to the OpenAI assistant and handles the response accordingly. For direct answers and clarifying questions, the assistant will return the answer or question to the user. For command answers, it executes the command directly and returns the output. If a command fails, the assistant automatically retries up to 3 times.
For long outputs the assistant will pretty print the output to the console using jq
, less
and a markdown viewer.
The tool also supports custom commands, prefixed with /, for quick access to specific functions:
/exit
- Exits the REPL/menu
- Shows the commands menu/retry
- Keeps trying to fix the previous commands 3 times in case of error/save
- Saves the conversation to a file/copy
- Copies the last output to the clipboard/confirm
- Enables confirmation prompts before executing commands for our cautious friends/noconfirm
- Disables confirmation prompts for the brave (the default is being brave)curl -L https://foundry.paradigm.xyz | bash && foundryup
brew install node bun jq glow
sudo apt install nodejs bun jq glow
.env.example
to .env
and set your OPENAI_API_KEY
.bun run start
.Keep in mind that the first time you run the tool, it will create an OpenAI assistant and upload the knowledge base to it. Once the assistant is created, put the assistant ID in the .env
file, to avoid re-creating the assistant every time.
.env.example
to .env
and set your OPENAI_API_KEY
.docker build -t ainte .
docker run --rm -it ainte
Again, keep in mind that the first time you run the tool, it will create an OpenAI assistant. If you want to avoid recreating the assistant every time, put the assistant ID in the .env
file and re-build the image.
/retry
command to make it try again. You can also just rephrase the question, or ask it to "please fix the previous output".We'd love to get contributions from the community! Make sure to check the issues and pull requests to see if there's anything you'd like to work on.
Needless to say, issues and PRs are more than welcome!
Finally, feel free to join our telegram group where all the fun will be happening, or reach out to us on X if you have any questions! 🚀
From CommonPrefix with ❤️