Skip to main content

CLI for Phabricator and Phorge review feedback workflows

Project description

phab-feedback

phab-feedback is a small command-line client for inspecting and acting on Phabricator and Phorge review feedback. It preserves inline replies as real inline-thread replies, keeps draft actions explicit, and writes structured JSON for people and automation.

How this differs

arc and moz-phab handle author-side Differential workflows such as creating or updating revisions from local commits. phabfive provides broader Conduit access across Phabricator and Phorge applications.

phab-feedback complements those tools by focusing on Differential feedback timelines, inline threads, explicit draft actions, and a few browser-only mutations that Conduit does not expose. Mozilla Review Helper support is kept separate from the generic behavior.

Install and quick start

Python 3.10 or newer is required. To run the PyPI package without installing it persistently:

uvx phab-feedback --help

For a persistent installation, use uv:

uv tool install phab-feedback
phab-feedback --help

pipx is a fallback when uv is unavailable:

pipx install phab-feedback
phab-feedback --help

Once a Phabricator host and Conduit token are available in ~/.arcrc, inspect a revision:

phab-feedback timeline D123

With uvx, use the same command without the persistent install:

uvx phab-feedback timeline D123

Configuration and credentials

Select a host with the global --host option, PHAB_FEEDBACK_HOST, or ~/.config/phab-feedback/config.json, in that order:

{
  "host": "https://phabricator.example.com",
  "cookie_name": "phsid"
}

If none is set and ~/.arcrc contains exactly one host, that host is used. Conduit tokens come from PHAB_FEEDBACK_TOKEN or the matching .arcrc entry. Tokens are not accepted as command-line arguments.

Browser-only actions also need a logged-in web session. Set PHAB_FEEDBACK_SESSION_COOKIE to either the configured session-cookie value or a complete Cookie header. To read it from a local Firefox profile instead, put --firefox-cookies before the command; --firefox-profile PATH selects a profile and implies cookie discovery:

phab-feedback --firefox-cookies submit D123

Credential requirements vary by command:

Commands Conduit token Web session
timeline, comment Required No
reply-inline, remove-comment, mark-done Required Required
submit No Required
mark-helpful, mark-unhelpful (Mozilla only) Required Required
request-ai-review (Mozilla only) No Required

The mutation commands that require both use Conduit to validate IDs and the web session to perform the browser-only action. XDG_CONFIG_HOME and PHAB_FEEDBACK_ARCRC are respected. Keep only non-secret settings in the JSON config file.

Commands and draft behavior

Successful commands write JSON to stdout. comment and reply-inline read message text from --message, --message-file PATH, --message-file -, or redirected stdin. File or stdin input avoids shell-quoting mistakes.

Start with the timeline and use its comment id values for later commands. Do not substitute transaction IDs or infer IDs from ordering.

# Read the complete chronological feedback timeline.
phab-feedback timeline D123

# Post an immediate top-level revision comment through Conduit.
phab-feedback comment D123 --message-file reply.txt

# Create a true inline-thread reply draft from a timeline comment ID.
phab-feedback reply-inline D123 456 --message-file - < reply.txt

# Create Done drafts from timeline inline-comment IDs.
phab-feedback mark-done D123 456 457

# Publish all pending replies and Done changes in a separate action.
phab-feedback submit D123

# Remove an accidental top-level comment after the CLI validates its type.
phab-feedback remove-comment D123 789

comment and remove-comment take effect immediately. reply-inline and mark-done only create drafts. submit publishes pending draft actions and comments. The combined form is available only when immediate publication is intentional:

phab-feedback reply-inline D123 456 --message-file reply.txt --submit

timeline and comment use standard Conduit APIs. Inline reply drafting, top-level comment removal, Done drafting, and draft submission use internal web endpoints present in upstream Phabricator and Phorge. Those endpoints are not a stable public API and may require compatibility updates after a server release.

These commands depend on Mozilla's Review Helper extension and are not generic Phabricator or Phorge features:

phab-feedback mark-helpful D123 456
phab-feedback mark-unhelpful D123 457
phab-feedback request-ai-review D123

Helpful and unhelpful ratings take effect immediately. An AI review request is also sent immediately. These actions are never combined implicitly with reply, Done, or submission actions.

Optional agent skill

The agent skill and Python CLI install separately. The skill provides workflow and approval guidance; it does not install the package or reimplement the CLI. Install the skill with:

npx skills add loganrosen/phab-feedback@phab-feedback -g

At runtime the skill uses an installed phab-feedback command when available, or uvx phab-feedback as a non-persistent fallback.

Troubleshooting

  • If multiple .arcrc hosts exist, select one explicitly, for example phab-feedback --host https://phabricator.example.com timeline D123.
  • If a web command reports that it needs a session, set PHAB_FEEDBACK_SESSION_COOKIE or use a logged-in Firefox profile with --firefox-cookies.
  • If Conduit commands work but a browser-only mutation fails after a server upgrade, the internal endpoint may have changed.

Development

git clone https://github.com/loganrosen/phab-feedback.git
cd phab-feedback
python3 -m pip install -e .
python3 -m unittest discover

Security

Credentials are sent only in request headers or bodies to the configured host. Errors omit request bodies, tokens, and cookies. Avoid shell tracing while setting credential environment variables.

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

phab_feedback-0.1.1.tar.gz (20.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

phab_feedback-0.1.1-py3-none-any.whl (16.8 kB view details)

Uploaded Python 3

File details

Details for the file phab_feedback-0.1.1.tar.gz.

File metadata

  • Download URL: phab_feedback-0.1.1.tar.gz
  • Upload date:
  • Size: 20.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for phab_feedback-0.1.1.tar.gz
Algorithm Hash digest
SHA256 21fad3f8f14f6a3061b3f72a866d761702e84a25342f6bc432900df09c59a396
MD5 0fe42bb64b5d9bec2524a0e1694c731e
BLAKE2b-256 711eb496a64f2153caf3bfb52c74b5b9fad819e5104a298bcf6176f4b1e5af76

See more details on using hashes here.

Provenance

The following attestation bundles were made for phab_feedback-0.1.1.tar.gz:

Publisher: release.yml on loganrosen/phab-feedback

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file phab_feedback-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: phab_feedback-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 16.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for phab_feedback-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 7570410e10b6c72ced5b43c529db66f2436b083f689c3f3dc13bbc4b8972203f
MD5 8ef8c04b09c57d35b56fd8f1adfdeb95
BLAKE2b-256 b08bc59c290712c03aecc9d3633f3061afd014bbf8ef1be8c301a32048e5084e

See more details on using hashes here.

Provenance

The following attestation bundles were made for phab_feedback-0.1.1-py3-none-any.whl:

Publisher: release.yml on loganrosen/phab-feedback

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page