Skip to content

About

Github deploy CLI

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

Repository files navigation

gh-deploy

Command-line tool for creating GitHub repositories and deploying local projects using OAuth device flow authentication.

Node.js License

Overview

  • OAuth device flow authentication with a browser-based login
  • Create a repository and push the current directory in one command
  • Works with existing GitHub repositories and local remotes
  • HTTPS remotes by default, with optional SSH
  • Interactive prompts plus flags for automation

Requirements

  • Node.js 18+
  • Git installed and configured
  • GitHub account

Installation

Global installation

npm install -g gh-deploy-cli

From source

git clone <your-repo-url>
cd github-cli
npm install
npm link

Quick start

gh-deploy login
cd my-project
gh-deploy push

Usage

Authenticate

gh-deploy login

Show the current account

gh-deploy whoami

Create a repository

gh-deploy create
gh-deploy create my-project --description "My project" --private
gh-deploy create my-project --org my-organization
gh-deploy create my-project --ssh

Deploy the current directory

gh-deploy push
gh-deploy push --name my-project --description "My app" --private
gh-deploy push --repo owner/name
gh-deploy push --repo https://github.com/owner/name
gh-deploy push --use-existing
gh-deploy push --remote upstream --use-existing
gh-deploy push --ssh

Commands

Command Description
login Authenticate with GitHub using OAuth device flow
logout Remove stored authentication credentials
whoami Display authenticated user information
create [name] Create a new GitHub repository
push Create or use a repository and push the current project

Options

Global

  • -v, --verbose: Enable verbose logging
  • --plain: Disable color and decorative output
  • --no-color: Disable colored output
  • -h, --help: Show help
  • -V, --version: Show version

Create and push

  • -n, --name : Repository name
  • -d, --description : Repository description
  • -p, --private: Make repository private
  • -o, --org : Create repository in organization
  • --repo <owner/name>: Use an existing GitHub repository (owner/name or URL)
  • --remote : Git remote name to use (default: origin)
  • --use-existing: Use existing remote if it exists (skip repo creation)
  • --ssh: Use SSH for git remote (default: HTTPS)

Configuration

Config is stored in your home directory:

  • Windows: %APPDATA%\gh-deploy-cli\config.json
  • macOS: ~/Library/Preferences/gh-deploy-cli/config.json
  • Linux: ~/.config/gh-deploy-cli/config.json

Troubleshooting

  • Git not installed: install from https://git-scm.com/
  • Git name/email missing: set them with git config --global
  • Token missing/expired: run gh-deploy login
  • Repository exists: choose a different name or use --repo

Development

npm test
npm run lint
npm run format

Security

  • OAuth tokens are encrypted before storage
  • Tokens are never logged or displayed
  • File permissions restrict token access to the owner
  • Never commit your token file or share your Client ID publicly

License

MIT License. See LICENSE.

Acknowledgments

  • Octokit
  • Commander.js
  • simple-git
  • Inquirer.js

About

Github deploy CLI

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages