Project

ask-github

0.0
The project is in a healthy, maintained state
Provides authenticated Octokit client, context metadata, and error guide for AI agents.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Development

~> 5.25
~> 3.1
~> 13.0
~> 6.3
~> 3.23

Runtime

~> 9.0
>= 0.3.2
 Project Readme

ask-github

Gem Version

GitHub service context for AI agents in the ask-rb ecosystem. It provides an authenticated Octokit client for the GitHub REST API, metadata constants for system prompts, and a structured error guide for common GitHub API issues.

Installation

gem "ask-github"

Quick Start

require "ask-github"

client = Ask::GitHub.client
client.issues("owner/repo")
client.create_issue("owner/repo", "Title", "Body")
client.pull_requests("owner/repo")
client.contents("owner/repo", path: "Gemfile")
client.search_issues("query")

Authentication

Ask::GitHub.client resolves a token via Ask::Auth.resolve(:github_token). Set it in your environment:

export GITHUB_TOKEN=your_token_here

Or add it to ~/.ask/credentials.yml:

github_token: your_token_here

Credentials can also come from Rails credentials, a database, or an OAuth provider, depending on your ask-auth configuration. Generate a token at github.com/settings/tokens with the repo and read:org scopes.

Key entry points

  • Ask::GitHub.client - an authenticated Octokit::Client (auto-paginating, per_page: 100, retry middleware). It is wrapped in a proxy that converts Octokit::Unauthorized into Ask::Auth::InvalidCredential.
  • Ask::GitHub::Errors - structured error knowledge for agents: guidance by exception class, HTTP status code descriptions, and rate limit info.
  • Ask::GitHub::DESCRIPTION, DOCS_URL, AUTH_NAME, GEM_NAME, GEM_VERSION, and QUICK_START - metadata constants for system prompts.

Full documentation

The full ask-rb documentation lives at https://ask-rb.github.io/ask-docs. Services: GitHub covers ask-github in depth, including the client, error guide, and constants. API reference: https://ask-rb.github.io/ask-docs/reference/api.

Development

bundle install
bundle exec rake test

License

MIT