nika-cli start
Run a Nika application in normal or watch mode.
Choosing what runs
With no arguments the command runs the [build] cmd from .nika.toml. In a
microservice workspace that is the default app's main.go, so you never have
to remember each service's path.
Precedence, highest first:
- an explicit path argument
- the
-a/--appflag workspace.default_appin.nika.toml- an interactive prompt, when the workspace has several apps and no default
nika-cli start # the default app
nika-cli start -a micro-grpc # one specific service
nika-cli start ./apps/api/main.go # an explicit path
Partial app names are accepted when unambiguous, so -a grpc resolves to
micro-grpc. Set the default once with:
See Workspaces and nika-cli app.
Normal mode
Normal mode runs the resolved command once in root and returns when the
process exits:
Watch mode
Watch mode runs the same command and restarts it when an included file changes:
The default watch settings are:
- Root:
. - Command:
go run .in a single-app project, the app'smain.goin a workspace - Delay:
1000milliseconds - Included extension:
.go - Excluded directories:
docs,tmp,vendor,testdata,.git,cache - Excluded file pattern:
^\\.
Watch mode supports pre_cmd, post_cmd, environment variables, included
extensions, excluded files, excluded directories, and exclude regular
expressions — taken from the root [build] section merged with the selected
app's [apps.<name>] override. See Configuration.
Press Ctrl+C to stop; the running process is terminated before the CLI exits.