DEV Community

shinoj cm
shinoj cm

Posted on

Stop Maintaining 6 Files for One API: How AION CLI Saves Hours Daily

Stop Maintaining 6 Files for One API: How AION CLI Saves Hours Daily

You just updated your API endpoint. Now you need to:

  1. Update TypeScript types
  2. Update OpenAPI documentation
  3. Update Zod validation schemas
  4. Update Express route handlers
  5. Update the client SDK
  6. Update database migrations

Miss just ONE of these? Your app breaks in production. Welcome to type spaghetti hell.

The Problem Every API Developer Faces

Here's what maintaining a typical REST API looks like:

TypeScript Types:

interface User {
  id: string;
  name: string;
  email: string;
  createdAt: Date;
}
Enter fullscreen mode Exit fullscreen mode

OpenAPI Spec:

components:
  schemas:
    User:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
Enter fullscreen mode Exit fullscreen mode

That's THREE different files defining the SAME thing.

Enter AION CLI: One Schema, Everything Generated

AION CLI solves this with a radical approach: Write your schema once, generate everything automatically.

Here's the SAME user entity in AION:

api UserAPI v1.0.0

entity User {
  id: string
  name: string
  email: string
  createdAt: datetime
}

endpoints {
  GET /users -> User[]
  POST /users -> User
  GET /users/:id -> User
}
Enter fullscreen mode Exit fullscreen mode

That's it. 15 lines instead of 150+.

From this ONE schema, AION generates:

✅ TypeScript interfaces
✅ Express routes with validation
✅ OpenAPI documentation
✅ Client SDK
✅ Mock server
✅ Database schemas
✅ Zod validators

How AION CLI Works

Install

npm install -g aion-cli
Enter fullscreen mode Exit fullscreen mode

Create Your Project

aion init my-api
cd my-api
Enter fullscreen mode Exit fullscreen mode

Define Your Schema

api BlogAPI v1.0.0

entity Post {
  id: string
  title: string
  content: string
  author -> User
  publishedAt?: datetime
}

entity User {
  id: string
  name: string
  email: string
  posts <- Post[]
}

endpoints {
  GET /posts -> Post[]
  POST /posts -> Post
  GET /posts/:id -> Post
}
Enter fullscreen mode Exit fullscreen mode

Start Dev Mode

aion dev schema.aion
Enter fullscreen mode Exit fullscreen mode

Visit http://localhost:3000 and see your API running live!

AION vs The Alternatives

vs OpenAPI/Swagger

Swagger: 200+ lines of YAML, verbose, hard to read

AION: 30 lines, human-readable, type-safe

Winner: AION (80% less code)

vs Postman

Postman: Testing only, no code generation

AION: Complete lifecycle, generates production code

Winner: AION (complete solution)

vs Prisma

Prisma: Database-focused only

AION: Full stack: DB → API → Client

Winner: AION (end-to-end solution)

Real Developer Benefits

Before AION:

  • 3 hours to add a new endpoint
  • Constant drift between code and docs
  • Production bugs from type mismatches

After AION:

  • 15 minutes to add a new endpoint
  • Zero drift (everything from one source)
  • Fewer bugs (validation auto-generated)

Try AION CLI Today

Stop maintaining type spaghetti. Start building APIs the modern way.

Install in 60 seconds:

npm install -g aion-cli
aion init my-api
cd my-api
aion dev schema.aion
Enter fullscreen mode Exit fullscreen mode

Links & Resources

Join developers building APIs faster with AION!

Top comments (0)