Skip to content

Feature Pitch: Native iOS Companion App & WidgetKit Extension #439

@m1kewong

Description

@m1kewong

Summary
This is a proposal to add a native iOS companion app and WidgetKit extension to CodexBar, allowing users to monitor their code-gen service usage directly from their iPhone and iPad, both on the home screen and within a dedicated app.

This builds on the motivation from Issue #319 (codexbar serve), which highlighted the demand for remote access. I initially built this to solve my own need: when experimenting with OpenClaw via Telegram while away from my desk, I wanted a simple way to monitor token usage from my phone in real time. While an HTTP server provides a solid cross-platform solution, a native iOS app delivers a more seamless experience for Apple ecosystem users — including home screen widgets for at-a-glance usage visibility, live data sync via direct API calls, a native SwiftUI interface, and secure credential storage in the iOS Keychain.

Implementation Status (Proof of Concept)
I have a working proof-of-concept on branch codex/ios-widget-port — tested on a real device.

Architecture:

  • CodexBariOSApp: A full SwiftUI application for iOS 17+.
  • CodexBariOSWidget: A WidgetKit extension for home screen widgets.
  • CodexBariOSShared: A new shared Swift package module for iOS-compatible logic, including snapshot decoding and live provider refresh.
  • XcodeGen: The iOS project is generated via a project.yml file for easy maintenance.

What's Working:

  • Full iOS App & Widget scaffold builds and runs on device and simulator.
  • GitHub Copilot: Full device-flow authentication and live usage refresh.
  • Codex (ChatGPT): Full device-flow OAuth and live usage refresh.
  • 10+ Other Providers: Live refresh for Claude, Cursor, Gemini, Vertex AI, OpenCode, Augment, Factory, Amp, z.ai, MiniMax, Kimi K2, and Synthetic — using credentials stored in the iOS Keychain.
  • Data parity with the macOS app via the same WidgetSnapshot model and App Group container.

Known Gaps:

  • Providers that rely on local macOS processes or file access are not live on iOS (e.g., JetBrains, Antigravity). The widget can still display the last synced data from the desktop app.

Path to Contribution
The work is substantial (~110 files, +9,000 lines), but well-encapsulated within the ios/ directory and the new CodexBariOSShared module, with minimal impact on the existing macOS target.
Before opening a large PR, I wanted to pitch this here to gauge interest from @steipete and the community. Happy to clean up the branch and submit a formal PR if this is a direction you'd like to take CodexBar.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions