nika-cli

command module
v0.2.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 25, 2026 License: MIT Imports: 1 Imported by: 0

README

Nika Cli

Nika is a modern backend framework for Go, designed for scalability, clean architecture, and developer productivity.

Commands

Project layouts

Nika projects come in two shapes, and the CLI detects which 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 every command that touches a module asks which service it belongs to, and generates import paths to match. Answer up front with --app to skip the prompt:

nika-cli g res user                 # asks: which microservice?
nika-cli g res user -a api          # generates into apps/api/src/user
nika-cli g res order --app micro-grpc

Inspect and configure the layout:

nika-cli app list          # every service, its src folder and run command
nika-cli app use api       # pick the service `nika-cli start` runs by default
nika-cli app sync          # rewrite .nika.toml to match what is on disk

nika-cli start follows the same rule, so you never have to remember a service's main.go path:

nika-cli start                  # the default app
nika-cli start -a micro-grpc    # one specific service
nika-cli start --watch
AI agent

Configure a provider once per project. The API key is never written to .nika.toml — only the name of the environment variable to read it from.

nika-cli agent init ollama     # local Ollama, no key
nika-cli agent init chatgpt    # OPENAI_API_KEY
nika-cli agent init 9router    # OPENROUTER_API_KEY
nika-cli agent init claude     # ANTHROPIC_API_KEY

For Ollama it inspects your installed models and picks the best one for the agent instead of writing a fixed name:

nika-cli agent models          # what you have, and which can call tools

The agent runs a tool-calling loop: it inspects the project, edits files, scaffolds modules with Nika's own templates, and runs builds to check its work. Any instruction works, not only module generation:

nika-cli agent "add a price field (float64) to the product model and update the DTOs, response and mapper" 
nika-cli agent "run go build ./... and fix what it reports"
nika-cli agent                 # interactive session

Models without native function calling — gemma3, llama3, most older builds — still work: the agent falls back to a JSON protocol automatically. That makes small models usable, not equal; for real editing work prefer qwen2.5-coder:7b or larger, or a cloud provider.

A run that ends claiming files were changed when none were is contradicted rather than reported as success.

Browser console
nika-cli agent start

Opens a page that applies everything you type to the directory the command was started in, streaming each tool call as it happens:

  • a sidebar of independent chats, each with its own history
  • a Chat tab, with a single-line scrolling strip of suggestions
  • a Commands tab — the CLI's generators as forms (resource, controller, service, DTOs, response, migration, seed, migrate, workspace, swagger, build, test), run directly without the model

The server binds to 127.0.0.1 and requires the token in the URL it prints, because it holds write access to your source tree.

nika-cli agent start --port 8080 --open=false
nika-cli agent start --read-only     # inspect without changing anything
Safety

The agent is confined to the project directory: paths that escape it are refused, and run_command only accepts an allowlist (go, gofmt, git status/diff, nika, and other read-only tools). Extend it per project:

[agent]
  max_steps = 25
  allow_commands = ["make", "docker compose ps"]

Getting Started

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

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
aiagent
Package aiagent turns the configured LLM into an agent that can actually change a project.
Package aiagent turns the configured LLM into an agent that can actually change a project.
nikaconf
Package nikaconf owns the on-disk .nika.toml format.
Package nikaconf owns the on-disk .nika.toml format.
Package templates carries the code-generation templates inside the binary.
Package templates carries the code-generation templates inside the binary.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL