Apso CLI
The Apso CLI (@apso/cli) transforms .apsorc schema definitions into production-ready backend services. It generates entities, controllers, services, DTOs, and modules for TypeScript (NestJS), Python (FastAPI), and Go (Gin) projects.
Quick start
# Install the CLI
npm install -g @apso/cli
# Create a new project
apso init --name my-app --language typescript
# Define your schema in .apsorc
# Generate code
apso generate
# Start the database and dev server
apso devYour API is live at http://localhost:3000 with Swagger docs at /api. The generated code lives in src/autogen/ and uses standard framework patterns with no Apso runtime dependency.
What it generates
From a single .apsorc schema file, you get:
- Entity classes with TypeORM decorators, validation, and relationship mappings
- CRUD controllers with pagination, filtering, and proper HTTP status codes
- Service classes with relationship-aware queries
- DTOs for request validation and response shaping
- NestJS modules wiring everything together
- Enum definitions from your schema’s enum fields
- Auth guards for session-based, JWT, or API key authentication
- Scope guards for multi-tenant data isolation
Supported languages
| Language | Framework | ORM | Status |
|---|---|---|---|
| TypeScript | NestJS | TypeORM | Stable |
| Python | FastAPI | SQLAlchemy | Coming soon |
| Go | Gin | GORM | Coming soon |
Generated code structure
All generated files go in src/autogen/. These files are overwritten on each apso generate run. Place custom business logic in src/extensions/ — extension files are never overwritten. You can extend generated services by subclassing them:
// src/extensions/Project/Project.service.ts
import { Injectable } from '@nestjs/common';
import { ProjectService as AutogenProjectService } from '../../autogen/Project/Project.service';
@Injectable()
export class ProjectService extends AutogenProjectService {
async archiveProject(id: number) {
// Your custom logic here
}
}Next steps
Last updated on