01Run it
Replace the <placeholders> with your own values, or use the builder below.
p202 system db-stats02What you get
Captured from the real binary, run against a demo store with 30 days of traffic. Switch tabs to see the same run as JSON, the shape scripts and agents parse.
$ p202 system db-stats database_size_bytes: 125992960 database_size_mb: 120.16 tables: [{"label":"Clicks","rows_estimate":3057,"table":"202_clicks"},{"label":"Conversions","rows_estimate":166,"table":"202_conversion_logs"},{"label":"Campaigns","rows_estimate":7,"table":"202_aff_campaigns"},{"label":"Affiliate Networks","rows_estimate":4,"table":"202_aff_networks"},{"label":"PPC Accounts","rows_estimate":6,"table":"202_ppc_accounts"},{"label":"Trackers","rows_estimate":17,"table":"202_trackers"},{"label":"Landing Pages","rows_estimate":3,"table":"202_landing_pages"},{"label":"Rotators","rows_estimate":1,"table":"202_rotators"},{"label":"Users","rows_estimate":1,"table":"202_users"},{"label":"Data Engine","rows_estimate":3013,"table":"202_dataengine"},{"label":"Attribution Models","rows_estimate":3,"table":"202_attribution_models"}]
$ p202 system db-stats --json { "data": { "database_size_bytes": 125992960, "database_size_mb": 120.16, "tables": [ { "label": "Clicks", "rows_estimate": 3057, "table": "202_clicks" }, { "label": "Conversions", "rows_estimate": 166, "table": "202_conversion_logs" }, { "label": "Campaigns", "rows_estimate": 7, "table": "202_aff_campaigns" }, { "label": "Affiliate Networks", "rows_estimate": 4, "table": "202_aff_networks" }, { "label": "PPC Accounts", "rows_estimate": 6, "table": "202_ppc_accounts" }, { "label": "Trackers", "rows_estimate": 17, "table": "202_trackers" }, { "label": "Landing Pages", "rows_estimate": 3, "table": "202_landing_pages" }, { "label": "Rotators", "rows_estimate": 1, "table": "202_rotators" }, { "label": "Users", "rows_estimate": 1, "table": "202_users" }, { "label": "Data Engine", "rows_estimate": 3013, "table": "202_dataengine" }, { "label": "Attribution Models", "rows_estimate": 3, "table": "202_attribution_models" } ] } }
03Build your command
Pick values and the command line writes itself, quoted and ready to paste.
p202 system db-statsSet flags below; the command updates as you type.
04For agents
Running this from an agent
- Read the same facts as JSON:
p202 commands system db-stats --json. - With
AI_AGENT,CLAUDECODEor another agent variable set, output is compact JSON and errors arrive on stderr as a JSON envelope with ahint. - Exit codes: 0 ok, 1 bad input, 2 auth, 3 network, 4 server error, 5 partial failure.
{
"path": "p202 system db-stats",
"use": "db-stats",
"short": "Show database table statistics",
"runnable": true
}