Asena-cli provides several command-line utilities to help developers manage their asena applications efficiently. Here's a comprehensive guide to all available commands.
bun install -g @asenajs/asena-cli
asena --help
Commands:
create Creates an Asena project and installs the required dependencies.
build For building the project and preparing it for production deployment
dev Developer options
init [options] Creates a asena-config.ts file with default values (requires manual updates).
help [command] display help for command
The Create command bootstraps new Asena projects with a complete development environment setup.
- Interactive Setup: Uses inquirer for a user-friendly setup experience
- Project Structure: Creates the basic project structure with necessary files and directories
- Default Components: Generates default controller and server setup
- Development Tools: Optional integration of:
- ESLint configuration
- Prettier setup
- Dependency Management: Automatically installs required dependencies
asena create
├── src/
│ ├── controllers/
│ │ └── AsenaController.ts
│ └── index.ts
├── package.json
├── tsconfig.json
├──.eslintrc.js (optional)
├──.eslintignore (optional)
└──.prettierrc.js (optional)
The Init command helps set up project configuration with default settings.
- Configuration Generation: Creates
asena-config
configuration file - Default Values: Provides sensible defaults for quick start
asena init
The config file may need to be edited according to your project.
The Build command handles project deployment preparation.
- Configuration Processing: Reads and processes the Asena configuration file
- Code Generation: Creates a temporary build file that combines all controllers and components
- Import Management: Handles import statements and organizes them based on the project structure. No need to add controllers manually to root file
- Server Integration: Processes the AsenaServer configuration and integrates components
asena build
Configuration can be managed inside the asena-config config file. For a complete list of available options, refer to the Bun build documentation
{
"buildOptions": {
"outdir": "out",
"target": "bun",
"minify": true
}
}
The Dev command enables development mode with enhanced debugging capabilities.
- Build Integration: Automatically builds the project before starting
asena dev start
To start a new Asena project, follow these steps:
- Create a new project:
asena create
- Navigate to project directory:
cd your-project-name
- Start development server:
asena dev start