IWE CLI
Command-line interface for IWE - memory system for you and your AI agents.
Installation
Install from source:
Or build locally:
Quick start
&&
Commands
init
Initialize an IWE workspace with configuration.
Detects the conventions of markdown files already in the directory and proposes a matching .iwe/config.toml.
Options:
-y, --auto- write the detected configuration without prompting--dry-run- print the proposed configuration and evidence, write nothing--defaults- write the static default template without detection--json- print a machine-readable report
new
Create a new document in the workspace.
|
Options:
-t, --template <NAME>- template name from config-c, --content <TEXT>- document content-k, --key <KEY>- explicit document key, bypassing the template's key derivation-i, --if-exists <MODE>- behavior when file exists:suffix(default),override,skip,fail(default when--keyis given)-e, --edit- open created file in$EDITOR
find
Search and discover documents.
Options:
--fuzzy <QUERY>- fuzzy match on document title and key--lexical <QUERY>- full-text (BM25) match on title and body--filter <EXPR>- filter expression (inline YAML)--roots- only root documents (no incoming inclusion links)--references <KEY>- documents that reference this key--referenced-by <KEY>- documents this key references-l, --limit <N>- maximum results (0 = unlimited)-f, --format <FORMAT>- output format:markdown(default),keys,json,yaml
retrieve
Retrieve document content with configurable expansion.
Options:
-k, --key <KEY>- document key(s) to retrieve (repeatable)--expand-includes <N>- expand into child documents to depth N (0 = unbounded)--expand-included-by <N>- expand into parent documents to depth N (0 = unbounded)--expand-references <N>- follow outbound reference links to depth N (0 = unbounded)--expand-referenced-by <N>- follow inbound reference links to depth N (0 = unbounded)--lexical <QUERY>- seed search: full-text query on title and body--fuzzy <QUERY>- seed search: fuzzy query on title and key--limit <N>- cap seed documents kept before expansion (0 = unlimited)-e, --exclude <KEY>- exclude document key(s) (repeatable)-b, --backlinks- include incoming references (default: true)-f, --format <FORMAT>- output format:markdown(default),keys,json,yaml--children- populate theincludesarray with child document edges
count
Count documents matching a filter.
tree
Display the document hierarchy.
Options:
-k, --key <KEY>- filter to paths starting from specific document(s) (repeatable)-d, --depth <N>- maximum depth to traverse (default: 4)-f, --format <FORMAT>- output format:markdown(default),keys,json,yaml
normalize
Format and normalize all markdown files in the workspace.
Applies consistent formatting to headers, lists, links, and spacing according to configuration.
squash
Combine content for a specific document key.
Flattens hierarchical content into a single markdown document by expanding block references.
stats
Generate statistics about the knowledge graph.
Options:
-k, --key <KEY>- document key for per-document stats-f, --format <FORMAT>- output format:markdown(default),csv,json,yaml
export
Export knowledge graph in DOT format for visualization.
Options:
-f, --format <FORMAT>- output format:dot(default)-k, --key <KEY>- filter nodes by specific key-d, --depth <N>- limit traversal depth--include-headers- include section headers with colored subgraphs
rename
Rename a document key, updating all references across the graph.
Options:
--dry-run- preview changes without writing to disk--quiet- suppress progress output-f, --format <FORMAT>- output format:markdown(default),keys(affected document keys, one per line)
delete
Delete documents from the knowledge graph.
Options:
--filter <EXPR>- filter expression (inline YAML); required if positional KEY omitted--expect <ARG>- assert the number of matched documents before deleting--strict- require the--expectguard--dry-run- preview changes without writing to disk--quiet- suppress progress output-f, --format <FORMAT>- output format:markdown(default),keys
update
Apply frontmatter and block edits, or overwrite a document body.
Options:
-k, --key <KEY>- match by document key (repeatable)--filter <EXPR>- filter expression (inline YAML)--set FIELD=VALUE/--unset FIELD- frontmatter edits--replace,--replace-text,--insert-before,--insert-after,--append,--delete- block edit operators-c, --content <TEXT>- new full markdown content (-reads stdin)--expect <ARG>- assert the number of matched documents--strict- require an expect guard on every mutating application--dry-run- preview without writing--quiet- suppress progress output
extract
Extract a section from a document into a new standalone document.
Options:
--section <TITLE>- section title to extract (case-insensitive)--block <N>- block number to extract (1-indexed)--list- list all sections with block numbers--action <NAME>- action name from config--dry-run- preview changes without writing to disk--quiet- suppress progress output-f, --format <FORMAT>- output format:markdown(default),keys
inline
Replace a block reference with the content of the referenced document.
Options:
--reference <KEY>- reference key or title to inline--block <N>- block number to inline (1-indexed)--list- list all block references with numbers--action <NAME>- action name from config--as-quote- inline as blockquote instead of section--keep-target- keep the target document after inlining--dry-run- preview changes without writing to disk--quiet- suppress progress output-f, --format <FORMAT>- output format:markdown(default),keys
attach
Attach a document to configured targets.
Options:
--to <ACTION>- configured attach action(s) (repeatable)-k, --key <KEY>- source document key--list- list configured attach actions--dry-run- preview without writing--quiet- suppress progress output
schema
Print inferred document schemas, or validate documents against configured schemas.
docs
Print built-in reference documentation.
completions
Generate shell completions.
Supported shells: bash, elvish, fish, nushell, powershell, zsh.
Configuration
IWE uses .iwe/config.toml for workspace configuration:
[]
= ""
[]
= ""
Global options
All commands support:
-v, --verbose <LEVEL>- set verbosity (0-2)-h, --help- show help information-V, --version- show version
License
Apache-2.0
Related projects
- IWE LSP Server - Language server for editor integration
- IWE MCP Server - MCP server for AI tool integration
- IWE Core Library - Core functionality and graph processing
- VSCode Extension
- Zed Plugin
For more information, visit iwe.md.