CLI Reference
Practical reference for Knowns command groups.
Command Reference
Use knowns <command> --help for the exact syntax accepted by the current binary. This page is the practical reference for the main command groups and how they are typically used.
Conventions
- Use
--plainwhen an AI or script needs text output that is easy to parse. - Use
--jsonwhen you want structured output. - Use
knowns syncwhen you want generated files and platform artifacts to match the current config.
Initialize and sync
knowns init
Initializes Knowns in the current project.
knowns init
knowns init my-project --no-wizard
knowns init --force
What init configures:
- project name
- git tracking mode (with per-section toggles)
- lightweight project instruction shims such as
CLAUDE.mdandAGENTS.md - semantic search
- embedding model
knowns init creates lightweight project shims, but leaves MCP configs, skills, and runtime hooks to knowns setup.
knowns setup
Configures AI tool integrations for an initialized project.
knowns setup --global # Interactive user-level platform selector
knowns setup claude --global # Claude user-level MCP/skills/hooks
knowns setup codex --global # Codex user-level MCP/skills/hooks
knowns setup all --global # All supported platforms at user scope
knowns setup agents # Lightweight repo-local agent shims only
knowns setup # Interactive project-level platform selector
knowns setup claude # Project-level Claude files
knowns setup codex # Project-level Codex files
Use --global for normal personal assistant setup. It updates user-level MCP config, skills, and runtime hooks, so the integration follows you across repositories. Use project-level setup only when you intentionally want repo-local platform artifacts.
knowns sync
Re-applies .knowns/config.json to the current machine.
knowns sync
knowns sync --skills
knowns sync --instructions
knowns sync --model
knowns sync --instructions --platform claude
knowns sync --instructions --platform cursor
Typical uses:
- after cloning a repo
- after updating Knowns
- after changing selected platforms
- after changing local generated artifacts manually and wanting to restore them
knowns update
Updates the CLI and syncs project artifacts afterward.
knowns update
knowns update --check
knowns settings
Opens the interactive project settings center.
knowns settings
knowns settings --global
Use knowns settings for human-friendly project edits: project name, git tracking, AI platforms, search, code intelligence, Browser/Chat UI, and maintenance guidance. In Search settings, Local ONNX models are listed with downloaded/not downloaded status; selecting a missing model can download it before saving. Use knowns settings --global for defaults reused by future knowns init runs. Use knowns config get/set/list/reset when you need scriptable config access.
Tasks
Create
knowns task create "Title" -d "Description"
knowns task create "Add auth" \
--ac "User can login" \
--ac "JWT token returned" \
--priority high \
-l auth
Common options:
-d, --description--ac-l, --label--priority-a, --assignee--parent
View and list
knowns task list --plain
knowns task list --status in-progress --assignee @me
knowns task <id> --plain
knowns task view <id> --plain
Edit
knowns task edit <id> -s in-progress
knowns task edit <id> --check-ac 1
knowns task edit <id> --append-notes "Completed middleware"
knowns task edit <id> --plan $'1. Research\n2. Implement\n3. Test'
Common edit operations:
- change title/description
- update status/priority/assignee
- add, check, uncheck, or remove acceptance criteria
- replace or append implementation notes
- set an implementation plan
Docs
Create
knowns doc create "Architecture" -d "System overview" -f architecture
knowns doc create "Auth Pattern" -d "JWT auth pattern" -f patterns -t auth -t security
View and list
knowns doc list --plain
knowns doc "architecture/auth" --plain
knowns doc "architecture/auth" --info --plain
knowns doc "architecture/auth" --toc --plain
knowns doc "architecture/auth" --section "2" --plain
Edit
knowns doc edit "architecture/auth" -a "\n\n## Notes\n..."
knowns doc edit "architecture/auth" -c "# New content"
knowns doc edit "architecture/auth" --section "2" -c "## 2. Updated section"
Search, retrieve, and resolve
Search
knowns search "authentication" --plain
knowns search "jwt" --type doc --plain
knowns search "jwt" --keyword --plain
knowns search --status-check
knowns search --reindex
Modes:
- default: hybrid
--keyword: keyword-only
Retrieve
knowns retrieve "how auth works" --json
knowns retrieve "auth flow" --source-types doc,task --json
Use retrieve when you want a ranked context pack rather than a flat result list.
Resolve
knowns resolve "@doc/specs/auth{implements}" --plain
knowns resolve "@doc/specs/auth{depends}" --direction inbound --depth 2 --plain
Use resolve to traverse structural relationships between docs, tasks, and other entities.
Memory
knowns memory add "We use repository pattern" --category decision
knowns memory list --plain
knowns memory <id> --plain
knowns memory edit <id> --append "More detail"
Memory is useful for persistent project-level or global knowledge that AI should recall later.
Decisions
knowns decision create "Use Postgres for metadata"
knowns decision list --plain
knowns decision get <id> --plain
knowns decision link <id> --doc architecture/storage
knowns decision supersede <old-id> <new-id>
Use decisions for durable architectural choices that may later be superseded rather than edited in place.
Templates
knowns template list
knowns template get <name>
knowns template run <name>
knowns template create <name>
Use templates for repeatable scaffolding and standardized output.
Code intelligence
LSP management
knowns lsp list # Show supported languages and their status
knowns lsp install <language> # Download and install an LSP server
knowns lsp cleanup # Remove old LSP server versions
Knowns auto-detects project languages and checks for LSP binaries. If a binary is missing, knowns lsp list shows install guidance.
Code operations (via MCP)
Code intelligence is LSP-based and accessed through the MCP code tool:
symbols— list symbols in a filefind— search symbols by name pattern with optional body/depthdefinition— go to definitionreferences— find all referencesimplementations— find implementations of interfacediagnostics— get compile errors/warningsrename— rename symbol across workspacereplace— regex/literal text replacementreplace_body— replace entire symbol bodyinsert— insert code before/after a symboldelete— safe delete with reference check
Code index inspection (CLI)
knowns code symbols --plain
knowns code search "AuthService" --plain
knowns code deps --plain
Use CLI code commands for inspecting indexed symbol/dependency data. Use the MCP code tool for structured navigation and edits.
Validation
knowns validate --plain
knowns validate --scope docs --plain
knowns validate --scope sdd --plain
knowns validate --strict --plain
Use validation before considering documentation or workflow changes complete.
Time tracking
knowns time start <task-id>
knowns time stop
knowns time add <task-id> 1h30m -n "Pair programming"
knowns time report
Browser UI
knowns browser
knowns browser --open
knowns browser --port 6421
Project status and audit
knowns status
knowns audit recent
knowns audit stats
Use status for project readiness and audit to inspect recent MCP tool calls.
Agent and guidance files
knowns setup
knowns sync --skills
knowns sync --instructions
Use knowns setup to generate AI integration files, or knowns sync to refresh them.
Model management
knowns model add <model-name>
knowns model list
knowns model download multilingual-e5-small
knowns model set multilingual-e5-small
knowns model status
knowns model remove <id>
Providers and runtime adapters
knowns provider list
knowns provider add --id openai --name "OpenAI" --api-base https://api.openai.com/v1 --api-key <key>
knowns provider test <id>
knowns provider remove <id>
knowns runtime status
knowns runtime install codex
knowns runtime ps
knowns runtime logs
knowns runtime stop
knowns runtime uninstall codex
knowns runtime-memory hook
knowns runtime-memory hook --json
Use providers for API-backed embedding providers. Use runtime commands to install and inspect runtime memory adapters and the shared runtime.
The default hook output is plain prompt context for runtime adapters. Each injected memory includes inline score/trust metadata, for example score=0.92; trust=active, so the assistant can weigh supplemental context.
Use knowns runtime-memory hook --json when a caller needs structured metadata instead of prompt text. JSON output includes retrieval item scores and capture trust metadata such as capture.score, capture.threshold, capture.trusted, and review capture.matches when review is required.
Tunnels
knowns tunnel status
knowns tunnel stop
Use tunnel commands to inspect or stop Cloudflare Quick Tunnels created for local server sharing.
Imports
knowns import add <name> <source>
knowns import sync
knowns import list
Use imports when you want to bring in docs or templates from git, local, or package sources.
Lệnh
Dùng knowns <command> --help để xem syntax chính xác. Trang này là tổng quan thực dụng.
Conventions
--plainkhi AI hoặc script cần text output dễ parse--jsonkhi cần structured outputknowns synckhi muốn generated files khớp lại với config
Init và sync
knowns init
knowns init my-project --no-wizard
knowns init --force
knowns setup --global
knowns setup claude --global
knowns setup codex --global
knowns setup all --global
knowns setup agents
knowns setup
knowns setup claude
knowns setup codex
knowns sync
knowns sync --skills
knowns sync --instructions
knowns sync --model
knowns update
knowns update --check
knowns settings
knowns settings --global
knowns init tạo .knowns/, config, git tracking, semantic setup, và lightweight project instruction shims như CLAUDE.md/AGENTS.md. Runtime-critical AI guidance nằm trong MCP initial và on-demand help. Dùng knowns setup <target> --global cho personal assistant setup thông thường vì nó update user-level MCP config, skills, và runtime hooks trên nhiều repository. Chỉ dùng knowns setup <target> khi bạn chủ ý muốn project-level integration artifacts trong repo. Dùng knowns setup agents khi chỉ muốn repo-local agent shims.
knowns settings mở settings center để chỉnh project name, git tracking, AI platforms, search, code intelligence, Browser/Chat UI, và maintenance guidance. Trong Search settings, Local ONNX models hiển thị trạng thái downloaded/not downloaded; nếu chọn model chưa download, Knowns có thể hỏi xác nhận rồi download trước khi lưu. knowns settings --global lưu defaults cho các lần knowns init sau. Dùng knowns config get/set/list/reset khi cần thao tác config bằng script hoặc agent.
Task
knowns task create "Title" -d "Description"
knowns task create "Add auth" \
--ac "User can login" \
--ac "JWT token returned" \
--priority high \
-l auth
knowns task list --plain
knowns task list --status in-progress --assignee @me
knowns task <id> --plain
knowns task edit <id> -s in-progress
knowns task edit <id> --check-ac 1
knowns task edit <id> --append-notes "Completed middleware"
knowns task edit <id> --plan '1. Research\n2. Implement\n3. Test'
Doc
knowns doc create "Architecture" -d "System overview" -f architecture
knowns doc create "Auth Pattern" -d "JWT auth pattern" -f patterns -t auth -t security
knowns doc list --plain
knowns doc "architecture/auth" --plain
knowns doc "architecture/auth" --info --plain
knowns doc "architecture/auth" --toc --plain
knowns doc "architecture/auth" --section "2" --plain
knowns doc edit "architecture/auth" -a "\n\n## Notes\n..."
knowns doc edit "architecture/auth" -c "# New content"
knowns doc edit "architecture/auth" --section "2" -c "## 2. Updated section"
Search, retrieve, resolve
knowns search "authentication" --plain
knowns search "jwt" --type doc --plain
knowns search "jwt" --keyword --plain
knowns search --status-check
knowns search --reindex
knowns retrieve "how auth works" --json
knowns retrieve "auth flow" --source-types doc,task --json
knowns resolve "@doc/specs/auth{implements}" --plain
knowns resolve "@doc/specs/auth{depends}" --direction inbound --depth 2 --plain
Memory
knowns memory add "We use repository pattern" --category decision
knowns memory list --plain
knowns memory <id> --plain
knowns memory edit <id> --append "More detail"
Decision
knowns decision create "Use Postgres for metadata"
knowns decision list --plain
knowns decision get <id> --plain
knowns decision link <id> --doc architecture/storage
knowns decision supersede <old-id> <new-id>
Decision dùng cho architectural choices cần bền vững và có thể supersede về sau thay vì sửa đè lịch sử.
Templates
knowns template list
knowns template get <name>
knowns template run <name>
knowns template create <name>
Code intelligence
Quản lý LSP
knowns lsp list # Hiển thị ngôn ngữ được hỗ trợ và trạng thái
knowns lsp install <language> # Tải và cài đặt LSP server
knowns lsp cleanup # Xóa các phiên bản LSP server cũ
Knowns tự động phát hiện ngôn ngữ trong project và kiểm tra LSP binaries. Nếu thiếu binary, knowns lsp list sẽ hiển thị hướng dẫn cài đặt.
Code operations (qua MCP)
Code intelligence dựa trên LSP và được truy cập qua MCP code tool:
symbols— liệt kê symbols trong filefind— tìm symbols theo name pattern, có thể kèm body/depthdefinition— đi tới definitionreferences— tìm tất cả referencesimplementations— tìm implementations của interfacediagnostics— lấy compile errors/warningsrename— đổi tên symbol trong toàn workspacereplace— thay text bằng regex/literalreplace_body— thay toàn bộ body của symbolinsert— chèn code trước/sau một symboldelete— xóa an toàn với kiểm tra references
Inspect code index bằng CLI
knowns code symbols --plain
knowns code search "AuthService" --plain
knowns code deps --plain
Dùng CLI code commands để inspect indexed symbols/dependencies. Dùng MCP code tool cho navigation và edits có cấu trúc.
Validation
knowns validate --plain
knowns validate --scope docs --plain
knowns validate --scope sdd --plain
knowns validate --strict --plain
Time tracking
knowns time start <task-id>
knowns time stop
knowns time add <task-id> 1h30m -n "Pair programming"
knowns time report
Browser UI
knowns browser
knowns browser --open
knowns browser --port 6421
Project status và audit
knowns status
knowns audit recent
knowns audit stats
Dùng status để xem project readiness, và audit để inspect MCP tool calls gần đây.
Guidance files
knowns setup
knowns sync --skills
knowns sync --instructions
Model
knowns model add <model-name>
knowns model list
knowns model download multilingual-e5-small
knowns model set multilingual-e5-small
knowns model status
knowns model remove <id>
Provider và runtime adapters
knowns provider list
knowns provider add --id openai --name "OpenAI" --api-base https://api.openai.com/v1 --api-key <key>
knowns provider test <id>
knowns provider remove <id>
knowns runtime status
knowns runtime install codex
knowns runtime ps
knowns runtime logs
knowns runtime stop
knowns runtime uninstall codex
knowns runtime-memory hook
knowns runtime-memory hook --json
Dùng provider commands cho API-backed embedding providers. Dùng runtime commands để install và inspect runtime memory adapters/shared runtime.
Default hook output là plain prompt context cho runtime adapters. Mỗi injected memory có inline score/trust metadata, ví dụ score=0.92; trust=active, để assistant tự cân nhắc supplemental context.
Dùng knowns runtime-memory hook --json khi caller cần structured metadata thay vì prompt text. JSON output có retrieval item scores và capture trust metadata như capture.score, capture.threshold, capture.trusted, và review capture.matches khi cần review.
Tunnel
knowns tunnel status
knowns tunnel stop
Dùng tunnel commands để inspect hoặc stop Cloudflare Quick Tunnels cho local server sharing.
Import
knowns import add <name> <source>
knowns import sync
knowns import list