Commands
Complete reference of all built-in Ghit commands.
Overview
Ghit 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:
ghit <command> [arguments] [options]Get Help
For any command:
ghit <command> --help
ghit <command> -hList all commands:
ghit --help
ghit helpAuthentication Commands
login
Authenticate with GitHub via OAuth.
ghit loginWhat it does:
- Opens browser to GitHub OAuth
- Stores authentication token
- Prompts for default repository selection
Example:
$ ghit login
✓ Authentication successful
? Select default repository
❯ username/repo-1
username/repo-2
✓ You have been logged in as Your Name!logout
Clear local authentication.
ghit logoutWhat it does:
- Removes stored token
- Clears user data
- Keeps configuration settings
Example:
$ ghit logout
⠋ Logging out...
✓ Logged out successfullyConfiguration Commands
config
Configure Ghit settings interactively.
ghit configOptions:
- Debug mode
- API base URL
- Timeout duration
- Command generation preferences
- Ngrok auth token
- Reset configuration
Example:
$ ghit 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.
ghit set-repo [name] [options]Arguments:
name- Full repository name (owner/repo)
Options:
-O, --org- Select from organization repositories
Examples:
# Direct specification
ghit set-repo toneflix/ghit
# Interactive selection
ghit set-repo
# From organization
ghit set-repo --orgInformation Commands
info
Display application and system information.
ghit infoOutput includes:
- App version
- Platform details
- User information
- Database location
- Default repository
- System resources
Example:
$ ghit 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.
ghit 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:
$ ghit 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).
ghit 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:
ghit issues:create \
--title "Add dark mode" \
--body "Users requested dark mode" \
--labels "enhancement,ui"issues:seed
Create multiple issues from markdown files.
ghit issues:seed <directory> [options]Arguments:
directory(required) - Path to markdown files
Options:
--repo- Repository (uses default if not provided)
Example:
ghit issues:seed ./my-issuesissues:update
Update issues from modified markdown files.
ghit issues:update <directory> [options]Arguments:
directory(required) - Path to markdown files
Options:
--repo- Repository (uses default if not provided)
Example:
ghit issues:update ./my-issuesissues:delete
Delete a range of issues.
ghit 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:
ghit 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.
ghit generate:apisWhat it does:
- Downloads GitHub OpenAPI specification
- Parses endpoint definitions
- Generates command signatures
- Writes to
.ghit/apis.generated.jsin your current working directory.
Example:
$ ghit generate:apis
✓ @octokit/openapi is already installed.
⠋ Generating Extended APIs...
✓ Generated Extended APIs to: .ghit/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
ghit issues:list-for-repo --state open
# Get issue
ghit issues:get --issue_number 42
# Update issue
ghit issues:update --issue_number 42 --state closed
# Add labels
ghit issues:addLabels --issue_number 42 --labels "bug,priority"Repositories (Generated)
# List repos
ghit repos:list-for-authenticated-user --per_page 100
# Get repo
ghit repos:get --owner toneflix --repo ghit
# Create repo
ghit repos:create-for-authenticated-user \
--name "new-repo" \
--private falsePull Requests (Generated)
# List PRs
ghit pulls:list --state open
# Get PR
ghit pulls:get --pull_number 10
# Create PR
ghit pulls:create \
--title "Fix bug" \
--head "feature" \
--base "main"
# Merge PR
ghit pulls:merge --pull_number 10 --merge_method squashOrganizations (Generated)
# List orgs
ghit orgs:list-for-authenticated-user
# Get org
ghit orgs:get --org toneflix
# List members
ghit orgs:listMembers --org toneflixUsers (Generated)
# Get authenticated user
ghit users:get-authenticated
# Get user
ghit users:getByUsername --username toneflix
# List followers
ghit users:listFollowersForAuthenticatedUserCommand Patterns
Using Default Repository
After setting default repository:
# Set default
ghit set-repo owner/repo
# Now these work without --owner/--repo
ghit issues:create --title "Bug"
ghit issues:list-for-repo --state open
ghit pulls:listPiping and Scripting
# Export to file
ghit issues:list-for-repo > issues.json
# Use with jq
ghit issues:list-for-repo | jq '.[] | .title'
# In scripts
#!/bin/bash
for title in "Task 1" "Task 2"; do
ghit issues:create --title "$title"
doneChaining Commands
# Setup and use
ghit login && \
ghit set-repo owner/repo && \
ghit issues:seed ./issuesGlobal Options
Available on all commands:
Help
ghit <command> --help
ghit <command> -hVersion
ghit --version
ghit -VExit Codes
Ghit uses standard exit codes:
0- Success1- General error2- Misuse of command130- Interrupted (Ctrl+C)
Example usage:
#!/bin/bash
ghit 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
ghit issues:list
# issues:get has alias
ghit issues:getTips and Tricks
Shell Aliases
Create shortcuts:
# Add to ~/.bashrc or ~/.zshrc
alias gi='ghit issues'
alias gic='ghit issues:create'
alias gil='ghit 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 ghit
# Repeat last ghit command
!ghit
# Edit and repeat
ghit issues:create --title "Bug 1"
# Press Up, change "1" to "2", EnterTab Completion
Enable tab completion (if supported):
ghit iss<Tab> # Completes to "issues"
ghit issues:cr<Tab> # Completes to "issues:create"Troubleshooting Commands
Command Not Found
command not found: ghitSolution:
# Reinstall globally
npm install -g ghit
# Or use npx
npx ghit <command>Permission Denied
ERROR: You're not signed inSolution:
ghit loginInvalid Arguments
ERROR: Missing required argument: titleSolution:
# Check required parameters
ghit <command> --help
# Provide required arguments
ghit issues:create --title "My Issue"Next Steps
- API Reference - Detailed API documentation
- Bulk Operations - Advanced workflows
