Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# For more information, see [docs](https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners#codeowners-syntax)

# This repository is maintained by:
* @chrisreddington
74 changes: 74 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# Contributor Covenant Code of Conduct

## Our Pledge

In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to making participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, gender identity and expression, level of experience,
nationality, personal appearance, race, religion, or sexual identity and
orientation.

## Our Standards

Examples of behavior that contributes to creating a positive environment
include:

* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

* The use of sexualized language or imagery and unwelcome sexual attention or
advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic
address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting

## Our Responsibilities

Project maintainers are responsible for clarifying the standards of acceptable
behavior and are expected to take appropriate and fair corrective action in
response to any instances of unacceptable behavior.

Project maintainers have the right and responsibility to remove, edit, or
reject comments, commits, code, wiki edits, issues, and other contributions
that are not aligned to this Code of Conduct, or to ban temporarily or
permanently any contributor for other behaviors that they deem inappropriate,
threatening, offensive, or harmful.

## Scope

This Code of Conduct applies both within project spaces and in public spaces
when an individual is representing the project or its community. Examples of
representing a project or community include using an official project e-mail
address, posting via an official social media account, or acting as an appointed
representative at an online or offline event. Representation of a project may be
further defined and clarified by project maintainers.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at <[email protected]>. All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
Further details of specific enforcement policies may be posted separately.

Project maintainers who do not follow or enforce the Code of Conduct in good
faith may face temporary or permanent repercussions as determined by other
members of the project's leadership.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage],
version 1.4, available at [http://contributor-covenant.org/version/1/4][version]

[homepage]: http://contributor-covenant.org
[version]: http://contributor-covenant.org/version/1/4/
195 changes: 195 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,195 @@
# Contributing to gh-game

Thank you for your interest in contributing to gh-game! We love your input and welcome contributions from everyone, whether it's:

- Reporting a bug
- Discussing the current state of the code
- Submitting a fix
- Proposing new features
- Implementing a new game
- Improving documentation

## Table of Contents

- [Getting Started](#getting-started)
- [Fork the Repository](#fork-the-repository)
- [Clone Your Fork](#clone-your-fork)
- [Set Up GitHub Codespaces](#set-up-github-codespaces)
- [Local Development Setup](#local-development-setup)
- [Development Workflow](#development-workflow)
- [Creating a Branch](#creating-a-branch)
- [Make Your Changes](#make-your-changes)
- [Development Commands](#development-commands)
- [Adding a New Game](#adding-a-new-game)
- [Pull Request Process](#pull-request-process)
- [Create a Pull Request](#create-a-pull-request)
- [Code Review Process](#code-review-process)
- [Contribution Standards](#contribution-standards)
- [Code Style](#code-style)
- [Documentation](#documentation)
- [Testing](#testing)
- [Non-Code Contributions](#non-code-contributions)
- [Community](#community)
- [License](#license)

## Getting Started

### Fork the Repository

Start by forking the repository on GitHub by clicking the "Fork" button at the top-right of the repository page. This creates a copy of the repository in your own GitHub account.

### Clone Your Fork

Clone your fork to your local machine or continue with GitHub Codespaces:

```bash
git clone https://github.com/YOUR-USERNAME/gh-game.git
cd gh-game
git remote add upstream https://github.com/ORIGINAL-OWNER/gh-game.git
```

### Set Up GitHub Codespaces

The easiest way to start contributing is by using GitHub Codespaces, which comes pre-configured with all the dependencies needed for gh-game:

1. Navigate to your fork on GitHub
2. Click the "Code" button
3. Select "Open with Codespaces"
4. Click "New codespace"

This will create a development environment in the cloud with all the necessary tools installed, including the GitHub CLI (`gh`).

### Local Development Setup

If you prefer to develop locally, make sure you have:

1. Go 1.23 or later installed
2. GitHub CLI (`gh`) installed
3. All project dependencies:
```bash
go mod download
```
4. Any other tools:
```bash
go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest
```

## Development Workflow

### Creating a Branch

Create a branch for your contributions:

```bash
git checkout -b feature/your-feature-name
# or
git checkout -b fix/your-bugfix-name
```

### Make Your Changes

Now you're ready to make your changes to the codebase.

### Development Commands

Here are the important commands to use during development:

- **Build the project**:
```bash
go build
```

- **Run the CLI extension**:
```bash
./gh-game <subcommand>
# For example:
./gh-game cointoss
./gh-game tictactoe
```

- **Run tests**:
```bash
go test ./...
```

- **Format code** (required before commit):
```bash
go fmt ./...
```

- **Run linter** (required before commit):
```bash
golangci-lint run
```

### Adding a New Game

If you're adding a new game:

1. Create game logic in `/internal/<gamename>/`
2. Add command implementation in `/cmd/<gamename>.go`
3. Follow the patterns established in existing games
4. Update documentation to include the new game
5. Add comprehensive tests

## Pull Request Process

### Create a Pull Request

1. Push your branch to your fork:
```bash
git push origin feature/your-feature-name
```

2. Go to the original repository and create a pull request:
- Click "New Pull Request"
- Select your branch from your fork
- Fill out the PR template with details about your changes

### Code Review Process

1. Maintainers will review your PR
2. Address any feedback or requested changes
3. Make sure all CI checks pass
4. Once approved, a maintainer will merge your PR

## Contribution Standards

### Code Style

- Follow standard Go idioms and best practices
- Use meaningful variable and function names
- Keep functions small and focused
- Write GoDoc comments for all exported functions, types, and packages

### Documentation

- Update README.md when adding new features
- Document new commands and options
- Include usage examples
- Document complex algorithms or design decisions

### Testing

- Write unit tests for game logic
- Include integration tests for command behavior
- Mock external dependencies when testing
- All tests must pass before submitting a PR

## Non-Code Contributions

Your contributions don't have to be code! We also welcome:

- **Bug reports**: Create a detailed GitHub issue explaining the bug
- **Feature requests**: Submit ideas through GitHub issues
- **Documentation improvements**: Corrections or additions to docs
- **UI/UX suggestions**: Ideas to improve game interactions
- **User testing**: Provide feedback on game usability

When submitting issues, please use the provided issue templates and include as much detail as possible.

## Community

Our community is governed by our [Code of Conduct](CODE_OF_CONDUCT.md). By participating, you are expected to uphold this code.

Thank you for taking the time to contribute to gh-game! We look forward to your contributions!
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2025 Chris Reddington
Copyright GitHub, Inc.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
62 changes: 40 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,46 @@

A GitHub CLI extension that allows you to play games through the GitHub CLI.

## Features

- **Multiple Games**: Play coin toss, higher or lower, rock paper scissors, tic tac toe, and word guess games
- **Terminal-Based**: Fully playable through your terminal using GitHub CLI
- **Interactive UI**: User-friendly terminal interfaces for all games
- **Score Tracking**: Keep track of your scores and streaks in supported games

## Background

The gh-game extension serves as both a fun diversion and a showcase of GitHub CLI extension capabilities.

### Roadmap

- Additional games to be added in the future

## Installation

```sh
gh extension install chrisreddington/gh-game
gh extension install github-samples/gh-game
```

## Requirements

- Go 1.23 or newer
- GitHub CLI installed
- Terminal with Unicode support for optimal experience

### Setting Up Development Environment

1. Clone the repository
2. Run `go build` to build the extension
3. Run `go test ./...` to run the tests

### Development Container

This project includes a [development container configuration](.devcontainer/devcontainer.json) for VS Code, which provides a consistent development environment with:
- Go 1.23
- GitHub CLI
- Several VS Code extensions for GitHub

## Commands

### Coin Toss
Expand Down Expand Up @@ -70,30 +104,14 @@ gh game wordguess

The game selects a random GitHub-related term, and you need to guess it by suggesting one letter at a time. Each correct letter is revealed in its position. Each incorrect guess reduces your remaining guesses. You win by guessing the complete word before making 6 incorrect guesses.

## Development

### Prerequisites

- Go 1.23 or newer
- GitHub CLI installed

### Building from source

1. Clone the repository
2. Run `go build` to build the extension
3. Run `go test ./...` to run the tests
## Contributing

### Development Container
Contributions are welcome! Please feel free to submit a Pull Request. Check out our [contributing guidelines](CONTRIBUTING.md) for more details on how to get involved.

This project includes a [development container configuration](.devcontainer/devcontainer.json) for VS Code, which provides a consistent development environment with:
- Go 1.23
- GitHub CLI
- Several VS Code extensions for GitHub

## Contributing
## Maintainers

Contributions are welcome! Please feel free to submit a Pull Request.
This project is maintained by the GitHub Developer Relations team. See [CODEOWNERS](CODEOWNERS) file for specific maintainers.

## License

This project is available as open source under the terms of the [MIT License](LICENSE).
This project is available as open source under the terms of the [MIT License](LICENSE).
Loading