Problem Statement:
Currently, CLI tools built on the apcore framework (such as aisee-cli) that require user authentication often implement the Device Authorization Flow (RFC 8628) in a fragmented and redundant manner. Developers have to manually code the logic for:
- Requesting device/user codes from the Auth server.
- Displaying verification instructions to the user.
- Managing the asynchronous polling state to retrieve tokens.
- Handling token persistence, expiration checks, and silent background refreshes.
This leads to a lack of consistency in User Experience (UX) across different tools and increases the risk of insecure token handling.
Proposed Solution:
Integrate a first-class, configuration-driven Authentication capability into apcore-cli.
- Declarative Configuration: Allow developers to enable authentication by simply providing Auth Server endpoints (device code, token, refresh) in the CLI configuration.
- Standardized UI/UX: Provide a built-in login command handler that manages terminal output (e.g., using ora for polling status, chalk for user-code highlighting, and
open for browser invocation).
- Automatic Token Lifecycle: The framework should automatically handle the storage of Access and Refresh tokens (standardized per OS), validate token expiry before
command execution, and perform silent refreshes without business logic intervention.
- Architectural Separation: Implement the core protocol logic within apcore-toolkit for platform-agnostic reuse, while keeping the interactive UI components within
apcore-cli.
Value Proposition:
- Developer Efficiency: Reduces the "Time-to-Hello-World" for authenticated CLIs from hours to minutes.
- Security by Design: Centralizes sensitive token management within the framework, reducing the attack surface.
- Unified UX: Ensures a consistent and professional login experience across the entire apcore ecosystem.
Problem Statement:
Currently, CLI tools built on the apcore framework (such as aisee-cli) that require user authentication often implement the Device Authorization Flow (RFC 8628) in a fragmented and redundant manner. Developers have to manually code the logic for:
This leads to a lack of consistency in User Experience (UX) across different tools and increases the risk of insecure token handling.
Proposed Solution:
Integrate a first-class, configuration-driven Authentication capability into apcore-cli.
open for browser invocation).
command execution, and perform silent refreshes without business logic intervention.
apcore-cli.
Value Proposition: