pi-onedev-toolkit

Lightweight OneDev integration for Pi via TOD: repo-aware issue, pull request, build, and watch tools

Packages

Package details

extensionskill

Install pi-onedev-toolkit from npm and Pi will load the resources declared by the package manifest.

$ pi install npm:pi-onedev-toolkit
Package
pi-onedev-toolkit
Version
0.2.0
Published
Aug 26, 2026
Downloads
143/mo · 143/wk
Author
alpertarhan
License
MIT
Types
extension, skill
Size
89.3 KB
Dependencies
1 dependency · 3 peers
Pi manifest JSON
{
  "extensions": [
    "./extensions"
  ],
  "skills": [
    "./skills"
  ]
}

Security note

Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.

README

pi-onedev-toolkit

Lightweight OneDev integration for Pi, built on the official TOD CLI: repo-aware issue, pull request, build, and one-shot watch tools plus issue-to-PR and PR-review skills.

The agent never sees tokens. The extension invokes tod with structured arguments, resolves the OneDev project from the repository's git remotes, and keeps unavailable domain schemas out of the default prompt. Model-facing multiword parameters use strict snake_case; unknown parameters are rejected instead of being silently ignored.

Requirements

  • OneDev 15.1+
  • The tod CLI installed and configured:
curl -fsSL https://code.onedev.io/onedev/tod/~raw/main/install.sh | bash
tod config set   # server-url + access-token (or set ONEDEV_SERVER_URL / ONEDEV_ACCESS_TOKEN)

Install

pi install npm:pi-onedev-toolkit
# or from source
pi install git:github.com/alpertarhan/pi-onedev-toolkit

When the current directory is a OneDev repository, the status line shows the active project. onedev_context action setup explains missing TOD configuration, credentials, or project remotes; /od-health performs an authenticated re-check. Use /od-settings to enable or disable the footer for the current session branch.

Tools

Tool Domains Covers
onedev_context (always active) Readiness, authenticated health, login, and setup guidance
onedev_tools (always active) Activate only the issue, pull, build, and watch domains needed now
onedev_issue issue Query/get/comment issues, change fields/labels/state, log work, issue branches
onedev_pull pull PR metadata/comments/code comments/labels/builds/patch, create/edit, reply/resolve review comments, approve, request changes, merge/discard
onedev_build build Build queries, logs, code-problem and unit-test reports, changes since success, jobs, build-spec validation/upgrades
onedev_watch watch One-shot build-result and pull-attention notifications; list/stop active session watches

Lazy by design: domain tools activate only through onedev_tools, keeping the default tool list and system prompt light. Activation performs the first authenticated check and returns the server, project, and login context in the same response.

Remote and local mutations use Pi's real interactive approval UI. An approval can apply once, for the session, or persist for the exact server/project/operation in ~/.pi/agent/onedev-toolkit.json; remove that file to revoke all saved approvals. Non-interactive sessions reject unapproved mutations. build run in local mode uses an isolated temporary Git index so TOD cannot leave the user's index staged; check_spec is treated as a mutation because TOD may upgrade .onedev-buildspec.yml.

Watches are session-scoped and one-shot. They use one timer, bounded polling, expiration and backoff, and wake the agent with metadata only. The agent retrieves logs, comments, or build details with the corresponding read tool. At most ten watches may be active; session changes and shutdown clear them.

Attachment download is intentionally not exposed: current TOD releases may send the OneDev bearer token to an absolute external Markdown URL and do not provide a safe download-size/overwrite boundary.

Commands

  • /od-context — active server, inferred project, login
  • /od-health — re-check tod configuration and server reachability
  • /od-settings — enable or disable the OneDev footer status in the TUI

Compatibility notes

  • Update TOD regularly from its upstream install script. get_unit_test_report reports an actionable upgrade error when the installed TOD predates that command.
  • Plain references require the current repository to have a OneDev remote from which TOD can infer the project. The toolkit reports no_project rather than pretending a qualified reference can bypass TOD's resolver.
  • Tool calls use snake_case, for example for_code_review, target_branch, report_name, and interval_seconds.

Skills

  • onedev-issue-to-pr — gather issue context, branch, implement, present for review, then push and open the PR
  • onedev-pr-review — full-context PR review with line-anchored findings; submits only on explicit request

Development

bun install
bun run check   # typecheck + vitest
bun run scripts/smoke.ts  # optional read-only live smoke; see CONTRIBUTING.md

License

MIT