Skip to Content
Apso is in public beta. Get started
GuidesToolsApso CLIOverview

Apso CLI

The Apso CLI (@apso/cli) transforms .apsorc schemas into framework backend services. It generates entities, controllers or handlers, services, request models, and framework registration for TypeScript, Python, and Go projects.

Quick start

# Install the CLI npm install -g @apso/cli # Create a new project apso init --name my-app --language typescript --skip-platform # Define your schema in .apsorc # Generate code apso generate # Start the database and dev server apso dev

The service listens on the APP_PORT configured by its template. Swagger UI is available at /_docs. Generated code uses standard framework patterns with no required Apso runtime.

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

LanguageFrameworkORMStatus
TypeScriptNestJSTypeORMAvailable
PythonFastAPISQLAlchemyAvailable
GoGinGORMAvailable

Generated code structure

Generated files go in src/autogen/ for TypeScript, app/autogen/ for Python, and autogen/ for Go. These files are overwritten on each apso generate run. Place custom business logic in the corresponding extensions/ directory. You can extend a generated TypeScript service by subclassing it:

// 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