Documentation
Source Map
Complete high-level map of packages/nikcli/src with file-level entrypoints.
Top-Level Modules
src/index.ts | CLI entrypoint & command registration. |
src/cli/ | CLI commands, UI, networking, TUI. |
src/session/ | Session lifecycle, prompts, messages, compaction. |
src/tool/ | Tool definitions + registry. |
src/server/ | HTTP + SSE server and routes. |
Directory Index
| Directory | Responsibility |
|---|---|
acp | Agent Client Protocol implementation. |
agent | Agent definitions, prompts, and generation. |
auth | Credential storage and auth flows. |
bun | Bun process helpers. |
bus | Event bus and global bus. |
cli | CLI commands, UI, network, TUI. |
command | Command templates and execution. |
config | Config schema and parsing. |
docs | Local docs library and context. |
env | Environment access helpers. |
file | Filesystem utilities and watchers. |
flag | Environment flag parsing. |
format | Formatting utilities. |
global | Global paths and cache. |
id | Identifier helpers. |
ide | IDE integration hooks. |
installation | Installer detection + upgrades. |
lsp | Language server integration. |
mcp | Model Context Protocol integration. |
patch | Patch helpers for apply_patch. |
permission | Permission model and rules. |
plugin | Plugin loading and hooks. |
project | Project discovery and instance context. |
provider | Provider SDK adapters and models. |
pty | PTY integration. |
question | Question tooling. |
rag | RAG indexing/search/storage. |
scheduler | Scheduled tasks. |
server | HTTP server, routes, SSE. |
session | Session lifecycle and messages. |
share | Session sharing utilities. |
shell | Shell integration helpers. |
skill | Skill discovery and loading. |
snapshot | Snapshot/diff tracking. |
storage | Persistent storage layer. |
tool | Tool definitions + registry. |
util | Utility helpers. |
worktree | Worktree helpers. |
CLI
Primary command implementations live in src/cli/cmd.
TUI
Default command is $0 [project] from src/cli/cmd/tui/thread.ts.
Core Runtime
src/agent/ | Agent definitions and generation. |
src/permission/ | Permission prompts and rules. |
src/project/ | Project discovery + instance context. |
src/storage/ | Persistent JSON storage + migrations. |
Server
Routes are organized by capability in src/server/routes.
Provider & Models
Model metadata is cached from models.dev and merged with config.
Tools & Docs
Tool descriptions live in src/tool/*.txt and are wired into the registry.