CLI Overview
Cognitive Modules provides two command-line tools:
| Platform | Package | Command |
|---|---|---|
| pip | cognitive-modules | cogn |
| npm | cognitive-modules-cli | cog |
Installation
- Python (pip)
- Node.js (npm)
- npx (zero-install)
pip install cognitive-modules
npm install -g cognitive-modules-cli
npx cognitive-modules-cli <command>
Command List
| Command | Description |
|---|---|
list | List installed modules |
info <module> | View module details |
run <module> | Run a module |
validate <module> | Validate a module |
init <name> | Create a new module |
add <url> | Install module from GitHub (recommended) |
update <module> | Update module to latest version |
versions <url> | View available versions |
remove <module> | Remove a module |
install <source> | Install module (compatible method) |
uninstall <module> | Uninstall a module |
search <query> | Search registry |
registry | View registry |
doctor | Environment check |
Global Options
cogn --version # Show version (pip)
cog --version # Show version (npm)
cogn --help # Show help
Common Workflows
Command Names
The examples below use cogn (pip version). If using the npm version, replace cogn with cog.
1. Use Built-in Modules
# View available modules
cogn list
# View module details
cogn info code-reviewer
# Run a module
cogn run code-reviewer --args "your code" --pretty
2. Create Custom Modules
# Create skeleton
cogn init my-module -d "Module description"
# Edit MODULE.md and schema.json
# ...
# Validate
cogn validate my-module
# Install globally
cogn install ./cognitive/modules/my-module
3. Install Community Modules
# Install from GitHub (recommended)
cogn add ziel-io/cognitive-modules -m code-simplifier
# Install specific version
cogn add ziel-io/cognitive-modules -m code-reviewer --tag v1.0.0
# View available versions
cogn versions ziel-io/cognitive-modules
# Search registry
cogn search "code review"
# Install from registry
cogn install registry:code-reviewer
4. Version Management
# Update module to latest version
cogn update code-simplifier
# Update to specific version
cogn update code-simplifier --tag v2.0.0
# View module installation info
cogn info code-simplifier
# Remove module
cogn remove code-simplifier
5. npx Zero-Install Usage
# No installation needed, use directly
npx cognitive-modules-cli add ziel-io/cognitive-modules -m code-simplifier
npx cognitive-modules-cli run code-simplifier --args "code"