Skip to content

Nika CLI

Nika CLI is a Go command-line tool for scaffolding Nika applications, generating resource code, running applications, managing Swagger documentation, and using AI-assisted project changes.

Installation

go install github.com/nika-framework/nika-cli@latest

The CLI requires Go 1.23 or newer. The same installation command works in PowerShell, Command Prompt, macOS, and Linux. If Windows reports errors from internal/start, update to a release containing the Windows process-handling fix and run the command again.

Or build the binary from this repository:

git clone https://github.com/nika-framework/nika-cli
cd nika-cli
go build -o nika-cli

Command reference

Command Purpose Documentation
nika-cli new Create an application from the official template new
nika-cli generate / nika-cli g Generate resources and individual layers generate
nika-cli agent Run the AI agent, or open the browser console agent
nika-cli app Inspect and configure the apps in a workspace app
nika-cli start Run an application, optionally with hot reload start
nika-cli migrate Apply, roll back, or inspect migrations generate
nika-cli seed Run database seeders generate
nika-cli ollema Legacy single-prompt Ollama command ollema
nika-cli swagger Initialize or format Swagger documentation swagger
nika-cli version / nika-cli v Print version information version

The root command also exposes Cobra's completion command. Run nika-cli completion --help for shell-specific instructions.

Project layouts

The CLI supports two layouts and detects which one a project uses from disk:

Layout Modules live in Entry point
Single application src/<module>/ main.go
Microservice workspace apps/<service>/src/<module>/ apps/<service>/main.go

In a workspace, generate, agent, and start all operate on one service at a time. Pass -a/--app to say which, or answer the prompt. See Workspaces.

Typical workflow

Single application:

nika-cli new my-app
cd my-app
go mod tidy
nika-cli g res user -d sqlite
nika-cli start --watch

Microservice workspace:

nika-cli app list                    # see the services
nika-cli g res user -a micro-grpc    # generate into one of them
nika-cli app use api                 # pick the default for `nika-cli start`
nika-cli start --watch

With the AI agent:

nika-cli agent init ollama
nika-cli agent "Create a news module with title, text, image, and tags"
nika-cli agent "add a published_at field to the news model and update the DTOs"
nika-cli agent start                 # or drive it from a chat page

The project must have Go installed. nika-cli new uses the official Git template, generate requires a project-root go.mod, and the ollama provider requires a local Ollama server running a tool-capable model.

  • Configuration - .nika.toml, workspace, build/watch, and AI settings.
  • Workspaces - the microservice layout and how it is detected.
  • Libraries - current library support status.