Skip to content

feat: add status CLI commands#29

Merged
arimxyer merged 3 commits intomainfrom
feat/status-cli
Mar 23, 2026
Merged

feat: add status CLI commands#29
arimxyer merged 3 commits intomainfrom
feat/status-cli

Conversation

@arimxyer
Copy link
Copy Markdown
Owner

Summary

  • Adds CLI interface for provider health monitoring, mirroring the existing agents and benchmarks CLI patterns
  • models status list — interactive picker (TTY) or comfy-table (non-TTY) showing tracked provider health
  • models status show <provider> — detailed provider status with components, incidents, and maintenance
  • models status status — quick summary table of tracked providers (always table, even on TTY)
  • models status sources — interactive picker to manage which providers to track (persists to config)
  • All commands support --json output
  • Respects tracked provider selection from user config
  • Reuses existing StatusFetcher pipeline with parallel fetching (10 concurrent)
  • Preview panel prioritizes incidents over components when issues are active
  • Cloudflare component lists capped (20 in show, 8 in picker) to manage verbosity

Test plan

  • models status list — verify interactive picker shows only tracked providers
  • models status list --json — verify JSON output
  • models status show openai — verify detailed output with components/incidents
  • models status show openai --json — verify JSON detail output
  • models status status — verify summary table
  • models status sources — verify picker toggles and persists to config
  • models status sources --json — verify source listing
  • Non-TTY: models status list | cat — verify table output
  • mise run fmt && mise run clippy && mise run test — all passing (264 tests)

🤖 Generated with Claude Code

arimxyer and others added 3 commits March 23, 2026 12:51
Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Add tab-specific design convention rules for each TUI tab (models,
agents, benchmarks, status) and a CLI style guide covering colors,
picker infrastructure, and output formatting. Clean up the shared
TUI style guide: remove resolved inconsistencies section, fix help
popup docs, add search scope descriptions, note ScrollablePanel
styled title support.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Add CLI interface for provider health monitoring:
- `status list` — interactive picker (TTY) or table (non-TTY)
- `status show <provider>` — detailed provider status view
- `status status` — quick summary table of tracked providers
- `status sources` — interactive picker to manage tracked providers
- All commands support --json output
- Respects tracked provider config (only shows tracked providers)
- Reuses existing StatusFetcher pipeline (parallel fetching)

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
@arimxyer arimxyer merged commit f8642c1 into main Mar 23, 2026
3 checks passed
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: af08ee7fb4

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +29 to +30
#[command(name = "status")]
#[command(about = "Check AI provider service health")]
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Wire up the documented status entrypoint

This parser is named and documented as a standalone status command, but main still only special-cases agents and benchmarks (src/main.rs:178-193) and models link still installs only those two symlinks (src/cli/link.rs:5-32). If a user follows these examples or manually symlinks the binary as status, status list is parsed as the top-level models list command because the first real arg is just list, so the new status CLI is unreachable outside models status ....

Useful? React with 👍 / 👎.

})
.collect();

if let Some(updated) = run_source_picker(&items)? {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Add a non-interactive fallback for status sources

In a non-TTY context such as models status sources | cat or CI output capture, this branch still drops into run_source_picker(), which always constructs PickerTerminal and enables raw mode (src/cli/picker.rs:29-37). Unlike status list and agents list-sources, there is no styles::is_tty() guard here, so the new command fails instead of degrading cleanly when stdout is redirected.

Useful? React with 👍 / 👎.

Comment on lines +129 to +131
components: Vec<ComponentJson<'a>>,
incidents: Vec<IncidentJson<'a>>,
scheduled_maintenances: Vec<MaintenanceJson<'a>>,
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve detail availability in status show --json

For providers whose upstream only exposes summary data, or when a detail fetch fails, ProviderStatus uses the parallel components_state, incidents_state, and scheduled_maintenances_state fields to distinguish NoneReported from Unsupported/FetchFailed (src/status/types.rs:554-559). This JSON shape drops those fields, so models status show --json can only emit empty arrays, which makes downstream tooling silently interpret “detail unavailable” as “no incidents/components/maintenance”.

Useful? React with 👍 / 👎.

arimxyer added a commit that referenced this pull request Mar 23, 2026
Add user-configurable alias names for symlink commands via [aliases]
section in config.toml. Default aliases: agents, benchmarks, mstatus.
Users can override any alias name in their config. Also adds status
as a third symlink target (default name mstatus to avoid collision
with system commands).

- Add AliasesConfig struct with serde defaults for backward compat
- Add AliasKind enum for routing, match_alias() and alias_names() helpers
- Refactor link.rs to read alias names from config instead of hardcoded const
- Update main.rs argv[0] detection to use config-driven matching
- Add cli::status::run() for standalone status alias invocation
- Fix link canonicalization bug (PR #28 review)
- Fix link removal safety (verify symlink target before removing)
- Add non-TTY fallback for status sources command (PR #29 review)
- Add detail state metadata to status show --json output (PR #29 review)

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
@arimxyer arimxyer deleted the feat/status-cli branch March 31, 2026 17:14
arimxyer added a commit that referenced this pull request Mar 31, 2026
arimxyer added a commit that referenced this pull request Mar 31, 2026
Add user-configurable alias names for symlink commands via [aliases]
section in config.toml. Default aliases: agents, benchmarks, mstatus.
Users can override any alias name in their config. Also adds status
as a third symlink target (default name mstatus to avoid collision
with system commands).

- Add AliasesConfig struct with serde defaults for backward compat
- Add AliasKind enum for routing, match_alias() and alias_names() helpers
- Refactor link.rs to read alias names from config instead of hardcoded const
- Update main.rs argv[0] detection to use config-driven matching
- Add cli::status::run() for standalone status alias invocation
- Fix link canonicalization bug (PR #28 review)
- Fix link removal safety (verify symlink target before removing)
- Add non-TTY fallback for status sources command (PR #29 review)
- Add detail state metadata to status show --json output (PR #29 review)

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant