Technical notes for contributors working on the current Go codebase.
| Layer | Technology |
|---|---|
| Runtime | Go |
| CLI | Cobra |
| Storage | File-based .knowns/ data |
| Web server | Go HTTP server |
| Web UI | React app embedded into the binary |
| AI integration | MCP server + generated instruction files |
| Search | Keyword + optional semantic search (ONNX Runtime + embedding models) |
| Code intelligence | AST-based indexing (Go, TypeScript, JavaScript, Python) |
Main repo structure:
cmd/knowns/ CLI entrypoint
internal/cli/ Cobra commands (including update, download_setup)
internal/models/ Domain models and config structs
internal/storage/ Persistence for tasks, docs, versions, config, memories
internal/server/ HTTP server, routes, browser backend
internal/mcp/ MCP server implementation
internal/mcp/handlers/ MCP tool handler implementations (code.go, search.go, etc.)
internal/search/ Hybrid/semantic/keyword search engine
engine.go, chunker.go, index.go, vecstore.go, sqlite_vecstore.go, sync.go (runtime queue integration), types.go
internal/validate/ Validation engine for refs and integrity
internal/registry/ Global project registry (workspace discovery)
internal/runtimequeue/ Shared background work queue for indexing, watch, reindex jobs
Routes by project, stores state under <project>/.knowns/runtime/queue.json
internal/runtimememory/ Runtime memory hook injection for session context
internal/runtimeinstall/ Runtime installation helpers (Claude Code, Codex, Kiro, OpenCode)
internal/codegen/ Code generation and skill syncing
internal/util/ Utilities (version, update notifier, install metadata)
install/ Platform install scripts (install.sh, install.ps1, uninstall.sh, uninstall.ps1)
ui/ React UI source and embedded assets
tests/ End-to-end and integration coverage
knowns browserstarts the local web server- default port is
6420unless overridden bysettings.serverPortor--port; fallback tries 6420, 6421, 6422 - the browser only auto-opens when
--openis passed - auto-registers the project in the global registry on startup
- auto-ingests code if semantic search is configured but no code chunks exist
knowns synchandles instruction-file and skill syncingknowns agents --syncremains as a compatibility path for instruction files- platform filtering is done with
--platformorsettings.platforms
knowns search <query>performs searchknowns retrieve <query>retrieves ranked context with citationsknowns search --reindexrebuilds the index (routes through runtime queue if daemon is running)knowns search --status-checkshows semantic-search statusknowns search --install-runtimedownloads ONNX Runtime; install scripts invoke it automatically after binary installknowns search --setupenables semantic search after ONNX and model are ready- Semantic search requires ONNX Runtime (
~/.knowns/lib/) and an embedding model (~/.knowns/models/) - Search index is stored in
.knowns/.search/as a SQLite database
knowns updatedetects install method (Homebrew/npm/script) and runs the appropriate upgrade- For script-managed installs (
~/.knowns/bin/), downloads and replaces the binary directly - After update, runs
knowns syncto refresh MCP configs (.mcp.json,.kiro/settings/mcp.json,opencode.json) internal/util/update_notifier.goprovides background version checking
Project config is defined in internal/models/config.go.
Important fields include:
name,id,createdAtsettings.defaultAssignee,settings.defaultPriority,settings.defaultLabelssettings.statuses,settings.statusColors,settings.visibleColumnssettings.semanticSearchsettings.serverPortsettings.platformssettings.autoSyncOnUpdatesettings.enableChatUIsettings.opencodeServer,settings.opencodeModels
Supported platform IDs: claude-code, opencode, codex, kiro, gemini, copilot, agents.
- Root commands are registered under
internal/cli/ - command help is the source of truth for public syntax
- shorthand behavior exists for some groups, for example
knowns task <id>andknowns doc <path> - prefer updating docs from actual
knowns ... --helpoutput to avoid drift
make build
make dev
make test
make test-e2e
make lint
make uiUse go run ./cmd/knowns --help and subcommand help while updating docs or CLI behavior.
This repo has accumulated older Node/TypeScript-era docs. If code and docs disagree, trust the Go implementation and CLI help first, then update docs to match.
- Architecture - Higher-level system overview
- Configuration - Runtime config fields
- Command Reference - Current CLI surface