Get the FREE Ultimate OpenClaw Setup Guide →

gh-issue-comment

npx machina-cli add skill dceoy/github-cli-agent-skills/gh-issue-comment --openclaw
Files (1)
SKILL.md
1.5 KB

GitHub Issue Comment

When to use

  • The user asks to comment on an issue or post an update.
  • You need to edit or delete your last comment.

Inputs to confirm

  • Issue number or URL.
  • Comment body (or file path).
  • Whether to edit/delete the last comment.

Workflow

  1. Verify auth:
    gh --version
    gh auth status
    
  2. Post a comment:
    gh issue comment 123 --body "Status update: fix in progress"
    gh issue comment 123 --body-file update.md
    
  3. Edit or delete last comment if requested:
    gh issue comment 123 --edit-last --body "Updated info"
    gh issue comment 123 --delete-last --yes
    
  4. Confirm:
    gh issue view 123 --comments
    

Examples

# Quick update
~ gh issue comment 123 --body "Working on this now."

# Edit last comment
~ gh issue comment 123 --edit-last --body "Revised ETA: tomorrow."

Notes

  • Without --body/--body-file, gh opens an interactive prompt.
  • --web opens the browser for composing a comment.

References

Source

git clone https://github.com/dceoy/github-cli-agent-skills/blob/main/skills/gh-issue-comment/SKILL.mdView on GitHub

Overview

gh-issue-comment lets you add, edit, or delete comments on GitHub issues using the gh CLI. It supports posting status updates, refining previous notes, or removing mistakes from the issue thread. This helps teams stay synchronized with minimal context switching.

How This Skill Works

Authenticate with gh, then post a new comment with gh issue comment <issue> --body '...'; you can also use --body-file for longer content. To modify the last comment, use --edit-last with a new --body, or --delete-last to remove it. After changes, verify the result with gh issue view <issue> --comments. If you omit --body/--body-file, gh opens an interactive prompt, and --web can open a browser for composing a comment.

When to Use It

  • You need to post a quick status update on an open issue.
  • You must update your most recent comment with revised information.
  • You want to delete a recently posted comment.
  • You have the content in a file and want to post it as a comment.
  • You want to confirm the comment appears by inspecting the issue's comments.

Quick Start

  1. Step 1: Ensure gh is installed and authenticated: gh --version; gh auth status
  2. Step 2: Post, edit, or delete a comment using gh issue comment <issue> with --body/--edit-last/--delete-last
  3. Step 3: Verify the result: gh issue view <issue> --comments

Best Practices

  • Use --body-file for longer updates to avoid escaping and errors.
  • Always verify the targeted issue number or URL before posting.
  • Use --edit-last to fix mistakes instead of adding duplicate comments.
  • Keep comments concise and actionable to aid triage.
  • After posting or editing, run gh issue view <id> --comments to confirm.

Example Use Cases

  • Post a quick update: gh issue comment 123 --body 'Working on this now.'
  • Edit last comment: gh issue comment 123 --edit-last --body 'Revised ETA: tomorrow.'
  • Delete last comment: gh issue comment 123 --delete-last --yes
  • Post from file: gh issue comment 123 --body-file update.md
  • View comments to verify: gh issue view 123 --comments

Frequently Asked Questions

Add this skill to your agents
Sponsor this space

Reach thousands of developers