Animated Circular Progress Bar0
Font.Lokio
Get Started

Getting Started

Panduan untuk memulai menggunakan Lokio CLI


Getting Started#

Panduan untuk memulai menggunakan Lokio CLI.

Installation#

Development (Local)#

# Clone atau download project
cd lokio.cli
 
# Install dependencies
bun install
 
# Link package secara global
bun run link
 
# Verify installation
lokio --help
bun run unlink

First Steps#

1. Initialize Project#

Jalankan init di project Anda untuk setup Lokio:

lokio init

Ini akan membuat struktur berikut:

project/
├── lokio.yaml              # Konfigurasi project
└── lokio/
    ├── configs.yaml        # Daftar templates
    └── templates/          # Folder template files
        └── example.lokio     # Contoh template

2. Check Templates#

Lihat template yang tersedia:

lokio list

Output:

📄 example
   Description: Example React component template
   Output: src/components/<%= name %>.tsx
   Parameters: 1
   - name (string, required)

3. Generate Code#

Generate code dari template:

lokio generate

Flow:

  1. Pilih template dari list
  2. Isi parameters yang ditanyakan
  3. File akan di-generate ke output path

Project Structure#

Setelah lokio init, struktur project:

project/
├── lokio.yaml                    # Project configuration
└── lokio/
    ├── configs.yaml              # Templates configuration
    └── templates/                # Template files (.lokio)
        ├── example.lokio
        ├── component.lokio
        └── hook.lokio

lokio.yaml#

project:
  name: "my-project"
  version: "1.0.0"

lokio/configs.yaml#

templates:
  - name: "example"
    description: "Example React component template"
    path: "example.lokio"
    output: "src/components/<%= name %>.tsx"
    parameters:
      - name: "name"
        type: "string"
        required: true
        prompt: "Component name"

Next Steps#