feat(browser): add ONES adapter support for tasks and worklog commands#386
Open
2hangchen wants to merge 1 commit intojackwener:mainfrom
Open
feat(browser): add ONES adapter support for tasks and worklog commands#3862hangchen wants to merge 1 commit intojackwener:mainfrom
2hangchen wants to merge 1 commit intojackwener:mainfrom
Conversation
Add ONES auth/session commands, task listing/details utilities, and worklog operations, with related docs and helper utilities.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What is ONES?
ONES(ones.com) is a project management / R&D collaboration platform (tasks, projects, work items, and time tracking). Many teams use self-hosted or SaaS deployments with browser-based login. This PR adds an OpenCLI adapter that calls the ONES Project API (legacy / “project open API” style endpoints) using the user’s already authenticated Chrome session via Browser Bridge, so CLI workflows can reuse the same cookies/session as the web UI.
Summary
Introduces an ONES site adapter for OpenCLI. Requests run in-page with fetch and credentials: 'include' against ONES_BASE_URL, matching the origin you have open in Chrome. Optional ones login supports scripted authentication when needed; otherwise you can rely on logging in through the browser.
What’s included
Commands
Command Purpose
opencli ones login / logout Optional scripted login (auth/login); logout (auth/logout)
opencli ones me Current user profile (users/me)
opencli ones token-info Token / user / team summary (auth/token_info); useful for discovering team UUIDs
opencli ones tasks Team task list with filters (e.g. limit, project, assignee)
opencli ones my-tasks “My” tasks with modes (assign, field004, owner, both) for different field conventions
opencli ones task Single work item detail by UUID
opencli ones worklog Log or backfill hours (GraphQL addManhour with REST fallbacks where applicable)
Implementation
Shared helpers: base URL building, authenticated in-page fetch, user UUID resolution, manhour scaling (ONES_MANHOUR_SCALE), and utilities to enrich tasks with status/project labels where supported by the API.
Documentation
docs/adapters/browser/ones.md — Browser Bridge prerequisites, examples, and behavior notes
docs/adapters-doc/ones.md — Environment variables and quick command reference
Configuration
ONES_BASE_URL (required) — Same origin as your ONES tab in Chrome (no trailing slash).
Optional — ONES_USER_ID / ONES_AUTH_TOKEN if your deployment requires documented headers; ONES_TEAM_UUID to avoid repeating --team; credentials env vars for ones login as documented.
How to test
Install Browser Bridge, open Chrome, and log into your ONES instance.
export ONES_BASE_URL=.
opencli ones me and opencli ones token-info — confirm session and read team UUIDs.
opencli ones tasks and opencli ones my-tasks .
opencli ones task --team ; opencli ones worklog --team (use --date for backfill).