The Trinity Beast — Kiro Command Center (KCC)

How Kiro operates The Trinity Beast Infrastructure — pre-built API routines, deployment automation, and session-persistent context.

Operator: Kiro (AI Development Environment) Script: scripts/kcc.sh Steering: .kiro/steering/kiro-command-center.md Updated: April 2026

Table of Contents

1. What Is the Kiro Command Center?

The Kiro Command Center (KCC) is a set of pre-built operational routines that Kiro uses to manage The Trinity Beast Infrastructure (TBI). It consists of a bash script (scripts/kcc.sh) with 13 commands, a steering file (.kiro/steering/kiro-command-center.md) that loads automatically at the start of every session, and a live web dashboard at cpmp-site.org/docs/dashboard.html.

Instead of building curl commands from scratch for every health check, deployment, or verification, Kiro calls the KCC script. This eliminates repetitive command construction, ensures consistency, and reduces the chance of errors during operations.

In short: The TBCC is Cory's Command Center (browser-based, WebSocket relay to Neo). The KCC is Kiro's Command Center (script-based, direct API calls from the development environment). Both operate the same infrastructure through the same API endpoints with the same admin key.

2. Why It Exists

During a typical session, Kiro performs dozens of operations against The TBI — health checks after deployments, endpoint verification after code changes, cluster stats during monitoring, payment link status checks, and feed status reviews. Each of these requires:

Without the KCC, every operation is a hand-built curl command. With the KCC, it's a single call:

# Without KCC (manual)
curl -s -H "X-Admin-Key: tbmc-admin-..." https://api.cpmp-site.org/admin/cluster-stats | python3 -m json.tool

# With KCC (one command)
bash scripts/kcc.sh cluster-stats

The steering file ensures Kiro always has the admin key, resource names, and operational procedures loaded in context — even after a session restart or context compaction.

3. Architecture — Two Components

.kiro/steering/
  kiro-command-center.md — auto-loaded steering file (session context)
scripts/
  kcc.sh — executable bash script (13 commands)

Component 1 — Steering File

Located at .kiro/steering/kiro-command-center.md with inclusion: auto. This means it is loaded into Kiro's context at the start of every session — no manual activation required. It contains:

Component 2 — KCC Script

Located at scripts/kcc.sh. A standalone bash script that encapsulates all operational API calls. Each command:

4. Command Reference

All commands are invoked as bash scripts/kcc.sh <command>.

health

Checks all services — LPO health, LRS health, and cluster stats (3/3 nodes reporting). This is the first command run after every ECS deployment.

bash scripts/kcc.sh health

# Output:
# LPO:  ✅ [LPO] [us-east-2] [BeastMirror] [/health] [200]
# LRS:  ✅ [LRS] [us-east-2] [BeastLRS] [/health] [200]
# Cluster: Nodes: 3/3
#   BeastMain: published 2026-04-26T19:04:29Z
#   BeastMirror: published 2026-04-26T19:04:29Z
#   BeastLRS: published 2026-04-26T19:04:28Z

sync-check

Verifies the last nightly sync job ran successfully. Pulls the most recent log stream from CloudWatch (/aws/ecs/trinity-beast-sync) and displays run time (EST), completion status, duration, cache totals, and per-category sync counts (price logs, usage logs, API keys, app params, cleanup). Run this every morning right after health.

bash scripts/kcc.sh sync-check

# Output:
# Run Time:   April 28, 2026 at 01:00 AM EST
#
# Status:     ✅ Sync complete
# Duration:   186.909018ms
# Cache:      3285260 logs in Cache
#
# Sync Results:
#   Price logs:    72 new logs loaded
#   Usage logs:    19 entries written to Cache
#   API keys:      2 keys written to Cache
#   App params:    60 params written to Cache
#   Cleanup:       🟢 Pruned 0 old logs (>93 days)

verify

Hits 16 key endpoints (6 public + 10 admin) and reports the HTTP status code for each. Used after major changes to confirm nothing is broken.

bash scripts/kcc.sh verify

# Output:
# Public Endpoints:
#   ✅ GET /health (LPO) — 200
#   ✅ GET /health (LRS) — 200
#   ✅ GET /exchanges — 200
#   ✅ GET /asset-categories — 200
#   ...
# Admin Endpoints:
#   ✅ GET /admin/config — 200
#   ✅ GET /admin/cluster-stats — 200
#   ...

cluster-stats

Returns the full cluster-wide metrics snapshot — all 24 counters aggregated across all 3 containers via ElastiCache pipeline read.

bash scripts/kcc.sh cluster-stats

payment-links

Shows all 16 payment links with their enabled status, click counts, and Stripe URLs. Used to verify link configuration before and after Stripe setup.

bash scripts/kcc.sh payment-links

# Output:
# Total: 16 links
# Type            Tier                 Enabled    Clicks   URL
# subscription    pro                  ✅          42       https://buy.stripe.com/xxx...

feed-status

Shows the connection status of all 6 exchange WebSocket feeds with subscription counts and stale asset counts.

bash scripts/kcc.sh feed-status

# Output:
# coinbase_ws     ✅ Connected          Subs: 12  Stale: 0
# gemini_ws       ✅ Connected          Subs: 12  Stale: 0
# kraken_ws       ✅ Connected          Subs: 12  Stale: 0
# gateio_ws       ✅ Connected          Subs: 12  Stale: 0
# bybit_ws        ✅ Connected          Subs: 12  Stale: 0
# okx_ws          ✅ Connected          Subs: 12  Stale: 0

deploy-ecs

Full ECS deployment pipeline — Docker build (no-cache), ECR tag, ECR push, force deploy all 3 services. The most common deployment command.

bash scripts/kcc.sh deploy-ecs

# Builds → Tags → Pushes → Force deploys main, mirror, LRS
# Then: bash scripts/kcc.sh health (after ~40s)

deploy-site <file(s)>

Uploads HTML files to S3 and invalidates CloudFront. Automatically strips the cpmp-redesign/ prefix to determine the S3 path.

bash scripts/kcc.sh deploy-site cpmp-redesign/docs/Trinity-Beast-API-Reference.html
bash scripts/kcc.sh deploy-site cpmp-redesign/subscribe-listener.html cpmp-redesign/docs/index.html

profiles

Lists all 16 system profiles with their key parameters (QPS, burst, TTL, DB pool size).

bash scripts/kcc.sh profiles

config

Shows the current application parameters — cache TTL, prewarm intervals, pool sizes, demo key, etc.

bash scripts/kcc.sh config

daily-collect

Collects all infrastructure metrics (endpoints, feeds, cluster, Valkey, Lambda, sync, SQS queue, website analytics) and stores them as a single JSON blob in Valkey (kcc:daily key, 24h TTL). This is the data source for both the CLI daily command and the KCC Live Dashboard.

bash scripts/kcc.sh daily-collect

daily

Renders the compact daily status dashboard from the Valkey cache. If no cached data exists, it auto-runs daily-collect first. Shows services, ECS nodes, Valkey health, Lambda, nightly sync, SQS queue depth, and 7-day website analytics.

bash scripts/kcc.sh daily

# Output:
# ════════════════════
#  KCC — May 02 02:11PM EDT
# ════════════════════
# ─── Services ───
# ✅ LPO  ✅ LRS  ✅ Web
# Cluster: 3/3
# ─── SQS Usage Queue ───
# ✅ Pending: 0  In-flight: 0
# ─── Website (7d) ───
# Total 14,250 2.2GB  Avg 2,035/day

security

Security dashboard — CloudFront WAF (24h blocks), API WAF (per-rule breakdown), GuardDuty threat detection, CloudWatch security alarms, and application rate limiting stats.

bash scripts/kcc.sh security

5. Steering File — Session Context

The steering file at .kiro/steering/kiro-command-center.md is marked with inclusion: auto, which means it is loaded into Kiro's context automatically at the start of every session. This ensures Kiro always has access to:

InformationPurpose
Admin API KeyAuthenticate against all admin endpoints without asking
LPO / LRS Base URLsConstruct API calls without looking up DNS
S3 Bucket NameDeploy website files to the correct bucket
CloudFront Distribution IDInvalidate the CDN cache after deployments
ECR RepositoryPush Docker images to the correct registry
ECS Cluster + Service NamesForce deploy the correct services
Operational RulesAlways health check after deploy, always verify after changes

Context Persistence: Even if the conversation is compacted due to context window limits, the steering file is reloaded automatically. This means Kiro never loses access to the operational essentials — the admin key, resource names, and procedures survive context compaction.

6. Typical Workflow

A typical day starts with a morning check, then moves into the code change → deploy → verify cycle:

Morning Check

  1. Daily collect + renderbash scripts/kcc.sh daily-collect then bash scripts/kcc.sh daily (full infrastructure snapshot — services, ECS, Valkey, Lambda, sync, SQS queue, analytics)
  2. Health checkbash scripts/kcc.sh health (confirm 3/3 nodes, per-container status, LPO + LRS connectivity)
  3. Review dashboardcpmp-site.org/docs/dashboard.html (visual dashboard with auto-refresh)

Code Change → Deploy → Verify

  1. Make code changes — edit Go handlers, HTML pages, or documentation
  2. Build and verify locallygo build ./cmd/server/
  3. Deploy to ECSbash scripts/kcc.sh deploy-ecs
  4. Wait ~40 seconds for ECS rolling deployment
  5. Health checkbash scripts/kcc.sh health (confirm 3/3 nodes)
  6. Verify endpointsbash scripts/kcc.sh verify (confirm all 200s)
  7. Deploy website changesbash scripts/kcc.sh deploy-site cpmp-redesign/docs/...

This entire cycle takes about 3 minutes of active work plus ~40 seconds of waiting for ECS. Without the KCC, each step would require constructing individual commands with the correct URLs, headers, and parameters.

7. KCC Live Dashboard

The KCC Live Dashboard is a browser-based visual interface at cpmp-site.org/docs/dashboard.html that renders the same data collected by daily-collect. It provides:

Auto-Refresh: The dashboard has a 30-second auto-refresh toggle. When enabled, it pulls live data from the admin endpoints (services, feeds, cluster, ECS) and preserves AWS-side metrics (Lambda, sync, analytics, SQS) from the last CLI collect. A green freshness dot indicates data age.

The dashboard is also linked from the TBCC CloudWatch Monitoring widget for quick access during operations.

8. KCC vs TBCC — Two Command Centers

The Trinity Beast Infrastructure has two command centers, each designed for a different operator:

AspectTBCC (Cory's)KCC (Kiro's)
OperatorCory Dean KalaniKiro (AI Development Environment)
InterfaceBrowser-based dashboardBash script + steering file + Live Dashboard
Access MethodWebSocket relay to Neo MacBookDirect API calls from dev environment
TerminalBuilt-in browser terminalIDE terminal (Kiro's tool execution)
WidgetsNewsletter, Support, Email, CloudWatch, Stripe, Testing, AWS Ops, Partners, Exchange Manager, Cluster Health10 bash commands covering health, sync, verify, deploy, stats
AuthenticationAdmin key stored in localStorageAdmin key in steering file (auto-loaded)
DeploymentCopy commands → paste in local terminalDirect execution via deploy-ecs and deploy-site
PersistenceBrowser sessionSteering file survives context compaction
URLcpmp-site.org/admin/trinity-beast-command-center.htmlscripts/kcc.sh

Same API, different interfaces. Both command centers call the same endpoints with the same admin key. The TBCC is optimized for visual monitoring and manual operations. The KCC is optimized for automated, repeatable operations during development sessions.

8. API Endpoints Used

The KCC calls these endpoints through the unified messaging envelope. All admin endpoints require the X-Admin-Key header.

CommandEndpoints CalledAuth
healthGET /health (LPO + LRS), GET /admin/cluster-statsNone + Admin
sync-checkCloudWatch Logs: describe-log-streams, get-log-events on /aws/ecs/trinity-beast-syncAWS credentials
verify16 endpoints (6 public + 10 admin)Mixed
cluster-statsGET /admin/cluster-statsAdmin
payment-linksGET /admin/payment-linksAdmin
feed-statusGET /admin/feed-statusAdmin
deploy-ecsDocker + ECR + ECS (AWS CLI, not HTTP)AWS credentials
deploy-siteS3 + CloudFront (AWS CLI, not HTTP)AWS credentials
profilesGET /admin/profilesAdmin
configGET /admin/configAdmin