Skip to main content

run

Run a Cognitive Module.

Syntax

npx cogn@2.2.12 run <module> [options]

Options

OptionShortDescription
--profile <name>Progressive complexity: core | standard | certified (legacy: default/strict)
--validate <mode>Validation mode: auto | on | off (overrides --no-validate)
--auditWrite an audit record to ~/.cognitive/audit/ (stderr prints path)
--args <text>-aPass text input (mapped to query or code)
--input <json>-iJSON input string
--prettyPretty-print JSON output
--no-validateSkip schema validation
--provider <name>-pProvider override (openai/anthropic/gemini/deepseek/minimax/moonshot/qwen/ollama)
--model <name>-MModel override
--verbose-VVerbose output
--streamStream cep.events.v2.2 as NDJSON (one JSON event per line)

Examples

Using --args

npx cogn@2.2.12 run code-reviewer --args "def foo(): pass" --pretty

Running a One-File Module

npx cogn@2.2.12 run ./demo-single-file.md --args "hello" --pretty

If you want an even smaller path (no file), see core and npx cogn@2.2.12 core run --stdin.

Using JSON input

npx cogn@2.2.12 run ui-spec-generator --input '{"query":"e-commerce homepage"}' --pretty

Specify Provider/Model

npx cogn@2.2.12 run code-reviewer --args "code" --provider openai --model gpt-4o

Output

run prints a v2.2 envelope to stdout. The envelope includes module/provider when available. Errors use the same envelope structure (ok:false, meta, error). In --pretty mode it is formatted with indentation.

In --stream mode, run prints streaming events as NDJSON:

  • One CEP event object per line
  • Terminal event is {"type":"end", ... "result": { ...envelope... }}