Commands
Complete reference of all built-in Grithub commands.
Overview
Grithub commands are organized into categories:
- Authentication - Login, logout
- Configuration - Settings and preferences
- Repository - Default repository management
- Issues - Issue management and bulk operations
- Information - Display runtime info
- Generation - API command generation
Command Structure
All commands follow this pattern:
grithub <command> [arguments] [options]Get Help
For any command:
grithub <command> --help
grithub <command> -hList all commands:
grithub --help
grithub helpAuthentication Commands
login
Authenticate with GitHub via OAuth.
grithub loginWhat it does:
- Opens browser to GitHub OAuth
- Stores authentication token
- Prompts for default repository selection
Example:
$ grithub login
✓ Authentication successful
? Select default repository
❯ username/repo-1
username/repo-2
✓ You have been logged in as Your Name!logout
Clear local authentication.
grithub logoutWhat it does:
- Removes stored token
- Clears user data
- Keeps configuration settings
Example:
$ grithub logout
⠋ Logging out...
✓ Logged out successfullyConfiguration Commands
config
Configure Grithub settings interactively.
grithub configOptions:
- Debug mode
- API base URL
- Timeout duration
- Command generation preferences
- Ngrok auth token
- Reset configuration
Example:
$ grithub config
? Select configuration to set
❯ Debug Mode (Disabled)
API Base URL (https://api.github.com)
Timeout Duration (3000 ms)set-repo
Set default repository context.
grithub set-repo [name] [options]Arguments:
name- Full repository name (owner/repo)
Options:
-O, --org- Select from organization repositories
Examples:
# Direct specification
grithub set-repo toneflix/grithub
# Interactive selection
grithub set-repo
# From organization
grithub set-repo --orgInformation Commands
info
Display application and system information.
grithub infoOutput includes:
- App version
- Platform details
- User information
- Database location
- Default repository
- System resources
Example:
$ grithub info
✓ Application Information Loaded.
┌─────────────────────-───┬──────────────────────────┐
│ Key │ Value │
├──────────────────────-──┼──────────────────────────┤
│ App Version │ 0.1.6 │
│ Platform │ darwin │
│ CPUs │ 8 │
│ Host │ username@Machine.host │
│ Github User │ youruser (ID: xxxxxxxx) │
│ Default Repo │ toneflix-forks/dummy │
└───────────────────────-─┴──────────────────────────┘Issue Commands
issues
Interactive issues management dashboard.
grithub issues [repo]Arguments:
repo(optional) - Repository name (owner/repo)
Features:
- Browse all issues with pagination
- View issue details
- Close/reopen issues
- Edit title or body
- Delete issues
Example:
$ grithub issues
✓ 15 issues fetched successfully.
? Select Issue
❯ #1: 🟢 Feature request
#2: 🔴 Bug in login
#3: 🟢 Documentation update
Load more issuesissues:create
Create a single issue (generated command).
grithub issues:create --title <title> [options]Options:
--title(required) - Issue title--body- Issue description--owner- Repository owner--repo- Repository name--labels- Comma-separated labels--assignees- Comma-separated assignees
Example:
grithub issues:create \
--title "Add dark mode" \
--body "Users requested dark mode" \
--labels "enhancement,ui"issues:seed
Create multiple issues from markdown files.
grithub issues:seed <directory> [options]Arguments:
directory(required) - Path to markdown files
Options:
--repo- Repository (uses default if not provided)
Example:
grithub issues:seed ./my-issuesissues:update
Update issues from modified markdown files.
grithub issues:update <directory> [options]Arguments:
directory(required) - Path to markdown files
Options:
--repo- Repository (uses default if not provided)
Example:
grithub issues:update ./my-issuesissues:delete
Delete a range of issues.
grithub issues:delete --start <number> --end <number> [options]Options:
--start(required) - Starting issue number--end(required) - Ending issue number--repo- Repository (uses default if not provided)
Example:
grithub issues:delete --start 1 --end 50DANGER
Issue deletion is permanent and cannot be undone.
Generation Commands
generate:apis
Generate CLI commands from GitHub OpenAPI spec.
grithub generate:apisWhat it does:
- Downloads GitHub OpenAPI specification
- Parses endpoint definitions
- Generates command signatures
- Writes to
.grithub/apis.generated.jsin your current working directory.
Example:
$ grithub generate:apis
✓ @octokit/openapi is already installed.
⠋ Generating Extended APIs...
✓ Generated Extended APIs to: .grithub/apis.generated.jsGenerated commands available after running:
- All GitHub REST API endpoints
- Proper parameter validation
- Automatic documentation
Generated Commands
After running generate:apis, hundreds of commands become available:
Issues (Generated)
# List issues
grithub issues:list-for-repo --state open
# Get issue
grithub issues:get --issue_number 42
# Update issue
grithub issues:update --issue_number 42 --state closed
# Add labels
grithub issues:addLabels --issue_number 42 --labels "bug,priority"Repositories (Generated)
# List repos
grithub repos:list-for-authenticated-user --per_page 100
# Get repo
grithub repos:get --owner toneflix --repo grithub
# Create repo
grithub repos:create-for-authenticated-user \
--name "new-repo" \
--private falsePull Requests (Generated)
# List PRs
grithub pulls:list --state open
# Get PR
grithub pulls:get --pull_number 10
# Create PR
grithub pulls:create \
--title "Fix bug" \
--head "feature" \
--base "main"
# Merge PR
grithub pulls:merge --pull_number 10 --merge_method squashOrganizations (Generated)
# List orgs
grithub orgs:list-for-authenticated-user
# Get org
grithub orgs:get --org toneflix
# List members
grithub orgs:listMembers --org toneflixUsers (Generated)
# Get authenticated user
grithub users:get-authenticated
# Get user
grithub users:getByUsername --username toneflix
# List followers
grithub users:listFollowersForAuthenticatedUserCommand Patterns
Using Default Repository
After setting default repository:
# Set default
grithub set-repo owner/repo
# Now these work without --owner/--repo
grithub issues:create --title "Bug"
grithub issues:list-for-repo --state open
grithub pulls:listPiping and Scripting
# Export to file
grithub issues:list-for-repo > issues.json
# Use with jq
grithub issues:list-for-repo | jq '.[] | .title'
# In scripts
#!/bin/bash
for title in "Task 1" "Task 2"; do
grithub issues:create --title "$title"
doneChaining Commands
# Setup and use
grithub login && \
grithub set-repo owner/repo && \
grithub issues:seed ./issuesGlobal Options
Available on all commands:
Help
grithub <command> --help
grithub <command> -hVersion
grithub --version
grithub -VExit Codes
Grithub uses standard exit codes:
0- Success1- General error2- Misuse of command130- Interrupted (Ctrl+C)
Example usage:
#!/bin/bash
grithub issues:create --title "Bug"
if [ $? -eq 0 ]; then
echo "Issue created successfully"
else
echo "Failed to create issue"
exit 1
fiCommand Aliases
Some commands have shorter aliases:
# issues:list-for-repo can use alias
grithub issues:list
# issues:get has alias
grithub issues:getTips and Tricks
Shell Aliases
Create shortcuts:
# Add to ~/.bashrc or ~/.zshrc
alias gi='grithub issues'
alias gic='grithub issues:create'
alias gil='grithub issues:list-for-repo'
# Usage
gi # Opens interactive dashboard
gic --title "Bug" # Creates issue
gil --state open # Lists open issuesCommand History
Use shell history effectively:
# Search history
Ctrl+R grithub
# Repeat last grithub command
!grithub
# Edit and repeat
grithub issues:create --title "Bug 1"
# Press Up, change "1" to "2", EnterTab Completion
Enable tab completion (if supported):
grithub iss<Tab> # Completes to "issues"
grithub issues:cr<Tab> # Completes to "issues:create"Troubleshooting Commands
Command Not Found
command not found: grithubSolution:
# Reinstall globally
npm install -g @toneflix/grithub
# Or use npx
npx @toneflix/grithub <command>Permission Denied
ERROR: You're not signed inSolution:
grithub loginInvalid Arguments
ERROR: Missing required argument: titleSolution:
# Check required parameters
grithub <command> --help
# Provide required arguments
grithub issues:create --title "My Issue"Next Steps
- API Reference - Detailed API documentation
- Bulk Operations - Advanced workflows
