Skip to content

feat(browser): add ONES adapter support for tasks and worklog commands#386

Open
2hangchen wants to merge 1 commit intojackwener:mainfrom
2hangchen:feature_ones_broswer
Open

feat(browser): add ONES adapter support for tasks and worklog commands#386
2hangchen wants to merge 1 commit intojackwener:mainfrom
2hangchen:feature_ones_broswer

Conversation

@2hangchen
Copy link

@2hangchen 2hangchen commented Mar 24, 2026

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).

Add ONES auth/session commands, task listing/details utilities, and worklog operations, with related docs and helper utilities.
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