docs: Update documentation for CP2 merge request support
Updates project documentation to reflect the complete CP2 feature set with merge request ingestion and robot mode capabilities. README.md: - Add MR-related CLI examples (gi list mrs, gi show mr, gi ingest) - Document robot mode (--robot flag, GI_ROBOT env, auto-detect) - Update feature list with MR support and DiffNote positions - Add configuration section with all config file options - Expand CLI reference with new commands and flags AGENTS.md: - Add MR ingestion patterns for AI agent consumption - Document robot mode JSON schemas for parsing - Include error handling patterns with exit codes - Add discussion/note querying examples for code review context Cargo.toml: - Bump version to 0.2.0 reflecting major feature addition The documentation emphasizes the robot mode design which enables AI agents like Claude Code to reliably parse gi output for automated GitLab workflow integration. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
85
AGENTS.md
85
AGENTS.md
@@ -164,3 +164,88 @@ git push # Push to remote
|
||||
- Always `bd sync` before ending session
|
||||
|
||||
<!-- end-bv-agent-instructions -->
|
||||
|
||||
---
|
||||
|
||||
## GitLab Inbox Robot Mode
|
||||
|
||||
The `gi` CLI has a robot mode optimized for AI agent consumption with structured JSON output, meaningful exit codes, and TTY auto-detection.
|
||||
|
||||
### Activation
|
||||
|
||||
```bash
|
||||
# Explicit flag
|
||||
gi --robot list issues
|
||||
|
||||
# Auto-detection (when stdout is not a TTY)
|
||||
gi list issues | jq .
|
||||
|
||||
# Environment variable
|
||||
GI_ROBOT=1 gi list issues
|
||||
```
|
||||
|
||||
### Robot Mode Commands
|
||||
|
||||
```bash
|
||||
# List issues/MRs with JSON output
|
||||
gi --robot list issues --limit=10
|
||||
gi --robot list mrs --state=opened
|
||||
|
||||
# Count entities
|
||||
gi --robot count issues
|
||||
gi --robot count discussions --type=mr
|
||||
|
||||
# Show detailed entity info
|
||||
gi --robot show issue 123
|
||||
gi --robot show mr 456 --project=group/repo
|
||||
|
||||
# Check sync status
|
||||
gi --robot sync-status
|
||||
|
||||
# Run ingestion (quiet, JSON summary)
|
||||
gi --robot ingest --type=issues
|
||||
|
||||
# Check environment health
|
||||
gi --robot doctor
|
||||
```
|
||||
|
||||
### Response Format
|
||||
|
||||
All commands return consistent JSON:
|
||||
|
||||
```json
|
||||
{"ok":true,"data":{...},"meta":{...}}
|
||||
```
|
||||
|
||||
Errors return structured JSON to stderr:
|
||||
|
||||
```json
|
||||
{"error":{"code":"CONFIG_NOT_FOUND","message":"...","suggestion":"Run 'gi init'"}}
|
||||
```
|
||||
|
||||
### Exit Codes
|
||||
|
||||
| Code | Meaning |
|
||||
|------|---------|
|
||||
| 0 | Success |
|
||||
| 1 | Internal error |
|
||||
| 2 | Config not found |
|
||||
| 3 | Config invalid |
|
||||
| 4 | Token not set |
|
||||
| 5 | GitLab auth failed |
|
||||
| 6 | Resource not found |
|
||||
| 7 | Rate limited |
|
||||
| 8 | Network error |
|
||||
| 9 | Database locked |
|
||||
| 10 | Database error |
|
||||
| 11 | Migration failed |
|
||||
| 12 | I/O error |
|
||||
| 13 | Transform error |
|
||||
|
||||
### Best Practices
|
||||
|
||||
- Use `gi --robot` for all agent interactions
|
||||
- Check exit codes for error handling
|
||||
- Parse JSON errors from stderr
|
||||
- Use `--limit` to control response size
|
||||
- TTY detection handles piped commands automatically
|
||||
|
||||
Reference in New Issue
Block a user