Skip to content

Xeno CLI Overview & System Architecture

@xeno-js/cli is the official command-line utility for the Xeno framework. Executable via the xeno binary token, it automates project initialization, infrastructure setup, dependency wiring, and configuration file generation for Xeno applications.


@xeno-js/cli acts as an interactive scaffolding engine designed to eliminate boilerplate setup time. It guides developers through prompt-driven setups or quick execution flags (--full / --empty) to assemble tailored application architecture templates.

  • Target Execution Runtime: Node.js >=20.0.0.

  • Exposed Binary Identifier: xeno (dist/index.js).

  • Core Dependencies: Driven by prompts for interactive user selection and picocolors for terminal output formatting.

  • Extensible Engine: Powered by an internal ScaffoldingEngine that coordinates sequential file generation tasks through modular generator handlers.


2. Installazione Globale (Global Installation)

Section titled “2. Installazione Globale (Global Installation)”

To make the xeno command globally available across your local environment, install the package using npm:

Terminal window
# Global installation command
npm install -g @xeno-js/cli

Ensure your Node.js version satisfies the package requirement (>=20.0.0):

Terminal window
node -v
# Output should be >= v20.0.0
xeno --version

3. Scopi della CLI (Core Scaffolding Capabilities)

Section titled “3. Scopi della CLI (Core Scaffolding Capabilities)”

The primary goal of @xeno-js/cli is to establish production-ready Xeno application structures configured with strongly-typed setups out of the box.

flowchart TD
A[xeno init command] --> B{Execution Mode}
B -->|Interactive Prompts| C[User selects features]
B -->|--full flag| D[Enable all features]
B -->|--empty flag| E[Minimal Core setup]
C --> F[Scaffolding Engine]
D --> F
E --> F
F --> G[Generate Configuration Files]
F --> H[Generate Source Code Structure]
F --> I[Automatic npm install execution]
subgraph Generated Artifacts
G --> G1[package.json / tsconfig.json]
G --> G2[.env.example / drizzle.config.ts]
H --> H1[src/main.ts / src/bootstrap.ts]
H --> H2[src/registry.ts / src/schema.ts]
end
  1. Modular Feature Opt-In / Opt-Out Dynamically enables/disables integration packages based on project requirements:
  • Validation: Zod schema validation.

  • Persistence Layer: Choice between PostgreSQL (Drizzle ORM + pg/postgres) or SQLite (@libsql/client).

  • Remote HTTP Client: Axios & Cockatiel integration.

  • Authentication: Supabase client (@supabase/supabase-js).

  • Logging & Observability: Pino JSON logger (pino / pino-pretty) and Sentry tracking (@sentry/node).

  • Distributed Caching: Redis driver (ioredis).

  1. Automated Code Generation Creates all essential project configuration files and application bootstrap scripts:
  • package.json: Generated with matching dependency versions and database script aliases (db:generate, db:push, db:migrate).

  • src/bootstrap.ts: Assembles the programmatic AppBuilder pipeline according to selected modules.

  • src/main.ts: Provides the entry point for starting the application container.

  • src/registry.ts: Prepares the type-safe XenoRegistry container tokens.

  • .env.example: Populates environment variable keys for configured drivers.

  1. Automated Workspace Bootstrap Executes npm install inside the created target directory automatically upon completing file generation.

Terminal window
# Interactive setup in a custom folder
xeno my-xeno-service
# Non-interactive full feature scaffold
xeno my-xeno-service --full
# Non-interactive minimal scaffold
xeno my-xeno-service --empty

Xeno is an MIT-licensed open source project. It can grow thanks to the support of these awesome people. If you’d like to join them, please read more at support section