docs/DEVELOPMENT.md
# Full build, package, and launch (recommended)
./Scripts/compile_and_run.sh
# Also run swift test before packaging/relaunching
./Scripts/compile_and_run.sh --test
# Just build and package (no tests)
./Scripts/package_app.sh
# Launch existing app (no rebuild)
./Scripts/launch.sh
Sources/CodexBar/./Scripts/compile_and_run.sh --test to test, rebuild, and launch~/Library/Logs/CodexBar/CodexBar.log (verbosity defaults to "Verbose")You'll see one keychain prompt per stored credential on the first launch. This is a one-time migration that converts existing keychain items to use kSecAttrAccessibleAfterFirstUnlockThisDeviceOnly.
The migration flag is stored in UserDefaults, so migrated CodexBar-owned items should not prompt again. Ad-hoc
signing can still prompt for other keychain surfaces; use ./Scripts/compile_and_run.sh --clear-adhoc-keychain
when you intentionally want to reset ad-hoc keychain state.
ThisDeviceOnly accessibility to prevent promptsdefaults delete com.steipete.codexbar KeychainMigrationV1Completed
CodexBar checks Augment through the provider fetch pipeline. Auto mode tries the Augment CLI first, then the browser-cookie web path. The web path reuses cached cookies when possible and imports from supported browsers when the cache is missing or rejected.
If automatic import fails:
CodexBar/
├── Sources/CodexBar/ # Main app (SwiftUI + AppKit)
│ ├── CodexBarApp.swift # App entry point
│ ├── StatusItemController.swift # Menu bar icon
│ ├── UsageStore.swift # Usage data management
│ ├── SettingsStore.swift # User preferences
│ ├── Providers/ # Provider-specific code
│ │ ├── Augment/ # Augment Code integration
│ │ ├── Claude/ # Anthropic Claude
│ │ ├── Codex/ # OpenAI Codex
│ │ └── ...
│ └── KeychainMigration.swift # One-time keychain migration
├── Sources/CodexBarCore/ # Shared business logic
├── Tests/CodexBarTests/ # XCTest suite
└── Scripts/ # Build and packaging scripts
UsageProvider case in Sources/CodexBarCore/Providers/Providers.swiftSources/CodexBarCore/Providers/YourProvider/Sources/CodexBar/Providers/YourProvider/ProviderImplementationRegistryResources/ProviderIcon-yourprovider.svg./Scripts/compile_and_run.sh.subsystem:com.steipete.codexbar category:augment[augment-cookie] prefixswift test
swiftformat Sources Tests
swiftlint --strict
./Scripts/package_app.sh
# Creates: CodexBar.app (Developer ID by default; set CODEXBAR_SIGNING=adhoc for ad-hoc signing)
./Scripts/sign-and-notarize.sh
# Creates: CodexBar-<version>.zip and CodexBar-<version>.dSYM.zip
See docs/RELEASING.md for full release process.
# Check crash logs
ls -lt ~/Library/Logs/DiagnosticReports/CodexBar* | head -5
# Check Console.app for errors
# Filter: process:CodexBar
# Verify migration completed
defaults read com.steipete.codexbar KeychainMigrationV1Completed
# Should output: 1
# Check migration logs
log show --predicate 'category == "keychain-migration"' --last 5m
~/.codexbar/config.json for provider settings, manual cookies, and stored API keys