Ivy`s AI-agent

Ivy's AI Agent is a powerful force multiplier for .NET developers. It understands your code, diagnoses complex build errors, and can scaffold entire applications from your database schema.

The Agentic Edge

The Ivy CLI is more than just a tool for scaffolding projects; it’s an AI-powered assistant. By using "agentic" commands, you move away from manual debugging and boilerplate generation. The Ivy Agent provides a developer-first approach to building enterprise-grade apps at scale.

Prerequisites: Getting Agent-Ready

To leverage the agentic capabilities of the Ivy CLI, ensure your environment is set up correctly:

  1. .NET 10 SDK: Make sure to have the latest .NET installed, download it here.

  2. Ivy CLI: Install the Ivy Console tool globally using the .NET CLI:

    dotnet tool install -g Ivy.Console
    
  3. Ivy Account: Sign up at ivy.app and authenticate your CLI:

    ivy login
    
  4. Initialize Your Project: Create a new directory and initialize it:

    mkdir MyProject
    cd MyProject
    ivy init
    

AI-Powered Generation with ivy db generate

This is where the agent truly shines. Simply run the command and a browser window will open, allowing you to describe your entire data model in plain English. Ivy will then build the database, seed it with data, and even scaffold the initial apps for you.

ivy db generate

The AI Flow:

  • Browser Interaction: Describe your data model in the interactive web UI.
  • Schema Design: Converts your prompt into a valid database schema (DBML).
  • Infrastucture: Generates the migrations and database creator.
  • Data Seeding: Automatically generates realistic seed data so you can test immediately.
  • App Scaffolding: Proposes and builds multiple apps (e.g., "Order Management", "Inventory Dashboard") based on the generated schema.

Supported Databases: Ivy supports all major database providers out of the box, including Sqlite, Postgres, MySql, and SQL Server.

You can now run the project in hot-reload mode

dotnet watch

Fixing Errors with ivy fix

Instead of squinting at compiler errors, you can let the Ivy Agent diagnose and resolve them for you. It's the fastest way to get back to a "green" build.

How it Works

When you run ivy fix, the CLI performs a multi-step intervention:

  • Analysis: It builds your project and captures all compiler errors and warnings.
  • Contextualization: These errors are sent to the Ivy Agent along with the relevant code context.
  • Repair: The agent proposes and applies fixes directly to your codebase.

Example Usage

Simply run the following command in your project's root:

ivy fix

If you have a specific issue you want the agent to focus on, you can provide a prompt:

ivy fix --prompt "Fix the circular dependency in the User service"

Adding Existing Databases with ivy db add

If you already have a database, you can connect it to Ivy in seconds. This command sets up the necessary connection logic and allows the agent to understand your data schema.

ivy db add

What it handles:

  • Provider Selection: Choose from Sqlite, Postgres, MySql, or SqlServer.
  • Connection Strings: Securely stores your credentials in .NET User Secrets.
  • Context Generation: Automatically creates the Entity Framework Core context and configurations.

Scaling with ivy app create

Building new features often involves repetitive work—creating entities, services, controllers, and pages. The ivy app create command leverages the agent to automate this entire flow.

1. Generating from Prompts

Describe the feature you want in plain English, and the agent will scaffold the entire application layer.

ivy app create --prompt "A task management system with support for categories and priorities"

2. Generating from Database Entities

If you’ve already defined your database schema via a connection, Ivy can generate a full CRUD (Create, Read, Update, Delete) application for your entities in seconds.

ivy app create --from-entities

This command will prompt you to select which entities you want to generate apps for, and then the agent will ensure the generated code follows your project's patterns and standards.


Community & Resources

Mikael Rinne

Written by

Mikael Rinne