CLI Reference

Complete command reference for Knowns CLI

Command Reference

Complete reference for all Knowns CLI commands.

Conventions

  • Use --plain when an AI or script needs text output that is easy to parse.
  • Use --json when you want structured output.
  • Use knowns sync when you want generated files and platform artifacts to match the current config.

Initialize and Setup

knowns init

Initializes Knowns in the current project.

bash
knowns init
knowns init my-project --no-wizard
knowns init --force

What init configures:

  • project name
  • git tracking mode (with per-section toggles)
  • semantic search
  • embedding model
OptionDescription
--wizardForce interactive wizard mode
--no-wizardSkip wizard, use defaults
-f, --forceReinitialize (overwrites existing config)

knowns setup

Configures AI tool integrations for an initialized project.

bash
knowns setup              # Interactive platform selector
knowns setup claude       # Claude Code: CLAUDE.md, .mcp.json, skills, hooks
knowns setup opencode     # OpenCode: OPENCODE.md, opencode.json, skills, hooks
knowns setup kiro         # Kiro: .kiro steering/settings, skills, hooks
knowns setup copilot      # GitHub Copilot: .github/copilot-instructions.md
knowns setup all          # All supported platforms

knowns sync

Re-applies .knowns/config.json to the current machine.

bash
knowns sync
knowns sync --skills
knowns sync --instructions
knowns sync --model
knowns sync --instructions --platform claude
knowns sync --instructions --platform cursor
OptionDescription
--skillsSync skills only
--instructionsSync instruction files only
--modelDownload embedding model only
--platformSync specific platform (claude, opencode, kiro, codex, cursor, copilot, agents)

knowns update

Updates the CLI and syncs project artifacts afterward.

bash
knowns update
knowns update --check

Task Commands

knowns task <id> (Shorthand)

View a single task (shorthand for knowns task view).

bash
knowns task <id> [options]
OptionDescription
--plainPlain text output (for AI)

Examples:

bash
knowns task 42 --plain

knowns task create

Create a new task.

bash
knowns task create "Title" [options]
OptionDescription
-d, --descriptionTask description
--acAcceptance criterion (repeatable)
-l, --labelsComma-separated labels
--prioritylow, medium, high
-a, --assigneeAssignee (e.g., @me, @john)
--parentParent task ID for subtasks
--specLink to spec document (e.g., specs/user-auth)
--fulfillsSpec ACs this task fulfills (e.g., AC-1,AC-2)

Examples:

bash
# Basic task
knowns task create "Fix login bug"

# Task with details
knowns task create "Add authentication" \
  -d "Implement JWT auth following @doc/patterns/auth" \
  --ac "User can login" \
  --ac "Session persists" \
  --priority high \
  -l "feature,auth"

# Subtask
knowns task create "Write unit tests" --parent 42

# SDD task linked to spec
knowns task create "Implement search API" \
  --spec specs/semantic-search \
  --fulfills AC-1,AC-2

knowns task list

List all tasks.

bash
knowns task list [options]
OptionDescription
--statusFilter by status
--priorityFilter by priority
--assigneeFilter by assignee
--labelFilter by label
--treeShow as tree hierarchy
--plainPlain text output (for AI)

Examples:

bash
knowns task list --plain
knowns task list --status in-progress --assignee @me
knowns task list --tree --plain

knowns task view

View a single task (full command form).

bash
knowns task view <id> [options]
OptionDescription
--plainPlain text output (for AI)

knowns task edit

Edit an existing task.

bash
knowns task edit <id> [options]
OptionDescription
-t, --titleNew title
-d, --descriptionNew description
-s, --statustodo, in-progress, in-review, blocked, done
--prioritylow, medium, high
-a, --assigneeAssignee
-l, --labelsLabels (replaces existing)
--acAdd acceptance criterion
--check-acCheck criterion (1-indexed)
--uncheck-acUncheck criterion
--remove-acRemove criterion
--planSet implementation plan
--notesSet implementation notes
--append-notesAppend to notes

Examples:

bash
# Change status and assignee
knowns task edit 42 -s in-progress -a @me

# Check acceptance criteria
knowns task edit 42 --check-ac 1 --check-ac 2

# Add implementation plan
knowns task edit 42 --plan $'1. Research\n2. Implement\n3. Test'

# Add notes progressively
knowns task edit 42 --append-notes "Completed auth middleware"

knowns task validate

Validate a task file format.

bash
knowns task validate <id> [options]

knowns task repair

Repair a corrupted task file.

bash
knowns task repair <id> [options]

Documentation Commands

knowns doc <path> (Shorthand)

View a document (shorthand for knowns doc view).

bash
knowns doc <name-or-path> [options]
OptionDescription
--plainPlain text output (for AI)
--smartAuto-handle small/large docs (recommended)
--infoShow document stats (size, tokens, headings)
--tocShow table of contents only
--section <title>Show specific section by heading title or number

Examples:

bash
knowns doc "README" --plain
knowns doc "patterns/auth" --plain

# Large document workflow with --smart (recommended)
knowns doc "README" --plain --smart
# Small doc → returns full content
# Large doc → returns stats + TOC

# Then read specific section
knowns doc "README" --section "2. Installation" --plain
knowns doc "README" --section "2" --plain  # By number

# Manual control
knowns doc "README" --info --plain      # Check size first
knowns doc "README" --toc --plain       # Get TOC

knowns doc create

Create a new document.

bash
knowns doc create "Title" [options]
OptionDescription
-d, --descriptionDocument description
-t, --tagsComma-separated tags
-f, --folderFolder path (e.g., patterns, architecture/api)

Examples:

bash
# Simple doc
knowns doc create "API Guidelines" -d "REST API conventions"

# Doc in folder
knowns doc create "Auth Pattern" \
  -d "JWT authentication pattern" \
  -t "patterns,security" \
  -f patterns

knowns doc list

List all documents.

bash
knowns doc list [path] [options]
ArgumentDescription
[path]Filter by folder path (e.g., guides/, patterns/)
OptionDescription
--tagFilter by tag
--plainPlain text output (tree format, token-efficient)

knowns doc edit

Edit a document.

bash
knowns doc edit <name-or-path> [options]
OptionDescription
-t, --titleNew title
--tagsNew tags
-c, --contentReplace content (or section content if --section used)
-a, --appendAppend to content
--section <title>Target section to replace (use with -c)
--content-file <path>Replace content with file contents
--append-file <path>Append file contents to document

Examples:

bash
# Edit content directly
knowns doc edit "README" -c "New content here"

# Append content
knowns doc edit "README" -a "## New Section"

# Edit specific section only (context-efficient!)
knowns doc edit "README" --section "2. Installation" -c "New section content"
knowns doc edit "README" --section "2" -c "New content"  # By number

# Use file for long content (useful on Windows)
knowns doc edit "README" --content-file ./new-content.md
knowns doc edit "README" --append-file ./additional-section.md

knowns doc search-in

Search text within a specific document.

bash
knowns doc search-in <name> <query> [options]
OptionDescription
--plainPlain text output (for AI)
-i, --ignore-caseCase insensitive search

knowns doc replace

Replace text in a document.

bash
knowns doc replace <name> <old-text> <new-text> [options]
OptionDescription
-a, --allReplace all occurrences (default: first only)

knowns doc replace-section

Replace an entire section by its header.

bash
knowns doc replace-section <name> <header> <content>

Time Tracking Commands

knowns time start

Start tracking time on a task.

bash
knowns time start <task-id>

knowns time stop

Stop the current timer.

bash
knowns time stop

knowns time pause / knowns time resume

Pause or resume the current timer.

bash
knowns time pause
knowns time resume

knowns time status

Show current timer status.

bash
knowns time status

knowns time add

Add manual time entry.

bash
knowns time add <task-id> <duration> [options]
OptionDescription
-n, --noteNote for entry
-d, --dateDate (YYYY-MM-DD)

Examples:

bash
knowns time add 42 2h -n "Code review"
knowns time add 42 30m -d "2025-01-15"

knowns time report

Generate time report.

bash
knowns time report [options]
OptionDescription
--fromStart date (YYYY-MM-DD)
--toEnd date (YYYY-MM-DD)
--by-labelGroup by label
--csvCSV output

Search Commands

knowns search

Search tasks, docs, and memory entries.

bash
knowns search <query> [options]
OptionDescription
--typetask, doc, or memory
--statusFilter tasks by status
--priorityFilter tasks by priority
--keywordKeyword-only mode
--plainPlain text output
bash
knowns search --status-check    # Check search readiness
knowns search --reindex         # Rebuild index

knowns retrieve

Build a structured context pack from docs, tasks, and memories.

bash
knowns retrieve "query" --json
knowns retrieve "auth flow" --source-types doc,task --json

knowns resolve

Resolve a semantic reference and traverse related entities.

bash
knowns resolve <semantic-ref> [flags]
OptionDescription
--depthMax traversal hops, 1-3 (default 1)
--directionTraversal direction: outbound (default), inbound, or both
--relationFilter by relation kinds (comma-separated)
--typeFilter result entities by kind (comma-separated)

Code Intelligence

LSP Management

bash
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 file
  • find — search symbols by name pattern with optional body/depth
  • definition — go to definition
  • references — find all references
  • implementations — find implementations of interface
  • diagnostics — get compile errors/warnings
  • rename — rename symbol across workspace
  • replace — regex/literal text replacement
  • replace_body — replace entire symbol body
  • insert — insert code before/after a symbol
  • delete — safe delete with reference check

Template Commands

knowns template list

List all available templates.

bash
knowns template list [options]

knowns template view

View template details and variables. Shorthand: knowns template <name>.

bash
knowns template view <name> [options]
knowns template <name> [options]  # shorthand

knowns template run

Run a template to generate code (interactive prompts for variables).

bash
knowns template run <name> [options]
OptionDescription
--dry-runPreview output without writing files
-f, --forceOverwrite existing files

knowns template create

Create a new template scaffold.

bash
knowns template create <name> [options]
OptionDescription
-d, --description <desc>Template description

Import Commands

Import docs and templates from external sources (Git, npm, or local).

knowns import add

Add a new import source. Shorthand: knowns import <source>.

bash
knowns import add <source> [options]
knowns import <source> [options]  # shorthand
Source FormatExample
Git URLhttps://github.com/user/repo
Git shorthandgithub:user/repo, gitlab:user/repo
NPM packagenpm:package-name
Local folder./path/to/folder
OptionDescription
-n, --name <name>Custom name for the import
-t, --type <type>Force source type: git, npm, local
-r, --ref <ref>Git branch/tag or npm version
--include <patterns...>Include patterns (e.g., docs/**/*.md)
--exclude <patterns...>Exclude patterns
--linkSymlink local imports (instead of copy)
-f, --forceOverwrite existing import
--dry-runPreview without writing

knowns import list

List all configured imports.

bash
knowns import list [options]

knowns import sync

Update imports from their sources.

bash
knowns import sync [name] [options]
OptionDescription
-f, --forceOverwrite locally modified files
--dry-runPreview changes

knowns import remove

Remove an import configuration.

bash
knowns import remove <name> [options]
OptionDescription
--deleteAlso delete imported files

Memory Commands

Persistent memory lets AI keep reusable patterns, decisions, and conventions across sessions.

knowns memory list

bash
knowns memory list [options]
OptionDescription
--layerFilter by project or global
--categoryFilter by category
--tagFilter by tag
--plainPlain text output (for AI)

knowns memory view

bash
knowns memory view <id> [options]

knowns memory add

bash
knowns memory add [options]
OptionDescription
-t, --titleMemory title
-c, --contentMemory content
--layerproject (default) or global
--categoryCategory such as pattern or decision
--tagsComma-separated tags

knowns memory promote / knowns memory demote

bash
knowns memory promote <id>
knowns memory demote <id>

Other Commands

knowns config

Manage project configuration.

bash
# Interactive feature toggle UI
knowns config toggle

# Get a config value
knowns config get defaultAssignee --plain

# Set a config value
knowns config set defaultAssignee "@john"

# Set feature toggles
knowns config set embedding true
knowns config set lsp true
knowns config set enableChatUI true
knowns config set gitTracking.tasks true
knowns config set gitTracking.memories false

# List all config
knowns config list

knowns browser

Launch the local Web UI and AI Chat.

bash
knowns browser [flags]
OptionDescription
--devEnable development mode (verbose logging)
--openOpen browser after starting
--no-openDon't automatically open browser
--portHTTP server port (default: 6420; tries next ports if busy)
--projectProject path to open directly
--restartRestart server if already running
--scanComma-separated directories to scan for projects
--tunnelExpose via a Cloudflare Quick Tunnel (requires cloudflared)
--watchEnable file watcher for auto-indexing on code changes

knowns tunnel

Manage Cloudflare Quick Tunnels for the local server.

bash
knowns tunnel status [--port <port>]
knowns tunnel stop [--port <port>]

knowns validate

Run validation checks.

bash
knowns validate --plain
knowns validate --scope docs --plain
knowns validate --scope sdd --plain
knowns validate --strict --plain

knowns audit

Inspect the MCP tool call audit trail.

bash
knowns audit recent [--limit 50] [--tool <name>] [--result success|error|denied]
knowns audit stats [--project <path>] [--tool <name>]

knowns status

Show project readiness summary.

bash
knowns status

knowns board

Show the Kanban board in the terminal.

bash
knowns board

knowns model

Manage embedding models.

bash
knowns model list
knowns model download multilingual-e5-small
knowns model set multilingual-e5-small
knowns model status

knowns mcp

Start the MCP server.

bash
knowns mcp --stdio
knowns mcp setup

knowns runtime

Manage runtime adapters.

bash
knowns runtime install <runtime>
knowns runtime uninstall <runtime>
knowns runtime status

knowns guidelines

Display Knowns usage guidelines for AI agents.

bash
knowns guidelines --plain
knowns guidelines --compact
knowns guidelines --search "time tracking"
knowns guidelines --mode mcp --plain

knowns agents guideline

Output modular guidelines to stdout. AI agents call this at session start.

bash
knowns agents guideline
knowns agents guideline --compact
knowns agents guideline --stage creation
knowns agents guideline --stage execution
knowns agents guideline --stage completion
knowns agents guideline --core
knowns agents guideline --commands

Output Formats

--plain

Plain text output optimized for AI consumption. Always use this when working with AI assistants.

bash
knowns task 42 --plain
knowns doc list --plain
knowns search "auth" --plain

Multi-line Input

Bash / Zsh

bash
knowns task edit 42 --plan $'1. Step one\n2. Step two\n3. Step three'

PowerShell

PowerShell
knowns task edit 42 --notes "Line 1`nLine 2`nLine 3"

Heredoc (long content)

bash
knowns task edit 42 --plan "$(cat <<EOF
1. Research existing patterns
2. Design solution
3. Implement
4. Write tests
5. Update documentation
EOF
)"