cog pack ./my_project output.cog
Pack a project folder into a .cog bundle
cog pack ./report.pdf report.cog
Pack a single file into a bundle
cog list output.cog
List all blocks in a bundle
cog list output.cog -v
List blocks with verbose details
cog get output.cog abc123def456
Get a specific block by its content hash
cog put output.cog rules.json RULE_PACK
Append a JSON rule pack block to a bundle
cog put output.cog runbook.md MD_RUNBOOK
Append a markdown runbook block to a bundle
cog put output.cog processor.py PY_CORE
Append a Python script block to a bundle
cog put output.cog deploy.sh SH_MINI
Append a shell script block to a bundle
cog query output.cog "deployment procedure"
Search a bundle for matching content using hybrid text and vector search
cog query output.cog "neural architecture"
Search across all text blocks for a technical topic
cog fork output.cog experiment-v1
Create a copy-on-write branch of a bundle for experimentation
cog fork output.cog team-alpha-sprint-12
Fork a bundle for a team-specific branch
cog verify output.cog
Verify bundle integrity including block hashes, proof chain, and rule seals
cog verify output.cog -v
Verify integrity with verbose phase-by-phase output
cog embed output.cog docs/*.txt
Embed text files as vectors using feature hashing
cog embed output.cog whitepaper.md
Embed a single document as searchable vectors
cog replay output.cog
Replay the event log and diff streams from a bundle
cog compact output.cog compacted.cog
Compact a bundle by deduplicating blocks and rebuilding indexes
cog log output.cog -n 20
Show the last 20 entries from the event log timeline
cog sign output.cog --key my-secret-key
HMAC-SHA256 sign a bundle for tamper detection
cog ai train ./corpus/papers.txt
Train the AI model on a text corpus
cog ai train ./corpus/*.txt
Train on multiple text files at once
cog ai train ./src/**/*.py
Train on a codebase for code knowledge
cog ai query "Explain how transformers work"
Ask the AI a natural language question
cog ai query "Differences between TCP and UDP"
Query for a comparative technical answer
cog ai query "How does the auth middleware work?"
Query trained code knowledge about implementation details
cog ai query "Compare GDPR and CCPA" --multi
Multi-query across multiple sources for comparative analysis
cog ai distill "machine learning optimization"
Deep distill — generate extended summary and analysis
cog ai distill "quantum computing cryptography"
Distill a technical topic into a comprehensive report
cog sync export data.cog shared.cog.enc -p mysecret
Export an encrypted bundle for sharing
cog sync import shared.cog.enc -p mysecret
Import and decrypt a shared bundle
cog sync pull https://cdn.example.com/data.cog local.cog
Pull a bundle from a URL via HTTP range fetch
cog sync push data.cog https://api.example.com/upload
Push a bundle to an upload endpoint
cog sync serve data.cog --port 9473
Serve a bundle over TCP for peer-to-peer sync
cog sync serve data.cog --port 9473 --encrypt
Serve with per-block encryption enabled
cog sync pull host:9473 local.cog
Pull a bundle from a peer node over TCP
cog sync merge base.cog fork.cog merged.cog
Merge two bundles with union event logs and conflict resolution
cog enterprise doc create --title "Security Policy" --content "All systems require MFA"
Create a new versioned document in the enterprise store
cog enterprise doc create --title "API Spec" --content "RESTful OAuth2" --type specification --classification confidential
Create a classified document with a specific type
cog enterprise doc update DOC_ID --content "Updated policy" --note "Audit fix"
Update a document creating a new version with a revision note
cog enterprise doc list
List all documents in the enterprise store
cog enterprise doc list --type specification
List documents filtered by type
cog enterprise doc search --query "security MFA"
Full-text search across all documents
cog enterprise doc get DOC_ID
Retrieve a document by ID with its latest version
cog enterprise doc get DOC_ID --version 2
Retrieve a specific historical version of a document
cog enterprise doc lock DOC_ID --user alice
Lock a document to prevent concurrent edits
cog enterprise doc unlock DOC_ID --user alice
Unlock a previously locked document
cog enterprise doc diff DOC_ID 1 3
Show a diff between two versions of a document
cog enterprise doc delete DOC_ID
Delete a document from the store
cog enterprise doc export DOC_ID
Export a document as Markdown
cog enterprise doc classify DOC_ID --level restricted
Set a document classification level
cog enterprise doc tag DOC_ID --tags "security,compliance"
Add tags to a document
cog enterprise doc retention DOC_ID --days 2555
Set a retention policy for compliance archival
cog enterprise compliance check SOC2
Run a SOC2 compliance check against the enterprise store
cog enterprise compliance check HIPAA
Run a HIPAA compliance check
cog enterprise compliance check GDPR
Run a GDPR compliance check
cog enterprise compliance check PCI-DSS
Run a PCI-DSS compliance check
cog enterprise compliance check ISO27001
Run an ISO 27001 compliance check
cog enterprise compliance check NIST-CSF
Run a NIST Cybersecurity Framework check
cog enterprise compliance check FedRAMP
Run a FedRAMP compliance check
cog enterprise compliance report SOC2 --format json
Generate a SOC2 compliance report as JSON
cog enterprise compliance verify
Verify the integrity of the audit log hash chain
cog enterprise compliance frameworks
List all supported compliance frameworks
cog enterprise compliance search --action create --limit 50
Search audit log entries by action type
cog enterprise provenance source --name "customer_db" --type database --uri "postgres://db:5432/cust"
Register a data source for lineage tracking
cog enterprise provenance transform --name "clean" --inputs "customer_db" --type etl
Register a data transform step with upstream inputs
cog enterprise provenance sink --name "warehouse" --inputs "clean" --dest "bigquery://analytics"
Register a data sink as a final destination
cog enterprise provenance trace ENTITY_ID --direction upstream
Trace data lineage upstream to its origin
cog enterprise provenance graph
Visualize the full data provenance graph
cog enterprise provenance impact SOURCE_ID
Impact analysis showing everything that depends on a source
cog enterprise provenance list --type transform
List all provenance entities filtered by type
cog enterprise kb add --title "Onboarding" --body "Step 1: Request accounts" --category onboarding
Add an article to the knowledge base
cog enterprise kb search --query "timeout" --category troubleshooting
Search knowledge base articles within a category
cog enterprise kb popular --limit 10
Show the top 10 most-viewed articles
cog enterprise kb recent --limit 5
Show the 5 most recently updated articles
cog enterprise kb categories
List all article categories with counts
cog enterprise kb link ARTICLE_1 ARTICLE_2
Cross-link two related knowledge base articles
cog enterprise kb rate ARTICLE_ID 4.5
Rate a knowledge base article from 0.0 to 5.0
cog enterprise workflow create --name "Release v2" --steps "plan,dev,test,deploy"
Create a multi-step approval workflow
cog enterprise workflow assign WF_ID --step review --user alice
Assign a user to a workflow step
cog enterprise workflow complete WF_ID --step dev
Mark a workflow step as completed
cog enterprise workflow approve WF_ID
Approve a workflow
cog enterprise workflow reject WF_ID --reason "Missing tests"
Reject a workflow with a documented reason
cog enterprise workflow list --status pending
List workflows filtered by status
cog enterprise workflow status WF_ID
Show workflow progress with per-step details
cog enterprise incident create --title "DB Down" --severity P0_CRITICAL --desc "Primary unreachable"
Open a critical production incident
cog enterprise incident create --title "Auth Slow" --severity P1_HIGH --desc "Login >10s"
Open a high-severity incident
cog enterprise incident assign INC_ID --user on-call-sre
Assign an incident to a responder
cog enterprise incident resolve INC_ID --resolution "Fixed" --root-cause "Pool exhaustion"
Resolve an incident with root cause documentation
cog enterprise incident escalate INC_ID --severity P0_CRITICAL
Escalate an incident to a higher severity
cog enterprise incident list --status open
List all currently open incidents
cog enterprise incident timeline INC_ID
View the full timeline of an incident
cog enterprise incident mttr
Calculate Mean Time to Resolve across all incidents
cog enterprise sla define --name "API Uptime" --metric availability --target 99.9 --unit percent
Define an SLA target for uptime monitoring
cog enterprise sla define --name "P95 Latency" --metric latency --target 200 --unit ms
Define a latency SLA target
cog enterprise sla measure SLA_ID --value 99.95
Record an SLA measurement with automatic breach detection
cog enterprise sla report
Generate an SLA compliance report for all targets
cog enterprise sla list
List all defined SLAs
cog enterprise sla status SLA_ID
Show SLA status including breach history
cog enterprise vault store --name "STRIPE_KEY" --value "sk_live_abc" --rotation-days 90
Store an API key with rotation policy
cog enterprise vault store --name "DB_PASS" --value "s3cure!" --rotation-days 30
Store a database password with 30-day rotation
cog enterprise vault get --name "STRIPE_KEY"
Retrieve a secret with access logging
cog enterprise vault rotate --name "DB_PASS" --value "n3w_pass!"
Rotate a secret to a new value
cog enterprise vault check-rotation
Check which secrets are overdue for rotation
cog enterprise vault list
List all secrets with redacted values
cog enterprise vault delete --name "OLD_KEY"
Delete a secret from the vault
cog enterprise classify scan --text "Email: john@co.com SSN: 123-45-6789"
Auto-scan text for PII like email, SSN, credit cards, phone, IP
cog enterprise classify scan --text "Revenue grew 15%" --source "q1_report"
Scan and classify text with a source identifier
cog enterprise classify manual SOURCE_ID --level RESTRICTED --reason "Contains PII"
Manually set a data classification level
cog enterprise classify list --level RESTRICTED
List all data classified at a specific level
cog enterprise report summary
Generate an executive summary across all enterprise modules
cog enterprise report export --section documents --format json
Export documents section as JSON
cog enterprise report export --section audit --format csv
Export audit trail as CSV
cog enterprise compliance check CMMC
Run a CMMC 2.0 Level 2 compliance check (12 practice domains)
cog enterprise compliance check NIST_AI_RMF
Run a NIST AI Risk Management Framework check (Govern/Map/Measure/Manage)
cog enterprise compliance check SOC2_TYPE2
Run a SOC 2 Type II operational effectiveness check (12 controls)
cog enterprise compliance report CMMC --format json
Generate a CMMC compliance report as JSON
cog enterprise govern open COMMIT_SHA --policy cmmc_l2 --author alice
Open a CMMC L2 governance gate for a commit boundary
cog enterprise govern open COMMIT_SHA --policy nist_ai --author alice
Open a NIST AI RMF governance gate
cog enterprise govern open COMMIT_SHA --policy soc2_change --author alice
Open a SOC2 change-management governance gate
cog enterprise govern check GATE_ID --name access_control --pass
Assert that the access_control check passed for a gate
cog enterprise govern check GATE_ID --name risk_assessment --fail --note "Missing risk log"
Assert that a check failed with a reason
cog enterprise govern approve GATE_ID --approver alice
Record an approval on a governance gate
cog enterprise govern close GATE_ID
Close a gate — passes if all checks passed, blocked otherwise
cog enterprise govern status GATE_ID
Show detailed gate status with per-check breakdown
cog enterprise govern list --status blocked
List all blocked governance gates requiring attention
cog enterprise govern policies
List all available gate policies and their required checks
cog enterprise authority register alice --name "Alice Smith" --role operator
Register a user in the authority registry with an operator role
cog enterprise authority register bob --name "Bob Jones" --role auditor
Register an auditor in the authority registry
cog enterprise authority event alice --type compliance_pass --delta 10
Boost authority score after a compliance event
cog enterprise authority event alice --type incident_caused --delta -20 --note "P1 incident"
Penalize authority score after an incident
cog enterprise authority recompute alice
Recompute authority score from base role + all events
cog enterprise authority recompute-all
Recompute authority scores for all registered entities
cog enterprise authority revoke alice --reason "Policy violation"
Revoke authority and zero out score
cog enterprise authority restore alice
Restore a revoked entity to their base authority score
cog enterprise authority get alice
Show authority score, level, and permissions for an entity
cog enterprise authority list
List all entities sorted by authority score
cog enterprise drift baseline --name "prod-config" --config '{"mfa":"required","tls":"1.3","log_level":"info"}'
Set a configuration baseline for drift detection
cog enterprise drift detect --name "prod-config" --current '{"mfa":"optional","tls":"1.2"}'
Detect drift from baseline — shows changed and missing keys
cog enterprise drift patch --baseline "prod-config" --drift-id DRIFT_ID --desc "Re-enable MFA" --priority HIGH
Schedule a patch to remediate detected drift
cog enterprise drift apply PATCH_ID --note "Applied via Ansible playbook"
Mark a patch as applied with notes
cog enterprise drift verify PATCH_ID --pass
Verify a patch was successfully applied
cog enterprise drift verify PATCH_ID --fail --note "Config still shows old value"
Record a failed patch verification
cog enterprise drift close PATCH_ID
Close a completed and verified patch
cog enterprise drift list --status scheduled
List all scheduled drift patches
cog enterprise drift baselines
List all registered configuration baselines
cog enterprise drift summary
Patch summary showing counts by status
cog enterprise coherence assess
Run a full institutional coherence assessment across all frameworks
cog enterprise coherence report
Print the latest coherence report with scores and conflicts
cog enterprise coherence history --limit 10
Show the last 10 coherence assessment results over time
cog enterprise seed
Populate the store with realistic demo data — documents, incidents, gates, audit trail, SLAs
cog enterprise seed --force
Force re-seed the store even if data already exists
cog enterprise history
Show a log of all past enterprise command runs with module, action, and args
cog enterprise history --limit 50
Show the last 50 enterprise command runs
cog rl env create --name maze4 --type grid --rows 4 --cols 4
Create a 4x4 GridWorld environment for tabular RL
cog rl env create --name maze8 --type grid --rows 8 --cols 8 --obstacles "2,2;3,4;5,6"
Create an 8x8 grid with obstacles for harder navigation
cog rl env create --name bandit5 --type bandit --arms 5
Create a 5-armed stochastic bandit environment
cog rl env create --name bandit10 --type bandit --arms 10 --seed 7
Create a 10-armed bandit with fixed seed for reproducibility
cog rl env list
List all registered RL environments with state/action space sizes
cog rl env render maze4
Render an ASCII map of the GridWorld (S=start, G=goal, #=obstacle)
cog rl env render bandit5
Show arm reward distributions and optimal arm for a bandit env
cog rl agent create --name qagent --type qlearning --env maze4 --alpha 0.1 --gamma 0.99 --epsilon 0.2
Create a Q-learning agent bound to maze4 (α=0.1, γ=0.99, ε=0.2)
cog rl agent create --name sarsa1 --type sarsa --env maze4 --epsilon-decay 0.998
Create a SARSA on-policy TD agent with slow epsilon decay
cog rl agent create --name ucb1 --type ucb --env bandit5 --c 1.414
Create a UCB1 bandit agent (exploration coeff √2)
cog rl agent create --name baseline --type random --env maze4
Create a random baseline agent for comparison
cog rl agent list
List all agents with type, bound env, total steps, and last training time
cog rl agent show qagent
Inspect agent config (excludes raw Q-table)
cog rl agent reset qagent
Clear Q-table and training history — restart agent from scratch
cog rl train --agent qagent --env maze4 --episodes 1000
Train Q-learning agent for 1000 episodes on maze4
cog rl train --agent qagent --env maze4 --episodes 2000 --verbose
Train with progress output every 100 episodes
cog rl train --agent sarsa1 --env maze4 --episodes 1000 --seed 42
Reproducible SARSA training with fixed random seed
cog rl train --agent ucb1 --env bandit5 --episodes 500
Train UCB1 bandit agent for 500 episodes
cog rl train --agent baseline --env maze4 --episodes 200
Run random baseline for benchmark comparison
cog rl eval --agent qagent --env maze4 --episodes 100
Evaluate trained Q-agent greedily (no exploration) for 100 episodes
cog rl eval --agent sarsa1 --env maze4 --episodes 100
Evaluate SARSA agent greedy policy
cog rl eval --agent ucb1 --env bandit5 --episodes 200
Evaluate UCB1 greedy arm selection on the bandit
cog rl eval --agent baseline --env maze4 --episodes 100
Evaluate random baseline for comparison
cog rl policy save --agent qagent --name qagent-v1 --desc "After 2000 episodes"
Save a named snapshot of the current Q-agent policy
cog rl policy load --name qagent-v1 --agent qagent
Restore a named policy snapshot into an agent
cog rl policy list
List all saved named policies with agent, type, and save time
cog rl policy compare qagent-v1 sarsa1-v1 baseline-v1
Compare saved policies by best evaluation avg return
cog rl report --agent qagent
Full training + eval report with convergence sparkline for an agent
cog rl report
Print reports for all registered agents
cog rl leaderboard
Ranked leaderboard of all agents by best evaluation average return
cog rl leaderboard --env maze4
Leaderboard filtered to a specific environment
cog rl history --limit 20
Show the last 20 training and evaluation run records
cog rl history --type train
Show only training run history
cog rl history --type eval
Show only evaluation run history
cog pqc keygen --name alice --security 512
Generate a 512-bit lattice-based KEM keypair
cog pqc keygen --name bob --security 1024
Generate a 1024-bit KEM keypair for maximum security
cog pqc list-keys
List all stored PQC keypairs
cog pqc inspect --name alice
Inspect keypair details including security level and usage count
cog pqc encapsulate --recipient alice
KEM encapsulate to generate a shared secret for a recipient
cog pqc encapsulate --recipient bob --output kem.json
KEM encapsulate and save ciphertext to a file
cog pqc decapsulate --name alice --ciphertext kem.json
KEM decapsulate to recover a shared secret from ciphertext
cog pqc sign-keygen --name alice-sig --security 512
Generate a Merkle-tree signature keypair with 1024 one-time keys
cog pqc sign-keygen --name server-sig --security 1024
Generate a high-security Merkle signature keypair
cog pqc sign --key alice-sig --message "I approve this transaction"
Digitally sign a message with WOTS+ hash chains
cog pqc sign --key alice-sig --file contract.pdf
Sign a file using post-quantum digital signatures
cog pqc verify --key alice-sig --sig sig.json --message "I approve"
Verify a PQC signature against a public key and message
cog pqc encrypt --recipient alice --message "Top secret"
Hybrid encrypt using lattice KEM plus symmetric stream cipher
cog pqc encrypt --recipient bob --file secret.pdf --output secret.enc
Hybrid encrypt a file for a specific recipient
cog pqc decrypt --name alice --ciphertext encrypted.json
Hybrid decrypt to recover plaintext from lattice-encrypted data
cog pqc cert-create --subject "COG Root CA" --name root-ca --days 3650
Create a PQC certificate valid for 10 years
cog pqc cert-create --subject "Worker" --name worker-01 --days 7
Create a short-lived ephemeral certificate
cog pqc cert-verify --cert root-ca.cert.json
Verify a PQC certificate signature and expiry
cog pqc cert-inspect --cert root-ca.cert.json
Inspect certificate fields like subject, issuer, and validity dates
cog pqc kdf --password "strong-phrase" --salt "unique" --length 32
Derive a key from a password using HKDF-SHA256 with PBKDF2
cog pqc analyze --security 1024
Full security analysis of norms, entropy, and noise budget
cog pqc analyze --security 512
Security analysis at the 512-bit level
cog pqc benchmark --security 1024 --iterations 100
Benchmark PQC operations including keygen, encap, decap, sign, verify
cog pqc compare
Side-by-side comparison of 512 vs 1024 security parameters
cog pqc poly-gen --security 1024 --type uniform
Generate a random polynomial in the ring R_q
cog pqc poly-add --a a.json --b b.json --security 1024
Add two polynomials mod q
cog pqc poly-mul --a a.json --b b.json --security 1024
Multiply two polynomials in the quotient ring
cog pqc poly-norm --poly p.json --security 1024
Compute L2 and L-infinity norms of a polynomial
cog chain wallet create --name alice
Create a new blockchain wallet with HMAC-derived keypair
cog chain wallet create --name treasury
Create a treasury wallet for managing funds
cog chain wallet list
List all blockchain wallets
cog chain wallet balance --name alice
Check a wallet balance
cog chain wallet history --name alice --limit 10
View recent transaction history for a wallet
cog chain wallet export --name alice
Export wallet details as JSON
cog chain tx send --from alice --to bob --amount 25 --fee 0.1
Send a signed transaction from one wallet to another
cog chain tx send --from alice --to bob --amount 5 --data "Payment"
Send a transaction with a data payload
cog chain tx get TX_HASH
Look up a transaction by its hash
cog chain tx list --limit 50
List confirmed transactions
cog chain tx pending
Show the transaction mempool of unconfirmed transactions
cog chain mine --miner alice
Mine a single block and collect the block reward
cog chain mine --miner alice --count 5
Mine 5 blocks in sequence
cog chain mine --miner miner-1 --auto
Mine continuously in auto mode
cog chain block get 0
Get the genesis block
cog chain block latest
Show the most recent block on the chain
cog chain block list --limit 20
List the last 20 blocks
cog chain block merkle 5
Show the Merkle root and transaction tree of block 5
cog chain block merkle-proof 5 --tx-index 2
Generate a Merkle inclusion proof for a specific transaction
cog chain contract deploy --owner alice --id counter --code '{"increment":{"type":"increment","key":"count"}}'
Deploy a counter smart contract
cog chain contract deploy --owner alice --id election --code '{"vote":{"type":"vote"}}'
Deploy a voting smart contract
cog chain contract call --caller alice --id counter --action increment
Call an action on a deployed smart contract
cog chain contract call --caller bob --id election --action vote --params '{"candidate":"alice"}'
Vote on a smart contract with parameters
cog chain contract state --id counter
Query the current state of a smart contract
cog chain contract list
List all deployed smart contracts
cog chain validate
Validate entire chain integrity including hashes, PoW, and balances
cog chain stats
Show chain statistics like height, supply, difficulty, and block times
cog chain top-holders --limit 10
Show the top 10 balance holders on the chain
cog chain export --format json
Export the entire blockchain as JSON
cog chain export --format csv
Export the entire blockchain as CSV
cog chain search --miner alice --limit 10
Search blocks mined by a specific wallet
cog chain snapshot
Create a state snapshot of all balances and nonces
cog chain rollback --height 10
Rollback the chain to a specific block height
cog chain fork-detect
Detect chain forks and inconsistencies
cog chain info
Show a chain info summary with key metrics
cog chain reset
Reset the entire chain back to genesis block
cog chain contract deploy --owner alice --id escrow --code '{"deposit":{"type":"escrow"}}'
Deploy an escrow smart contract
python3 cogc.py run examples/while_sum.cogs
Run a .cogs program with the tree-walking interpreter
python3 cogc.py run examples/fibonacci.cogs --print-result
Run and print the final result value
python3 cogc.py vm examples/factorial.cogs
Compile to bytecode and execute on the stack VM
python3 cogc.py vm examples/rec_sum.cogs --print-result
Run on VM and print the final result
python3 cogc.py hash examples/factorial.cogs
Print SHA3-256 of source and AST for content addressing
python3 cogc.py ast examples/while_sum.cogs --out out/ast.dot
Generate AST as Graphviz .dot graph
python3 cogc.py ast-json examples/rec_sum.cogs
Dump AST as JSON for tooling integration
python3 cogc.py tokens examples/while_sum.cogs
Print the raw token stream from the lexer
python3 cogc.py disasm examples/while_sum.cogs
Disassemble bytecode to see compiled opcodes
python3 cogc.py disasm examples/fibonacci.cogs --dot out/bytecode.dot
Disassemble and emit control-flow .dot graph
python3 cogc.py run examples/fibonacci.cogs --max-steps 1000
Run with execution step limit to detect infinite loops
python3 cogc.py vm examples/fibonacci.cogs --max-steps 5000
Run VM with step limit for bounded execution