Command Reference
insight
Manage service insights.
List Insights
insight --list [--service <name>] [--type <type>]
| Parameter | Description |
|---|---|
--service |
Filter by service name |
--type |
Filter by type: PROFILE, OVERVIEW, CACHEABILITY |
--page |
Page number |
--page-size |
Items per page |
--sort |
Sort criteria |
Example:
insight --list --service user-svc --type PROFILE
Show Insight
insight --show <insight-id>
Example:
insight --show abc-123-def-456
Get Latest
insight --latest --service <name> --type <type>
Example:
insight --latest --service user-svc --type CACHEABILITY
Preview Orchestration
insight --preview [--pending-only]
| Parameter | Description |
|---|---|
--pending-only |
Show only EXECUTE decisions |
Example:
insight --preview --pending-only
Run Orchestration
insight --orchestrate [--yes]
Runs full orchestration for all services.
Execute Decision
insight --execute --decision-id <id>
Executes a specific decision from preview.
Re-execute Insight
insight --reexecute --service <name> --type <type> [--from <date>] [--to <date>]
Force re-execution of an insight.
call
Manage API call records.
List Calls
call --list [--service <name>] [--result-type <type>]
| Parameter | Description |
|---|---|
--service |
Filter by service |
--result-type |
Filter: SUCCESS, ERROR, UNKNOWN |
Show Call
call --show <call-id> [--with-payload]
| Parameter | Description |
|---|---|
--with-payload |
Include request/response bodies |
Get Samples
call --samples --service <name> [--sample-count <n>]
Get representative call samples for a service.
ingest
Ingest call data from files.
Basic Ingestion
ingest --input <path>
Advanced Options
ingest --input "data/*.json" \
--batch-size 1000 \
--threads 4 \
--format json
| Parameter | Description | Default |
|---|---|---|
--input |
File path or glob pattern | (required) |
--format |
File format: json | json |
--batch-size |
Records per batch | 1000 |
--threads |
Parallel threads | 1 |
--limit |
Max records to process | unlimited |
--date |
Override call date | from file |
--no-compression |
Disable payload compression | false |
--retries |
Retry count on failure | 3 |
Progress Output
Ingesting: data/calls-20240115.json
Progress: 45,000 / 100,000 (45%)
Rate: 5,000 calls/sec
jobs
Monitor async jobs.
List Jobs
jobs --list [--status <status>] [--type <type>]
| Parameter | Description |
|---|---|
--status |
Filter: PENDING, RUNNING, SUCCEEDED, FAILED |
--type |
Filter: PIPELINE, INGEST |
Show Job
jobs --show <job-id>
stats
Display data statistics.
Service Statistics
stats [--service <name>]
Output:
Service Statistics
──────────────────
Total Services: 15
Total Calls: 1,234,567
Date Range: 2024-01-01 to 2024-01-15
delete
Delete resources.
Delete Insight
delete insight <id> [--yes]
Delete Calls
delete calls --service <name> [--from <date>] [--to <date>] [--yes]
sync
Synchronize data with the server.
sync
Forces a synchronization of services and statistics from the server.
token
Manage API tokens.
List Tokens
token --list
Show Token
token --show <token-id>
Create Token
token --create --name <name> [--description <desc>] [--role <role>] [--expiry-days <days>]
| Parameter | Description | Default |
|---|---|---|
--name |
Token name | (required) |
--description |
Token description | none |
--role |
Role: MASTER, USER, INGESTOR, VIEWER | USER |
--expiry-days |
Days until expiration | 30 |
Example:
token --create --name "CI Pipeline" --role USER --expiry-days 90
Revoke Token
token --revoke <token-id> [--yes]
Activate Token
token --activate <token-id> [--yes]
Reactivates a revoked token.
Delete Token
token --delete <token-id> [--yes]
Permanently deletes a token.
whoami
Display current token information.
whoami
Output:
Token Information
─────────────────
ID: tok_abc123
Name: CLI Token
Role: USER
Created: 2024-01-01T00:00:00Z
Expires: 2024-12-31T23:59:59Z
help
Display help information.
General Help
help
Command Help
help insight
help call --list
history
Display command history.
history [--limit <n>]
quit / exit
Exit the CLI.
quit
Scripting Examples
Export All Insights to JSON
servicehop-cli --quiet insight --list --output json > insights.json
Run Orchestration Non-Interactively
servicehop-cli insight --orchestrate --yes
Ingest Multiple Files
for file in data/*.json; do
servicehop-cli ingest --input "$file"
done
Check Job Status
servicehop-cli jobs --show $JOB_ID --output json | jq '.status'
Generate Report
#!/bin/bash
echo "# ServiceHop Report - $(date)"
echo ""
echo "## Statistics"
servicehop-cli stats --output form
echo ""
echo "## Recent Insights"
servicehop-cli insight --list --page-size 10 --sort -timestamp