Skip to main content

CLI Overview

IntentusNet provides a CLI-first interface for executing intents, inspecting executions, and replaying recorded outputs. All commands produce structured JSON output suitable for scripting and automation.

Installation​

The CLI is included with the IntentusNet package:

pip install intentusnet

Verify installation:

intentusnet --version
# intentusnet 1.3.0

Command Summary​

CommandDescription
intentusnet runExecute an intent
intentusnet inspectInspect execution records
intentusnet replayReplay a recorded execution
intentusnet estimateEstimate execution cost/resources
intentusnet validateValidate envelope or policy

Global Options​

All commands support these global options:

intentusnet [command] [options]

Global Options:
--help, -h Show help message
--version, -v Show version
--format FORMAT Output format: json (default), text, yaml
--quiet, -q Suppress non-essential output
--verbose Enable verbose logging
--config FILE Path to config file
--records-path DIR Path to execution records

Output Formats​

JSON (Default)​

intentusnet inspect exec-a1b2c3d4
{
"execution_id": "exec-a1b2c3d4",
"status": "completed",
"intent": "ProcessIntent",
...
}

Text​

intentusnet inspect exec-a1b2c3d4 --format text
Execution: exec-a1b2c3d4
Status: completed
Intent: ProcessIntent
...

YAML​

intentusnet inspect exec-a1b2c3d4 --format yaml
execution_id: exec-a1b2c3d4
status: completed
intent: ProcessIntent
...

Exit Codes​

All commands return semantic exit codes:

Exit CodeMeaning
0Success
1General error
2Validation error
3Routing error
4Agent error
5Policy denial
10Record not found
11Replay not possible
12Configuration error

Scripting Example​

#!/bin/bash

intentusnet run --intent DeployIntent --payload @deploy.json

case $? in
0) echo "Success" ;;
4) echo "Agent failed, check logs" ;;
5) echo "Policy denied, check permissions" ;;
*) echo "Unexpected error: $?" ;;
esac

Piping and Filtering​

CLI output is designed for Unix tooling:

# List failed executions
intentusnet inspect --list | jq '.[] | select(.status == "error")'

# Extract execution IDs
intentusnet inspect --list --format json | jq -r '.[].execution_id'

# Count by intent
intentusnet inspect --list --format json | jq -r '.[].intent' | sort | uniq -c

# Grep for specific errors
intentusnet inspect exec-a1b2c3d4 | grep -i "timeout"

SSH-Friendly​

All commands work over SSH:

# Remote execution
ssh prod-server "intentusnet run --intent HealthCheck"

# Remote inspection
ssh prod-server "intentusnet inspect --list --status error"

# Remote replay
ssh prod-server "intentusnet replay exec-a1b2c3d4"

Configuration File​

Create .intentusnet.yaml:

records_path: /var/lib/intentusnet/records
log_level: INFO
default_format: json

runtime:
enable_recording: true
timeout_ms: 30000

policy:
default_action: deny

Use with:

intentusnet --config /path/to/.intentusnet.yaml run --intent ProcessIntent

Environment Variables​

VariableDescriptionDefault
INTENTUSNET_RECORDS_PATHExecution records directory.intentusnet/records
INTENTUSNET_LOG_LEVELLogging levelINFO
INTENTUSNET_FORMATDefault output formatjson
INTENTUSNET_CONFIGConfig file path.intentusnet.yaml

Help​

Get help for any command:

intentusnet --help
intentusnet run --help
intentusnet inspect --help

Next Steps​