Skip to main content

Overview

The add command adds a directory to know’s watch list. Once added, directories can be indexed using the know index command.

Syntax

know add <directory>

Parameters

directory
Path
required
The path to the directory you want to add to the watch list. Can be absolute or relative.

Behavior

  • Resolves the directory path to its absolute form
  • Validates that the path exists and is a directory
  • Adds the directory to ~/.know_dirs if not already present
  • Prevents duplicate entries

Examples

Add current directory

know add .
Added /home/user/projects/myapp

Add absolute path

know add /path/to/documents
Added /path/to/documents

Add already tracked directory

know add ~/notes
Already added: /home/user/notes

Error: Invalid directory

know add /nonexistent/path
Error: '/nonexistent/path' is not a valid directory
Directories must exist and be valid before adding. The command will validate the path and exit with an error if invalid.

Next Steps

After adding directories, use:
  • know dirs to view all watched directories
  • know index to index the added directories
  • know remove <directory> to remove from watch list

Build docs developers (and LLMs) love