# Create public gist with test.txt
echo "test" > test.txt
gh gist create test.txt -d "a test" --public
# List open issues in the repo
gh issue list
# List closed issues assigned to imjohnbo
gh issue list -s "closed" -a "imjohnbo"
# Create issue (guided creation including templates)
gh issue create
# List open prs in the repo
gh pr list
# Checkout branch corresponding to pr number
gh pr checkout 490
# Create pr from current branch (guided creation including branch push)
gh pr create
# Clone repo
gh clone github/partner-engineering
# View preview of repo in Terminal (README)
gh repo view
# View repo in browser
gh repo view --web
# Create release
gh release create v1.2.3 -F changelog.md
# Last but not least... API
gh api repos/imjohnbo/get-actions-by-owner/releases
# More complex API example
gh api graphql -f query='
query Latest10 {
organization(login: "imjohnbo-org") {
auditLog(last: 10, query:"created: >=2010-04-14") {
edges {
cursor
node {
... on AuditEntry {
action
actorLogin
createdAt
operationType
__typename
}
}
node {
... on Node {
id
}
}
}
}
}
}
'
- Broadly scoped OAuth token required: cli/cli#1229