CLI Reference

Complete command reference for Knowns CLI

16 min read

Command Reference

Complete reference for all Knowns CLI commands.

Task Commands

knowns task <id> (Shorthand)

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

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

Examples:

knowns task 42 --plain

knowns task create

Create a new task.

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

Examples:

# 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

knowns task list

List all tasks.

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:

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).

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

knowns task validate

Validate a task file format.

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

knowns task repair

Repair a corrupted task file.

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

knowns task edit

Edit an existing task.

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:

# 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"

Documentation Commands

knowns doc <path> (Shorthand)

View a document (shorthand for knowns doc view).

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:

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.

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

Examples:

# 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.

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)

Examples:

# List all docs
knowns doc list --plain
 
# List docs in specific folder
knowns doc list "guides/" --plain
knowns doc list "patterns/" --plain
 
# Filter by tag
knowns doc list --tag architecture --plain

knowns doc view

View a document (full command form).

knowns doc view <name-or-path> [options]
OptionDescription
--plainPlain text output
--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:

knowns doc view "auth-pattern" --plain
knowns doc view "patterns/auth-pattern" --plain
knowns doc view "README" --info --plain      # Check size first
knowns doc view "README" --toc --plain       # Get TOC
knowns doc view "README" --section "2" --plain  # Read section

knowns doc edit

Edit a document.

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:

# 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 validate

Validate a documentation file format.

knowns doc validate <name> [options]
OptionDescription
--plainPlain text output (for AI)

knowns doc repair

Repair a corrupted documentation file.

knowns doc repair <name> [options]
OptionDescription
--plainPlain text output (for AI)

knowns doc search-in

Search text within a specific document.

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

Examples:

knowns doc search-in "README" "authentication" --plain
knowns doc search-in "patterns/auth" "JWT" -i

knowns doc replace

Replace text in a document.

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

Examples:

# Replace first occurrence
knowns doc replace "README" "old-api" "new-api"
 
# Replace all occurrences
knowns doc replace "README" "v1" "v2" --all

knowns doc replace-section

Replace an entire section by its header.

knowns doc replace-section <name> <header> <content> [options]
OptionDescription
--plainPlain text output (for AI)

Examples:

knowns doc replace-section "README" "## Installation" $'Run the following:\n\n```bash\nnpm install knowns\n```'

Time Tracking Commands

knowns time start

Start tracking time on a task.

knowns time start <task-id>

knowns time stop

Stop the current timer.

knowns time stop

knowns time pause / knowns time resume

Pause or resume the current timer.

knowns time pause
knowns time resume

knowns time status

Show current timer status.

knowns time status

knowns time add

Add manual time entry.

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

Examples:

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

knowns time report

Generate time report.

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 and documentation.

knowns search <query> [options]
OptionDescription
--typetask or doc
--statusFilter tasks by status
--priorityFilter tasks by priority
--plainPlain text output

Template Commands

knowns template list

List all available templates.

knowns template list [options]
OptionDescription
--plainPlain text output (for AI)

knowns template view

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

knowns template view <name> [options]
knowns template <name> [options]  # shorthand
OptionDescription
--plainPlain text output (for AI)

Examples:

knowns template view component --plain
knowns template component --plain  # shorthand

knowns template run

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

knowns template run <name> [options]
OptionDescription
--dry-runPreview output without writing files
-f, --forceOverwrite existing files
--plainPlain text output (for AI)

Examples:

# Interactive mode (prompts for variables)
knowns template run component
 
# Preview generated code first
knowns template run component --dry-run
 
# Force overwrite existing files
knowns template run component --force

knowns template create

Create a new template scaffold.

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

Examples:

knowns template create api-endpoint -d "REST API endpoint generator"

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>.

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
--plainPlain text output (for AI)

Examples:

# Import from GitHub
knowns import github:knowns-dev/templates
 
# Import specific branch with custom name
knowns import https://github.com/org/patterns --ref main --name patterns
 
# Import from npm with version
knowns import npm:@knowns/templates --ref ^1.0.0
 
# Import local folder with symlink
knowns import ./shared-docs --name shared --link
 
# Preview import
knowns import github:user/repo --dry-run

knowns import list

List all configured imports.

knowns import list [options]
OptionDescription
--plainPlain text output (for AI)

knowns import sync

Update imports from their sources.

knowns import sync [name] [options]
OptionDescription
-f, --forceOverwrite locally modified files
--dry-runPreview changes
--plainPlain text output (for AI)

Examples:

# Sync all imports
knowns import sync
 
# Sync specific import
knowns import sync patterns
 
# Preview sync changes
knowns import sync --dry-run

knowns import remove

Remove an import configuration.

knowns import remove <name> [options]
OptionDescription
--deleteAlso delete imported files
--plainPlain text output (for AI)

Import Structure

.knowns/
├── imports.json          # Import configurations
├── docs/
│   └── imports/
│       └── <name>/       # Imported docs
└── templates/
    └── <name>/           # Imported templates

Reference imported docs with @doc/imports/<name>/<path>


Other Commands

knowns init

Initialize Knowns in current directory with interactive wizard.

knowns init [project-name] [options]
OptionDescription
--wizardForce interactive wizard mode
--no-wizardSkip wizard, use defaults
-f, --forceReinitialize (overwrites existing config)

Examples:

# Interactive wizard (default when no name provided)
knowns init
 
# Quick init with name
knowns init my-project
 
# Force reinitialize
knowns init --force

Wizard prompts:

  • Project name
  • Default assignee
  • Default priority
  • Default labels
  • Time format (12h/24h)
  • AI guidelines version (CLI/MCP)
  • AI agent files to sync (CLAUDE.md, GEMINI.md, etc.)

knowns config

Manage project configuration.

knowns config <command> [key] [value]

Commands:

# Get a config value
knowns config get defaultAssignee --plain
 
# Set a config value
knowns config set defaultAssignee "@john"
 
# List all config
knowns config list

knowns browser

Open Web UI in browser.

knowns browser [options]
OptionDescription
-p, --portCustom port (default: 6420)
--no-openDon't open browser

knowns mcp

Start MCP server for Claude Desktop integration.

knowns mcp [options]
OptionDescription
--infoShow configuration instructions
--verboseEnable verbose logging

Examples:

# Show setup instructions
knowns mcp --info
 
# Start server with logging
knowns mcp --verbose
 
# Auto-setup Claude Code + project .mcp.json
knowns mcp setup
knowns mcp setup --project   # only create .mcp.json in project
knowns mcp setup --global    # only register in Claude Code CLI

knowns agents

Manage AI agent instruction files. Syncs Knowns guidelines to various AI assistant configuration files.

knowns agents [options]
OptionDescription
(none)Interactive mode - select guidelines type/variant and files
--update-instructionsNon-interactive update
--type <type>Guidelines type: cli or mcp (default: cli)
--files <files>Comma-separated list of files to update

Supported files:

FileDescriptionDefault
CLAUDE.mdClaude Code instructionsYes
AGENTS.mdAgent SDKYes
GEMINI.mdGoogle Gemini
.github/copilot-instructions.mdGitHub Copilot

Examples:

# Interactive mode - select type and variant
knowns agents
 
# Non-interactive update (uses defaults)
knowns agents --update-instructions
 
# Update specific files with MCP version
knowns agents --update-instructions --type mcp --files "CLAUDE.md,AGENTS.md"

knowns agents sync

Quick sync of agent instruction files with latest guidelines.

knowns agents sync [options]
OptionDescription
--type <type>Guidelines type: cli or mcp (default: cli)
--minimalUse minimal instruction only (default: full embedded guidelines)
--allUpdate all instruction files (including Gemini, Copilot)

Template variants:

VariantSizeDescription
general (default)~26KBFull modular guidelines embedded in file
instruction (--minimal)~1KBMinimal - tells AI to call knowns agents guideline

Examples:

# Sync default files (CLAUDE.md, AGENTS.md) with full guidelines
knowns agents sync
 
# Sync all files
knowns agents sync --all
 
# Sync with minimal instruction only
knowns agents sync --minimal
 
# Sync with MCP guidelines
knowns agents sync --type mcp

knowns agents guideline

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

knowns agents guideline [options]
OptionDescription
(none)Output full guidelines (all sections)
--fullOutput full guidelines (all sections)
--compactOutput compact guidelines (core rules + common mistakes)
--stage <stage>Output guidelines for specific stage: creation, execution, completion
--coreOutput core rules only
--commandsOutput commands reference only
--mistakesOutput common mistakes only
--cli(Legacy) Same as default
--mcp(Legacy) Same as default

Guidelines Structure (Modular):

SectionDescription
Core RulesGolden rules, must-follow principles
Commands ReferenceCLI/MCP commands quick reference
Workflow CreationTask creation workflow
Workflow ExecutionTask execution workflow
Workflow CompletionTask completion workflow
Common MistakesAnti-patterns and DO vs DON'T

Examples:

# Full guidelines (default)
knowns agents guideline
 
# Compact for quick reference
knowns agents guideline --compact
 
# Stage-specific guidelines
knowns agents guideline --stage creation    # When creating tasks
knowns agents guideline --stage execution   # When implementing
knowns agents guideline --stage completion  # When finishing
 
# Individual sections
knowns agents guideline --core       # Core rules only
knowns agents guideline --commands   # Commands reference
knowns agents guideline --mistakes   # Common mistakes

Output Formats

--plain

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

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

Multi-line Input

Bash / Zsh

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

PowerShell

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

Heredoc (long content)

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