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 a new IWE workspace with configuration.
Creates .iwe/config.toml with default settings for markdown processing.
new
Create a new document in the workspace.
|
Options:
-t, --template <NAME>- template name from config-c, --content <TEXT>- document content-i, --if-exists <MODE>- behavior when file exists:suffix(default),override,skip-e, --edit- open created file in$EDITOR
find
Search and discover documents.
Options:
--roots- only root documents (no incoming block refs)--refs-to <KEY>- documents that reference this key--refs-from <KEY>- documents referenced by this key-l, --limit <N>- maximum results-f, --format <FORMAT>- output format:markdown(default),keys,json
retrieve
Retrieve document content with configurable expansion.
Options:
-k, --key <KEY>- document key(s) to retrieve (repeatable)-d, --depth <N>- follow block refs down N levels (default: 1)-c, --context <N>- include N levels of parent context (default: 1)-l, --links- include inline references-b, --backlinks- include incoming references (default: true)-e, --exclude <KEY>- exclude document key(s) (repeatable)-f, --format <FORMAT>- output format:markdown(default),keys,json--dry-run- show document count and total lines without content--no-content- exclude document content from results (metadata only)
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
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:
-f, --format <FORMAT>- output format:markdown(default),csv
export
Export knowledge graph in DOT format for visualization.
Options:
-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--keys- print affected document keys (one per line)
delete
Delete a document from the knowledge graph.
Options:
--dry-run- preview changes without writing to disk--quiet- suppress progress output--keys- print affected document keys (one per line)--force- skip confirmation prompt
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--keys- print affected document keys (one per line)
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--keys- print affected document keys (one per line)
Configuration
IWE uses .iwe/config.toml for workspace configuration:
[]
= ""
[]
= false
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.