The Trunk CLI allows you to insert and remove PRs into the Merge Queue. You can also pause and resume the queue from the CLI.Documentation Index
Fetch the complete documentation index at: https://trunk-4cab4936-mintlify-migrate-trunk-docs-1778256504.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
Installation
- macOS/Linux
- Homebrew
- Windows
Prerequisites
Before using the CLI:- Authenticate: Run
trunk login - Git repository: Execute commands from your repository root
Usage
Submit a PR to the Queue
<pr-number> - Pull request number to submit. Can be specified with or without # prefix (e.g., 1234 or #1234)
Flags
-p, --priority <0-255> - Priority determines the order PRs are tested and merged. When a PR is submitted with a priority, it will begin testing before any lower priority PR that isn’t currently being tested. Levels:
0(Urgent) Interrupts currently testing PRs to begin testing immediately. Use sparingly as restarting tests is costly. This is the only priority that interrupts running tests10(High) Tests before default priority PRs100(Default) Used when no priority is specified200(Low) Tests after default priority PRs255( Lowest) Lowest possible priority
- Default Priority
- High Priority
- Low Priority
- Urgent
Check Queue Status
- Recently merged PRs
- Currently testing PRs
- PRs waiting in queue
View PR Status and History
- When it was submitted
- Status changes over time
- Test results
- Links to test runs
Cancel a PR
Remove a pull request from the merge queue. Use cases:- Cancel before making additional changes to the PR
- Cancel to resubmit with different priority
Pause Queue [admin only]
Pause the merge queue, changing its state fromRunning to Paused. The ordering of PRs in the queue is preserved while paused.
- CI failure recovery - Stop merges and testing until infrastructure issues are resolved
- Test infrastructure outages - Pause until systems are back online
- Emergency situations - Prevent any merges during incident response
- Scheduled maintenance - Block merges during maintenance window
Resume Queue [admin only]
Resume merge queue processing, changing its state fromPaused back to Running. The queue will begin testing waiting PRs in priority order.