Skip to content

Repository files navigation

Buy Me a Coffee at ko-fi.com

Gitstart

Overview

Gitstart creates, adds, and pushes with one line.

Gitstart automates creating a GitHub repository. It will:

  • Auto-detect project language and create .gitignore (or use -l to specify)
  • Create a license file based on your choice
  • Create a new repository at GitHub.com (public or private)
  • Create a README.md file with the repository name
  • Initialize a git repository (if needed)
  • Auto-detect the active branch from an existing repo
  • Add files and commit with a custom message
  • Add the remote and push
  • Support existing directories and projects

Requirements

  • GitHub CLI (gh), authenticated
  • git installed
  • macOS, Linux, or Windows

Installation

Homebrew (macOS/Linux)

brew install shinokada/gitstart/gitstart

Windows Scoop

scoop bucket add shinokada https://github.com/shinokada/scoop-bucket
scoop install gitstart

Debian/Ubuntu

Download the latest .deb from the releases page and run:

sudo apt install ./gitstart_x.x.x_linux_amd64.deb

Fedora/RHEL

Download the latest .rpm from the releases page and run:

sudo rpm -i gitstart_x.x.x_linux_amd64.rpm

Go install

go install github.com/shinokada/gitstart@latest

This places the gitstart binary in your $GOPATH/bin or $GOBIN directory. Make sure that directory is in your PATH.

Usage

Basic Usage

# Login to GitHub
gh auth login
# Create a new repository
gitstart -d repo-name
# Create in current directorycd existing_project
gitstart -d .

After a Framework Starter

gitstart works seamlessly after scaffolding tools like npx sv create, npm create vite@latest, or composer create-project. Use --post-framework to skip prompts for files the framework already created, while still auto-detecting the language and branch:

npx sv create my-app &&cd my-app && gitstart -d . --post-framework
npm create vite@latest my-app &&cd my-app && gitstart -d . --post-framework
npm create vite@latest my-app -- --template react &&cd my-app && gitstart -d . --post-framework
composer create-project laravel/laravel my-app &&cd my-app && gitstart -d . --post-framework
npx nuxi@latest init my-app &&cd my-app && gitstart -d . --post-framework

Or use quiet mode for a minimal one-liner:

npx sv create my-app &&cd my-app && gitstart -d . -q

Options

-d, --directory DIRECTORY Directory name or path (use . for current directory)
-l, --language LANGUAGE Programming language for .gitignore (auto-detected if omitted)
-p, --private Create a private repository (default: public)
-P, --public Create a public repository
-b, --branch BRANCH Branch name (auto-detected from existing repo; default: main)
-m, --message MESSAGE Initial commit message (default: "Initial commit")
--description DESC Repository description
--no-license Skip LICENSE file creation
--no-readme Skip README.md creation
--post-framework Optimised for use after a framework starter
(implies --no-license --no-readme)
-n, --dry-run Show what would happen without executing
-q, --quiet Minimal output
-h, --help Show help message
version Show version

Language Auto-detection

When -l is not provided and no .gitignore exists, gitstart inspects the project directory for well-known marker files and infers the language automatically:

Marker file(s)Detected language
go.modGo
Cargo.tomlRust
pubspec.yamlDart
composer.jsonComposer (PHP)
GemfileRuby
pom.xml, build.gradle, build.gradle.ktsJava
requirements.txt, pyproject.toml, setup.py, setup.cfgPython
package.jsonNode

If multiple markers are present the first match in the table above wins. You can always override auto-detection with -l.

Branch Auto-detection

When --branch is not explicitly set and a .git directory already exists (e.g. created by a framework starter), gitstart reads the active branch from .git/HEAD and pushes to that branch instead of defaulting to main. Passing --branch explicitly always takes precedence.

Examples

Create a new repository:

gitstart -d my-project

Create with specific programming language:

gitstart -d my-python-app -l python

Create a private repository:

gitstart -d secret-project -p

Use custom commit message and branch:

gitstart -d my-app -m "First release" -b develop

Add repository description:

gitstart -d awesome-tool --description "An amazing CLI tool for developers"

Skip LICENSE and README (e.g. framework already created them):

cd my-existing-project
gitstart -d . --no-license --no-readme

Use --post-framework after a Svelte scaffold:

npx sv create my-app
cd my-app
gitstart -d . --post-framework

Use --post-framework after a React scaffold:

npm create vite@latest my-app -- --template react
cd my-app
gitstart -d . --post-framework

Preview changes without executing (dry run):

gitstart -d test-repo --dry-run

Quiet mode for scripts:

gitstart -d automated-repo -q

Initialize existing project:

cd my-existing-project
gitstart -d . -l javascript --description "My existing JavaScript project"

Show version:

gitstart version

Shell Completion

Gitstart supports Tab completion in your shell. Once set up, pressing Tab after typing part of a flag or subcommand will either complete it automatically or show you the available options. For example:

gitstart --di[TAB] # completes to --directory
gitstart --[TAB] # lists all flags
gitstart [TAB] # lists all subcommands: completion, help, version

Run the setup command for your shell once, then open a new terminal (or source your config file):

Bash

gitstart completion bash >>~/.bashrc
source~/.bashrc

Zsh

gitstart completion zsh >"${fpath[1]}/_gitstart"source~/.zshrc

Fish

gitstart completion fish >~/.config/fish/completions/gitstart.fish

PowerShell

gitstart completion powershell >>$PROFILE

Working with Existing Directories

Empty directory: Creates repository normally.

Directory with files but no git:

  • Warns about existing files
  • Asks for confirmation
  • Preserves existing files
  • Adds them to the initial commit

Directory with existing git repository:

  • Detects existing .git folder
  • Auto-detects the active branch from .git/HEAD
  • Adds remote to existing repository
  • Preserves git history

Existing LICENSE, README.md, or .gitignore:

  • Detects existing files and skips them
  • Use --no-license or --no-readme to explicitly suppress creation
  • Use --post-framework to suppress both at once

Interactive License Selection

When you run gitstart without --no-license, --post-framework, or -q, you'll be prompted to select a license:

Select a license:
1) mit: Simple and permissive
2) apache-2.0: Community-friendly
3) gpl-3.0: Share improvements
4) None

Error Handling

  • Automatic cleanup: If repository creation fails, the remote repository is automatically deleted
  • Validation checks: Ensures all required tools are installed
  • Auth verification: Confirms you're logged in to GitHub
  • File conflict detection: Detects existing files and skips safely
  • Detailed error messages: Clear information about what went wrong and how to fix it

About Licensing

Read more about Licensing.

Changelog

Version 1.2.2

Bug Fixes:

  • Add v1.2.1 changelog and README entries (missed before tagging)

Version 1.2.1

Bug Fixes:

  • Fixed goreleaser CI failure: corrected License to LICENSE in .goreleaser.yaml (archives files list and nfpms contents)

Version 1.2.0

New Features:

  • Auto-detect project language from marker files (go.mod, package.json, Cargo.toml, etc.) when -l is not provided
  • --no-license flag to skip LICENSE creation without suppressing all output
  • --no-readme flag to skip README.md creation without suppressing all output
  • --post-framework flag: optimised mode for use after framework starters — implies --no-license --no-readme
  • Auto-detect active branch from .git/HEAD when --branch is not explicitly set

Bug Fixes:

  • Fixed dry-run language detection to always auto-detect (not only when --post-framework is set)
  • Fixed composer.json marker mapping from PHP to Composer (PHP.gitignore does not exist in GitHub/gitignore)
  • Renamed internal resolvDir to resolveDir (typo fix)

Version 1.1.0

  • Added shell completion support (bash, zsh, fish, PowerShell)

Version 1.0.0 (2026)

Gitstart is now rewritten in Go with full cross-platform support (macOS, Linux, Windows).

Version 0.4.0 (2026-01-18)

New Features:

  • Private repository support with -p/--private flag
  • Custom commit messages with -m/--message flag
  • Custom branch names with -b/--branch flag
  • Repository description with --description flag
  • Dry run mode with --dry-run flag
  • Quiet mode with -q/--quiet flag
  • Full support for existing directories and files
  • Automatic rollback on errors
  • Detection and handling of existing git repositories

Improvements:

  • XDG-compliant config directory (~/.config/gitstart/config)
  • Better error messages with context
  • File conflict detection and user prompts
  • Smarter handling of existing LICENSE, README, and .gitignore files

Bug Fixes:

  • Fixed issue with gh repo create --clone in existing directories
  • Proper handling of existing files to prevent data loss

Version 0.3.0

  • Initial public release

Author

Shinichi Okada

License

Copyright (c) 2021-2026 Shinichi Okada (@shinokada) This software is released under the MIT License, see LICENSE.

About

One command to create a GitHub repo — with .gitignore, LICENSE, README, initial commit, and push. Zero manual steps.

Topics

Resources

Code of conduct

Stars

36 stars

Watchers

2 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { // Add copy buttons to all
 blocks
(function() {
function addCopyButtons() {
document.querySelectorAll('pre code').forEach(function(codeBlock) {
if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;
codeBlock.parentElement.setAttribute('data-copy-added', 'true');
var btn = document.createElement('button');
btn.textContent = 'Copy';
btn.style.cssText = 'position:absolute;top:4px;right:4px;padding:2px 8px;font-size:11px;background:#4ecdc4;border:none;border-radius:4px;color:#1a1a2e;cursor:pointer;opacity:0.7;transition:opacity 0.2s;';
btn.onmouseover = function() { this.style.opacity = '1'; };
btn.onmouseout = function() { this.style.opacity = '0.7'; };
btn.onclick = function() {
navigator.clipboard.writeText(codeBlock.textContent).then(function() {
btn.textContent = 'Copied!';
setTimeout(function() { btn.textContent = 'Copy'; }, 1500);
});
};
codeBlock.parentElement.style.position = 'relative';
codeBlock.parentElement.appendChild(btn);
});
}
addCopyButtons();
// Re-run on dynamic content
var observer = new MutationObserver(addCopyButtons);
observer.observe(document.body, { childList: true, subtree: true });
})();
}
} catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); }
})();
(function(){
try {
var __m = "github.com";
var __re = new RegExp('^' + "github\\.com" + '
GitHub - shinokada/gitstart: One command to create a GitHub repo — with .gitignore, LICENSE, README, initial commit, and push. Zero manual steps. · GitHub
Skip to content

Repository files navigation

Buy Me a Coffee at ko-fi.com

Gitstart

Overview

Gitstart creates, adds, and pushes with one line.

Gitstart automates creating a GitHub repository. It will:

  • Auto-detect project language and create .gitignore (or use -l to specify)
  • Create a license file based on your choice
  • Create a new repository at GitHub.com (public or private)
  • Create a README.md file with the repository name
  • Initialize a git repository (if needed)
  • Auto-detect the active branch from an existing repo
  • Add files and commit with a custom message
  • Add the remote and push
  • Support existing directories and projects

Requirements

  • GitHub CLI (gh), authenticated
  • git installed
  • macOS, Linux, or Windows

Installation

Homebrew (macOS/Linux)

brew install shinokada/gitstart/gitstart

Windows Scoop

scoop bucket add shinokada https://github.com/shinokada/scoop-bucket
scoop install gitstart

Debian/Ubuntu

Download the latest .deb from the releases page and run:

sudo apt install ./gitstart_x.x.x_linux_amd64.deb

Fedora/RHEL

Download the latest .rpm from the releases page and run:

sudo rpm -i gitstart_x.x.x_linux_amd64.rpm

Go install

go install github.com/shinokada/gitstart@latest

This places the gitstart binary in your $GOPATH/bin or $GOBIN directory. Make sure that directory is in your PATH.

Usage

Basic Usage

# Login to GitHub
gh auth login
# Create a new repository
gitstart -d repo-name
# Create in current directorycd existing_project
gitstart -d .

After a Framework Starter

gitstart works seamlessly after scaffolding tools like npx sv create, npm create vite@latest, or composer create-project. Use --post-framework to skip prompts for files the framework already created, while still auto-detecting the language and branch:

npx sv create my-app &&cd my-app && gitstart -d . --post-framework
npm create vite@latest my-app &&cd my-app && gitstart -d . --post-framework
npm create vite@latest my-app -- --template react &&cd my-app && gitstart -d . --post-framework
composer create-project laravel/laravel my-app &&cd my-app && gitstart -d . --post-framework
npx nuxi@latest init my-app &&cd my-app && gitstart -d . --post-framework

Or use quiet mode for a minimal one-liner:

npx sv create my-app &&cd my-app && gitstart -d . -q

Options

-d, --directory DIRECTORY Directory name or path (use . for current directory)
-l, --language LANGUAGE Programming language for .gitignore (auto-detected if omitted)
-p, --private Create a private repository (default: public)
-P, --public Create a public repository
-b, --branch BRANCH Branch name (auto-detected from existing repo; default: main)
-m, --message MESSAGE Initial commit message (default: "Initial commit")
--description DESC Repository description
--no-license Skip LICENSE file creation
--no-readme Skip README.md creation
--post-framework Optimised for use after a framework starter
(implies --no-license --no-readme)
-n, --dry-run Show what would happen without executing
-q, --quiet Minimal output
-h, --help Show help message
version Show version

Language Auto-detection

When -l is not provided and no .gitignore exists, gitstart inspects the project directory for well-known marker files and infers the language automatically:

Marker file(s)Detected language
go.modGo
Cargo.tomlRust
pubspec.yamlDart
composer.jsonComposer (PHP)
GemfileRuby
pom.xml, build.gradle, build.gradle.ktsJava
requirements.txt, pyproject.toml, setup.py, setup.cfgPython
package.jsonNode

If multiple markers are present the first match in the table above wins. You can always override auto-detection with -l.

Branch Auto-detection

When --branch is not explicitly set and a .git directory already exists (e.g. created by a framework starter), gitstart reads the active branch from .git/HEAD and pushes to that branch instead of defaulting to main. Passing --branch explicitly always takes precedence.

Examples

Create a new repository:

gitstart -d my-project

Create with specific programming language:

gitstart -d my-python-app -l python

Create a private repository:

gitstart -d secret-project -p

Use custom commit message and branch:

gitstart -d my-app -m "First release" -b develop

Add repository description:

gitstart -d awesome-tool --description "An amazing CLI tool for developers"

Skip LICENSE and README (e.g. framework already created them):

cd my-existing-project
gitstart -d . --no-license --no-readme

Use --post-framework after a Svelte scaffold:

npx sv create my-app
cd my-app
gitstart -d . --post-framework

Use --post-framework after a React scaffold:

npm create vite@latest my-app -- --template react
cd my-app
gitstart -d . --post-framework

Preview changes without executing (dry run):

gitstart -d test-repo --dry-run

Quiet mode for scripts:

gitstart -d automated-repo -q

Initialize existing project:

cd my-existing-project
gitstart -d . -l javascript --description "My existing JavaScript project"

Show version:

gitstart version

Shell Completion

Gitstart supports Tab completion in your shell. Once set up, pressing Tab after typing part of a flag or subcommand will either complete it automatically or show you the available options. For example:

gitstart --di[TAB] # completes to --directory
gitstart --[TAB] # lists all flags
gitstart [TAB] # lists all subcommands: completion, help, version

Run the setup command for your shell once, then open a new terminal (or source your config file):

Bash

gitstart completion bash >>~/.bashrc
source~/.bashrc

Zsh

gitstart completion zsh >"${fpath[1]}/_gitstart"source~/.zshrc

Fish

gitstart completion fish >~/.config/fish/completions/gitstart.fish

PowerShell

gitstart completion powershell >>$PROFILE

Working with Existing Directories

Empty directory: Creates repository normally.

Directory with files but no git:

  • Warns about existing files
  • Asks for confirmation
  • Preserves existing files
  • Adds them to the initial commit

Directory with existing git repository:

  • Detects existing .git folder
  • Auto-detects the active branch from .git/HEAD
  • Adds remote to existing repository
  • Preserves git history

Existing LICENSE, README.md, or .gitignore:

  • Detects existing files and skips them
  • Use --no-license or --no-readme to explicitly suppress creation
  • Use --post-framework to suppress both at once

Interactive License Selection

When you run gitstart without --no-license, --post-framework, or -q, you'll be prompted to select a license:

Select a license:
1) mit: Simple and permissive
2) apache-2.0: Community-friendly
3) gpl-3.0: Share improvements
4) None

Error Handling

  • Automatic cleanup: If repository creation fails, the remote repository is automatically deleted
  • Validation checks: Ensures all required tools are installed
  • Auth verification: Confirms you're logged in to GitHub
  • File conflict detection: Detects existing files and skips safely
  • Detailed error messages: Clear information about what went wrong and how to fix it

About Licensing

Read more about Licensing.

Changelog

Version 1.2.2

Bug Fixes:

  • Add v1.2.1 changelog and README entries (missed before tagging)

Version 1.2.1

Bug Fixes:

  • Fixed goreleaser CI failure: corrected License to LICENSE in .goreleaser.yaml (archives files list and nfpms contents)

Version 1.2.0

New Features:

  • Auto-detect project language from marker files (go.mod, package.json, Cargo.toml, etc.) when -l is not provided
  • --no-license flag to skip LICENSE creation without suppressing all output
  • --no-readme flag to skip README.md creation without suppressing all output
  • --post-framework flag: optimised mode for use after framework starters — implies --no-license --no-readme
  • Auto-detect active branch from .git/HEAD when --branch is not explicitly set

Bug Fixes:

  • Fixed dry-run language detection to always auto-detect (not only when --post-framework is set)
  • Fixed composer.json marker mapping from PHP to Composer (PHP.gitignore does not exist in GitHub/gitignore)
  • Renamed internal resolvDir to resolveDir (typo fix)

Version 1.1.0

  • Added shell completion support (bash, zsh, fish, PowerShell)

Version 1.0.0 (2026)

Gitstart is now rewritten in Go with full cross-platform support (macOS, Linux, Windows).

Version 0.4.0 (2026-01-18)

New Features:

  • Private repository support with -p/--private flag
  • Custom commit messages with -m/--message flag
  • Custom branch names with -b/--branch flag
  • Repository description with --description flag
  • Dry run mode with --dry-run flag
  • Quiet mode with -q/--quiet flag
  • Full support for existing directories and files
  • Automatic rollback on errors
  • Detection and handling of existing git repositories

Improvements:

  • XDG-compliant config directory (~/.config/gitstart/config)
  • Better error messages with context
  • File conflict detection and user prompts
  • Smarter handling of existing LICENSE, README, and .gitignore files

Bug Fixes:

  • Fixed issue with gh repo create --clone in existing directories
  • Proper handling of existing files to prevent data loss

Version 0.3.0

  • Initial public release

Author

Shinichi Okada

License

Copyright (c) 2021-2026 Shinichi Okada (@shinokada) This software is released under the MIT License, see LICENSE.

About

One command to create a GitHub repo — with .gitignore, LICENSE, README, initial commit, and push. Zero manual steps.

Topics

Resources

Code of conduct

Stars

36 stars

Watchers

2 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { // Force GitHub README to respect dark mode (function() { var style = document.createElement('style'); style.textContent = ' .markdown-body { color-scheme: dark light; } .markdown-body pre { background: #161b22 !important; } .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; } .markdown-body table th, .markdown-body table td { border-color: #30363d !important; } .markdown-body img { background: #0d1117; } .markdown-body blockquote { border-left-color: #8b949e; } .markdown-body hr { border-color: #30363d; } '; document.head.appendChild(style); })(); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' GitHub - shinokada/gitstart: One command to create a GitHub repo — with .gitignore, LICENSE, README, initial commit, and push. Zero manual steps. · GitHub
Skip to content

Repository files navigation

Buy Me a Coffee at ko-fi.com

Gitstart

Overview

Gitstart creates, adds, and pushes with one line.

Gitstart automates creating a GitHub repository. It will:

  • Auto-detect project language and create .gitignore (or use -l to specify)
  • Create a license file based on your choice
  • Create a new repository at GitHub.com (public or private)
  • Create a README.md file with the repository name
  • Initialize a git repository (if needed)
  • Auto-detect the active branch from an existing repo
  • Add files and commit with a custom message
  • Add the remote and push
  • Support existing directories and projects

Requirements

  • GitHub CLI (gh), authenticated
  • git installed
  • macOS, Linux, or Windows

Installation

Homebrew (macOS/Linux)

brew install shinokada/gitstart/gitstart

Windows Scoop

scoop bucket add shinokada https://github.com/shinokada/scoop-bucket
scoop install gitstart

Debian/Ubuntu

Download the latest .deb from the releases page and run:

sudo apt install ./gitstart_x.x.x_linux_amd64.deb

Fedora/RHEL

Download the latest .rpm from the releases page and run:

sudo rpm -i gitstart_x.x.x_linux_amd64.rpm

Go install

go install github.com/shinokada/gitstart@latest

This places the gitstart binary in your $GOPATH/bin or $GOBIN directory. Make sure that directory is in your PATH.

Usage

Basic Usage

# Login to GitHub
gh auth login
# Create a new repository
gitstart -d repo-name
# Create in current directorycd existing_project
gitstart -d .

After a Framework Starter

gitstart works seamlessly after scaffolding tools like npx sv create, npm create vite@latest, or composer create-project. Use --post-framework to skip prompts for files the framework already created, while still auto-detecting the language and branch:

npx sv create my-app &&cd my-app && gitstart -d . --post-framework
npm create vite@latest my-app &&cd my-app && gitstart -d . --post-framework
npm create vite@latest my-app -- --template react &&cd my-app && gitstart -d . --post-framework
composer create-project laravel/laravel my-app &&cd my-app && gitstart -d . --post-framework
npx nuxi@latest init my-app &&cd my-app && gitstart -d . --post-framework

Or use quiet mode for a minimal one-liner:

npx sv create my-app &&cd my-app && gitstart -d . -q

Options

-d, --directory DIRECTORY Directory name or path (use . for current directory)
-l, --language LANGUAGE Programming language for .gitignore (auto-detected if omitted)
-p, --private Create a private repository (default: public)
-P, --public Create a public repository
-b, --branch BRANCH Branch name (auto-detected from existing repo; default: main)
-m, --message MESSAGE Initial commit message (default: "Initial commit")
--description DESC Repository description
--no-license Skip LICENSE file creation
--no-readme Skip README.md creation
--post-framework Optimised for use after a framework starter
(implies --no-license --no-readme)
-n, --dry-run Show what would happen without executing
-q, --quiet Minimal output
-h, --help Show help message
version Show version

Language Auto-detection

When -l is not provided and no .gitignore exists, gitstart inspects the project directory for well-known marker files and infers the language automatically:

Marker file(s)Detected language
go.modGo
Cargo.tomlRust
pubspec.yamlDart
composer.jsonComposer (PHP)
GemfileRuby
pom.xml, build.gradle, build.gradle.ktsJava
requirements.txt, pyproject.toml, setup.py, setup.cfgPython
package.jsonNode

If multiple markers are present the first match in the table above wins. You can always override auto-detection with -l.

Branch Auto-detection

When --branch is not explicitly set and a .git directory already exists (e.g. created by a framework starter), gitstart reads the active branch from .git/HEAD and pushes to that branch instead of defaulting to main. Passing --branch explicitly always takes precedence.

Examples

Create a new repository:

gitstart -d my-project

Create with specific programming language:

gitstart -d my-python-app -l python

Create a private repository:

gitstart -d secret-project -p

Use custom commit message and branch:

gitstart -d my-app -m "First release" -b develop

Add repository description:

gitstart -d awesome-tool --description "An amazing CLI tool for developers"

Skip LICENSE and README (e.g. framework already created them):

cd my-existing-project
gitstart -d . --no-license --no-readme

Use --post-framework after a Svelte scaffold:

npx sv create my-app
cd my-app
gitstart -d . --post-framework

Use --post-framework after a React scaffold:

npm create vite@latest my-app -- --template react
cd my-app
gitstart -d . --post-framework

Preview changes without executing (dry run):

gitstart -d test-repo --dry-run

Quiet mode for scripts:

gitstart -d automated-repo -q

Initialize existing project:

cd my-existing-project
gitstart -d . -l javascript --description "My existing JavaScript project"

Show version:

gitstart version

Shell Completion

Gitstart supports Tab completion in your shell. Once set up, pressing Tab after typing part of a flag or subcommand will either complete it automatically or show you the available options. For example:

gitstart --di[TAB] # completes to --directory
gitstart --[TAB] # lists all flags
gitstart [TAB] # lists all subcommands: completion, help, version

Run the setup command for your shell once, then open a new terminal (or source your config file):

Bash

gitstart completion bash >>~/.bashrc
source~/.bashrc

Zsh

gitstart completion zsh >"${fpath[1]}/_gitstart"source~/.zshrc

Fish

gitstart completion fish >~/.config/fish/completions/gitstart.fish

PowerShell

gitstart completion powershell >>$PROFILE

Working with Existing Directories

Empty directory: Creates repository normally.

Directory with files but no git:

  • Warns about existing files
  • Asks for confirmation
  • Preserves existing files
  • Adds them to the initial commit

Directory with existing git repository:

  • Detects existing .git folder
  • Auto-detects the active branch from .git/HEAD
  • Adds remote to existing repository
  • Preserves git history

Existing LICENSE, README.md, or .gitignore:

  • Detects existing files and skips them
  • Use --no-license or --no-readme to explicitly suppress creation
  • Use --post-framework to suppress both at once

Interactive License Selection

When you run gitstart without --no-license, --post-framework, or -q, you'll be prompted to select a license:

Select a license:
1) mit: Simple and permissive
2) apache-2.0: Community-friendly
3) gpl-3.0: Share improvements
4) None

Error Handling

  • Automatic cleanup: If repository creation fails, the remote repository is automatically deleted
  • Validation checks: Ensures all required tools are installed
  • Auth verification: Confirms you're logged in to GitHub
  • File conflict detection: Detects existing files and skips safely
  • Detailed error messages: Clear information about what went wrong and how to fix it

About Licensing

Read more about Licensing.

Changelog

Version 1.2.2

Bug Fixes:

  • Add v1.2.1 changelog and README entries (missed before tagging)

Version 1.2.1

Bug Fixes:

  • Fixed goreleaser CI failure: corrected License to LICENSE in .goreleaser.yaml (archives files list and nfpms contents)

Version 1.2.0

New Features:

  • Auto-detect project language from marker files (go.mod, package.json, Cargo.toml, etc.) when -l is not provided
  • --no-license flag to skip LICENSE creation without suppressing all output
  • --no-readme flag to skip README.md creation without suppressing all output
  • --post-framework flag: optimised mode for use after framework starters — implies --no-license --no-readme
  • Auto-detect active branch from .git/HEAD when --branch is not explicitly set

Bug Fixes:

  • Fixed dry-run language detection to always auto-detect (not only when --post-framework is set)
  • Fixed composer.json marker mapping from PHP to Composer (PHP.gitignore does not exist in GitHub/gitignore)
  • Renamed internal resolvDir to resolveDir (typo fix)

Version 1.1.0

  • Added shell completion support (bash, zsh, fish, PowerShell)

Version 1.0.0 (2026)

Gitstart is now rewritten in Go with full cross-platform support (macOS, Linux, Windows).

Version 0.4.0 (2026-01-18)

New Features:

  • Private repository support with -p/--private flag
  • Custom commit messages with -m/--message flag
  • Custom branch names with -b/--branch flag
  • Repository description with --description flag
  • Dry run mode with --dry-run flag
  • Quiet mode with -q/--quiet flag
  • Full support for existing directories and files
  • Automatic rollback on errors
  • Detection and handling of existing git repositories

Improvements:

  • XDG-compliant config directory (~/.config/gitstart/config)
  • Better error messages with context
  • File conflict detection and user prompts
  • Smarter handling of existing LICENSE, README, and .gitignore files

Bug Fixes:

  • Fixed issue with gh repo create --clone in existing directories
  • Proper handling of existing files to prevent data loss

Version 0.3.0

  • Initial public release

Author

Shinichi Okada

License

Copyright (c) 2021-2026 Shinichi Okada (@shinokada) This software is released under the MIT License, see LICENSE.

About

One command to create a GitHub repo — with .gitignore, LICENSE, README, initial commit, and push. Zero manual steps.

Topics

Resources

Code of conduct

Stars

36 stars

Watchers

2 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { // Highlight search terms from Google/DuckDuckGo/Bing referrer (function() { var ref = document.referrer; var terms = []; if (ref.includes('google.com') || ref.includes('duckduckgo.com') || ref.includes('bing.com')) { var url = new URL(ref); var q = url.searchParams.get('q') || url.searchParams.get('p'); if (q) { terms = q.split(/\s+/).filter(function(t) { return t.length > 2; }); } } if (terms.length === 0) return; var style = document.createElement('style'); style.textContent = '.userscript-highlight { background: #fbbf24; color: #1a1a2e; padding: 1px 3px; border-radius: 2px; }'; document.head.appendChild(style); function highlight(node) { if (node.nodeType === 3) { // text node var text = node.textContent; var found = false; terms.forEach(function(term) { var regex = new RegExp('(' + term.replace(/[.*+?^${}()|[\]\\]/g, '\\') + ')', 'gi'); if (regex.test(text)) { found = true; var frag = document.createDocumentFragment(); var parts = text.split(regex); parts.forEach(function(part, i) { if (i % 2 === 0) { frag.appendChild(document.createTextNode(part)); } else { var span = document.createElement('span'); span.className = 'userscript-highlight'; span.textContent = part; frag.appendChild(span); } }); node.parentNode.replaceChild(frag, node); } }); } else if (node.nodeType === 1 && node.childNodes) { // element var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT']; if (!skipTags.includes(node.tagName)) { Array.from(node.childNodes).forEach(highlight); } } } highlight(document.body); // Re-highlight on dynamic content var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1 || node.nodeType === 3) highlight(node); }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' GitHub - shinokada/gitstart: One command to create a GitHub repo — with .gitignore, LICENSE, README, initial commit, and push. Zero manual steps. · GitHub
Skip to content

Repository files navigation

Buy Me a Coffee at ko-fi.com

Gitstart

Overview

Gitstart creates, adds, and pushes with one line.

Gitstart automates creating a GitHub repository. It will:

  • Auto-detect project language and create .gitignore (or use -l to specify)
  • Create a license file based on your choice
  • Create a new repository at GitHub.com (public or private)
  • Create a README.md file with the repository name
  • Initialize a git repository (if needed)
  • Auto-detect the active branch from an existing repo
  • Add files and commit with a custom message
  • Add the remote and push
  • Support existing directories and projects

Requirements

  • GitHub CLI (gh), authenticated
  • git installed
  • macOS, Linux, or Windows

Installation

Homebrew (macOS/Linux)

brew install shinokada/gitstart/gitstart

Windows Scoop

scoop bucket add shinokada https://github.com/shinokada/scoop-bucket
scoop install gitstart

Debian/Ubuntu

Download the latest .deb from the releases page and run:

sudo apt install ./gitstart_x.x.x_linux_amd64.deb

Fedora/RHEL

Download the latest .rpm from the releases page and run:

sudo rpm -i gitstart_x.x.x_linux_amd64.rpm

Go install

go install github.com/shinokada/gitstart@latest

This places the gitstart binary in your $GOPATH/bin or $GOBIN directory. Make sure that directory is in your PATH.

Usage

Basic Usage

# Login to GitHub
gh auth login
# Create a new repository
gitstart -d repo-name
# Create in current directorycd existing_project
gitstart -d .

After a Framework Starter

gitstart works seamlessly after scaffolding tools like npx sv create, npm create vite@latest, or composer create-project. Use --post-framework to skip prompts for files the framework already created, while still auto-detecting the language and branch:

npx sv create my-app &&cd my-app && gitstart -d . --post-framework
npm create vite@latest my-app &&cd my-app && gitstart -d . --post-framework
npm create vite@latest my-app -- --template react &&cd my-app && gitstart -d . --post-framework
composer create-project laravel/laravel my-app &&cd my-app && gitstart -d . --post-framework
npx nuxi@latest init my-app &&cd my-app && gitstart -d . --post-framework

Or use quiet mode for a minimal one-liner:

npx sv create my-app &&cd my-app && gitstart -d . -q

Options

-d, --directory DIRECTORY Directory name or path (use . for current directory)
-l, --language LANGUAGE Programming language for .gitignore (auto-detected if omitted)
-p, --private Create a private repository (default: public)
-P, --public Create a public repository
-b, --branch BRANCH Branch name (auto-detected from existing repo; default: main)
-m, --message MESSAGE Initial commit message (default: "Initial commit")
--description DESC Repository description
--no-license Skip LICENSE file creation
--no-readme Skip README.md creation
--post-framework Optimised for use after a framework starter
(implies --no-license --no-readme)
-n, --dry-run Show what would happen without executing
-q, --quiet Minimal output
-h, --help Show help message
version Show version

Language Auto-detection

When -l is not provided and no .gitignore exists, gitstart inspects the project directory for well-known marker files and infers the language automatically:

Marker file(s)Detected language
go.modGo
Cargo.tomlRust
pubspec.yamlDart
composer.jsonComposer (PHP)
GemfileRuby
pom.xml, build.gradle, build.gradle.ktsJava
requirements.txt, pyproject.toml, setup.py, setup.cfgPython
package.jsonNode

If multiple markers are present the first match in the table above wins. You can always override auto-detection with -l.

Branch Auto-detection

When --branch is not explicitly set and a .git directory already exists (e.g. created by a framework starter), gitstart reads the active branch from .git/HEAD and pushes to that branch instead of defaulting to main. Passing --branch explicitly always takes precedence.

Examples

Create a new repository:

gitstart -d my-project

Create with specific programming language:

gitstart -d my-python-app -l python

Create a private repository:

gitstart -d secret-project -p

Use custom commit message and branch:

gitstart -d my-app -m "First release" -b develop

Add repository description:

gitstart -d awesome-tool --description "An amazing CLI tool for developers"

Skip LICENSE and README (e.g. framework already created them):

cd my-existing-project
gitstart -d . --no-license --no-readme

Use --post-framework after a Svelte scaffold:

npx sv create my-app
cd my-app
gitstart -d . --post-framework

Use --post-framework after a React scaffold:

npm create vite@latest my-app -- --template react
cd my-app
gitstart -d . --post-framework

Preview changes without executing (dry run):

gitstart -d test-repo --dry-run

Quiet mode for scripts:

gitstart -d automated-repo -q

Initialize existing project:

cd my-existing-project
gitstart -d . -l javascript --description "My existing JavaScript project"

Show version:

gitstart version

Shell Completion

Gitstart supports Tab completion in your shell. Once set up, pressing Tab after typing part of a flag or subcommand will either complete it automatically or show you the available options. For example:

gitstart --di[TAB] # completes to --directory
gitstart --[TAB] # lists all flags
gitstart [TAB] # lists all subcommands: completion, help, version

Run the setup command for your shell once, then open a new terminal (or source your config file):

Bash

gitstart completion bash >>~/.bashrc
source~/.bashrc

Zsh

gitstart completion zsh >"${fpath[1]}/_gitstart"source~/.zshrc

Fish

gitstart completion fish >~/.config/fish/completions/gitstart.fish

PowerShell

gitstart completion powershell >>$PROFILE

Working with Existing Directories

Empty directory: Creates repository normally.

Directory with files but no git:

  • Warns about existing files
  • Asks for confirmation
  • Preserves existing files
  • Adds them to the initial commit

Directory with existing git repository:

  • Detects existing .git folder
  • Auto-detects the active branch from .git/HEAD
  • Adds remote to existing repository
  • Preserves git history

Existing LICENSE, README.md, or .gitignore:

  • Detects existing files and skips them
  • Use --no-license or --no-readme to explicitly suppress creation
  • Use --post-framework to suppress both at once

Interactive License Selection

When you run gitstart without --no-license, --post-framework, or -q, you'll be prompted to select a license:

Select a license:
1) mit: Simple and permissive
2) apache-2.0: Community-friendly
3) gpl-3.0: Share improvements
4) None

Error Handling

  • Automatic cleanup: If repository creation fails, the remote repository is automatically deleted
  • Validation checks: Ensures all required tools are installed
  • Auth verification: Confirms you're logged in to GitHub
  • File conflict detection: Detects existing files and skips safely
  • Detailed error messages: Clear information about what went wrong and how to fix it

About Licensing

Read more about Licensing.

Changelog

Version 1.2.2

Bug Fixes:

  • Add v1.2.1 changelog and README entries (missed before tagging)

Version 1.2.1

Bug Fixes:

  • Fixed goreleaser CI failure: corrected License to LICENSE in .goreleaser.yaml (archives files list and nfpms contents)

Version 1.2.0

New Features:

  • Auto-detect project language from marker files (go.mod, package.json, Cargo.toml, etc.) when -l is not provided
  • --no-license flag to skip LICENSE creation without suppressing all output
  • --no-readme flag to skip README.md creation without suppressing all output
  • --post-framework flag: optimised mode for use after framework starters — implies --no-license --no-readme
  • Auto-detect active branch from .git/HEAD when --branch is not explicitly set

Bug Fixes:

  • Fixed dry-run language detection to always auto-detect (not only when --post-framework is set)
  • Fixed composer.json marker mapping from PHP to Composer (PHP.gitignore does not exist in GitHub/gitignore)
  • Renamed internal resolvDir to resolveDir (typo fix)

Version 1.1.0

  • Added shell completion support (bash, zsh, fish, PowerShell)

Version 1.0.0 (2026)

Gitstart is now rewritten in Go with full cross-platform support (macOS, Linux, Windows).

Version 0.4.0 (2026-01-18)

New Features:

  • Private repository support with -p/--private flag
  • Custom commit messages with -m/--message flag
  • Custom branch names with -b/--branch flag
  • Repository description with --description flag
  • Dry run mode with --dry-run flag
  • Quiet mode with -q/--quiet flag
  • Full support for existing directories and files
  • Automatic rollback on errors
  • Detection and handling of existing git repositories

Improvements:

  • XDG-compliant config directory (~/.config/gitstart/config)
  • Better error messages with context
  • File conflict detection and user prompts
  • Smarter handling of existing LICENSE, README, and .gitignore files

Bug Fixes:

  • Fixed issue with gh repo create --clone in existing directories
  • Proper handling of existing files to prevent data loss

Version 0.3.0

  • Initial public release

Author

Shinichi Okada

License

Copyright (c) 2021-2026 Shinichi Okada (@shinokada) This software is released under the MIT License, see LICENSE.

About

One command to create a GitHub repo — with .gitignore, LICENSE, README, initial commit, and push. Zero manual steps.

Topics

Resources

Code of conduct

Stars

36 stars

Watchers

2 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { // Strip utm_, fbclid, gclid, etc. from all links on page (function() { var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content', 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid', 'ref', 'ref_src', 'source', 'medium', 'campaign']; function cleanUrl(url) { try { var u = new URL(url, window.location.origin); var changed = false; trackingParams.forEach(function(p) { if (u.searchParams.has(p)) { u.searchParams.delete(p); changed = true; } }); return changed ? u.toString() : url; } catch (e) { return url; } } function cleanLinks() { document.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } cleanLinks(); var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1) { if (node.tagName === 'A') cleanLinks(); node.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + ' GitHub - shinokada/gitstart: One command to create a GitHub repo — with .gitignore, LICENSE, README, initial commit, and push. Zero manual steps. · GitHub
Skip to content

Repository files navigation

Buy Me a Coffee at ko-fi.com

Gitstart

Overview

Gitstart creates, adds, and pushes with one line.

Gitstart automates creating a GitHub repository. It will:

  • Auto-detect project language and create .gitignore (or use -l to specify)
  • Create a license file based on your choice
  • Create a new repository at GitHub.com (public or private)
  • Create a README.md file with the repository name
  • Initialize a git repository (if needed)
  • Auto-detect the active branch from an existing repo
  • Add files and commit with a custom message
  • Add the remote and push
  • Support existing directories and projects

Requirements

  • GitHub CLI (gh), authenticated
  • git installed
  • macOS, Linux, or Windows

Installation

Homebrew (macOS/Linux)

brew install shinokada/gitstart/gitstart

Windows Scoop

scoop bucket add shinokada https://github.com/shinokada/scoop-bucket
scoop install gitstart

Debian/Ubuntu

Download the latest .deb from the releases page and run:

sudo apt install ./gitstart_x.x.x_linux_amd64.deb

Fedora/RHEL

Download the latest .rpm from the releases page and run:

sudo rpm -i gitstart_x.x.x_linux_amd64.rpm

Go install

go install github.com/shinokada/gitstart@latest

This places the gitstart binary in your $GOPATH/bin or $GOBIN directory. Make sure that directory is in your PATH.

Usage

Basic Usage

# Login to GitHub
gh auth login
# Create a new repository
gitstart -d repo-name
# Create in current directorycd existing_project
gitstart -d .

After a Framework Starter

gitstart works seamlessly after scaffolding tools like npx sv create, npm create vite@latest, or composer create-project. Use --post-framework to skip prompts for files the framework already created, while still auto-detecting the language and branch:

npx sv create my-app &&cd my-app && gitstart -d . --post-framework
npm create vite@latest my-app &&cd my-app && gitstart -d . --post-framework
npm create vite@latest my-app -- --template react &&cd my-app && gitstart -d . --post-framework
composer create-project laravel/laravel my-app &&cd my-app && gitstart -d . --post-framework
npx nuxi@latest init my-app &&cd my-app && gitstart -d . --post-framework

Or use quiet mode for a minimal one-liner:

npx sv create my-app &&cd my-app && gitstart -d . -q

Options

-d, --directory DIRECTORY Directory name or path (use . for current directory)
-l, --language LANGUAGE Programming language for .gitignore (auto-detected if omitted)
-p, --private Create a private repository (default: public)
-P, --public Create a public repository
-b, --branch BRANCH Branch name (auto-detected from existing repo; default: main)
-m, --message MESSAGE Initial commit message (default: "Initial commit")
--description DESC Repository description
--no-license Skip LICENSE file creation
--no-readme Skip README.md creation
--post-framework Optimised for use after a framework starter
(implies --no-license --no-readme)
-n, --dry-run Show what would happen without executing
-q, --quiet Minimal output
-h, --help Show help message
version Show version

Language Auto-detection

When -l is not provided and no .gitignore exists, gitstart inspects the project directory for well-known marker files and infers the language automatically:

Marker file(s)Detected language
go.modGo
Cargo.tomlRust
pubspec.yamlDart
composer.jsonComposer (PHP)
GemfileRuby
pom.xml, build.gradle, build.gradle.ktsJava
requirements.txt, pyproject.toml, setup.py, setup.cfgPython
package.jsonNode

If multiple markers are present the first match in the table above wins. You can always override auto-detection with -l.

Branch Auto-detection

When --branch is not explicitly set and a .git directory already exists (e.g. created by a framework starter), gitstart reads the active branch from .git/HEAD and pushes to that branch instead of defaulting to main. Passing --branch explicitly always takes precedence.

Examples

Create a new repository:

gitstart -d my-project

Create with specific programming language:

gitstart -d my-python-app -l python

Create a private repository:

gitstart -d secret-project -p

Use custom commit message and branch:

gitstart -d my-app -m "First release" -b develop

Add repository description:

gitstart -d awesome-tool --description "An amazing CLI tool for developers"

Skip LICENSE and README (e.g. framework already created them):

cd my-existing-project
gitstart -d . --no-license --no-readme

Use --post-framework after a Svelte scaffold:

npx sv create my-app
cd my-app
gitstart -d . --post-framework

Use --post-framework after a React scaffold:

npm create vite@latest my-app -- --template react
cd my-app
gitstart -d . --post-framework

Preview changes without executing (dry run):

gitstart -d test-repo --dry-run

Quiet mode for scripts:

gitstart -d automated-repo -q

Initialize existing project:

cd my-existing-project
gitstart -d . -l javascript --description "My existing JavaScript project"

Show version:

gitstart version

Shell Completion

Gitstart supports Tab completion in your shell. Once set up, pressing Tab after typing part of a flag or subcommand will either complete it automatically or show you the available options. For example:

gitstart --di[TAB] # completes to --directory
gitstart --[TAB] # lists all flags
gitstart [TAB] # lists all subcommands: completion, help, version

Run the setup command for your shell once, then open a new terminal (or source your config file):

Bash

gitstart completion bash >>~/.bashrc
source~/.bashrc

Zsh

gitstart completion zsh >"${fpath[1]}/_gitstart"source~/.zshrc

Fish

gitstart completion fish >~/.config/fish/completions/gitstart.fish

PowerShell

gitstart completion powershell >>$PROFILE

Working with Existing Directories

Empty directory: Creates repository normally.

Directory with files but no git:

  • Warns about existing files
  • Asks for confirmation
  • Preserves existing files
  • Adds them to the initial commit

Directory with existing git repository:

  • Detects existing .git folder
  • Auto-detects the active branch from .git/HEAD
  • Adds remote to existing repository
  • Preserves git history

Existing LICENSE, README.md, or .gitignore:

  • Detects existing files and skips them
  • Use --no-license or --no-readme to explicitly suppress creation
  • Use --post-framework to suppress both at once

Interactive License Selection

When you run gitstart without --no-license, --post-framework, or -q, you'll be prompted to select a license:

Select a license:
1) mit: Simple and permissive
2) apache-2.0: Community-friendly
3) gpl-3.0: Share improvements
4) None

Error Handling

  • Automatic cleanup: If repository creation fails, the remote repository is automatically deleted
  • Validation checks: Ensures all required tools are installed
  • Auth verification: Confirms you're logged in to GitHub
  • File conflict detection: Detects existing files and skips safely
  • Detailed error messages: Clear information about what went wrong and how to fix it

About Licensing

Read more about Licensing.

Changelog

Version 1.2.2

Bug Fixes:

  • Add v1.2.1 changelog and README entries (missed before tagging)

Version 1.2.1

Bug Fixes:

  • Fixed goreleaser CI failure: corrected License to LICENSE in .goreleaser.yaml (archives files list and nfpms contents)

Version 1.2.0

New Features:

  • Auto-detect project language from marker files (go.mod, package.json, Cargo.toml, etc.) when -l is not provided
  • --no-license flag to skip LICENSE creation without suppressing all output
  • --no-readme flag to skip README.md creation without suppressing all output
  • --post-framework flag: optimised mode for use after framework starters — implies --no-license --no-readme
  • Auto-detect active branch from .git/HEAD when --branch is not explicitly set

Bug Fixes:

  • Fixed dry-run language detection to always auto-detect (not only when --post-framework is set)
  • Fixed composer.json marker mapping from PHP to Composer (PHP.gitignore does not exist in GitHub/gitignore)
  • Renamed internal resolvDir to resolveDir (typo fix)

Version 1.1.0

  • Added shell completion support (bash, zsh, fish, PowerShell)

Version 1.0.0 (2026)

Gitstart is now rewritten in Go with full cross-platform support (macOS, Linux, Windows).

Version 0.4.0 (2026-01-18)

New Features:

  • Private repository support with -p/--private flag
  • Custom commit messages with -m/--message flag
  • Custom branch names with -b/--branch flag
  • Repository description with --description flag
  • Dry run mode with --dry-run flag
  • Quiet mode with -q/--quiet flag
  • Full support for existing directories and files
  • Automatic rollback on errors
  • Detection and handling of existing git repositories

Improvements:

  • XDG-compliant config directory (~/.config/gitstart/config)
  • Better error messages with context
  • File conflict detection and user prompts
  • Smarter handling of existing LICENSE, README, and .gitignore files

Bug Fixes:

  • Fixed issue with gh repo create --clone in existing directories
  • Proper handling of existing files to prevent data loss

Version 0.3.0

  • Initial public release

Author

Shinichi Okada

License

Copyright (c) 2021-2026 Shinichi Okada (@shinokada) This software is released under the MIT License, see LICENSE.

About

One command to create a GitHub repo — with .gitignore, LICENSE, README, initial commit, and push. Zero manual steps.

Topics

Resources

Code of conduct

Stars

36 stars

Watchers

2 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { // Auto-enable theater mode on YouTube (function() { function tryTheater() { var btn = document.querySelector('button[aria-label="Theater mode"], ytd-player #player button[title="Theater mode"]'); if (btn && !btn.classList.contains('activated')) { btn.click(); } } // Try immediately tryTheater(); // Try after navigation (SPA) var lastUrl = location.href; setInterval(function() { if (location.href !== lastUrl) { lastUrl = location.href; setTimeout(tryTheater, 500); } }, 1000); // Also try on player load var observer = new MutationObserver(tryTheater); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' GitHub - shinokada/gitstart: One command to create a GitHub repo — with .gitignore, LICENSE, README, initial commit, and push. Zero manual steps. · GitHub
Skip to content

Repository files navigation

Buy Me a Coffee at ko-fi.com

Gitstart

Overview

Gitstart creates, adds, and pushes with one line.

Gitstart automates creating a GitHub repository. It will:

  • Auto-detect project language and create .gitignore (or use -l to specify)
  • Create a license file based on your choice
  • Create a new repository at GitHub.com (public or private)
  • Create a README.md file with the repository name
  • Initialize a git repository (if needed)
  • Auto-detect the active branch from an existing repo
  • Add files and commit with a custom message
  • Add the remote and push
  • Support existing directories and projects

Requirements

  • GitHub CLI (gh), authenticated
  • git installed
  • macOS, Linux, or Windows

Installation

Homebrew (macOS/Linux)

brew install shinokada/gitstart/gitstart

Windows Scoop

scoop bucket add shinokada https://github.com/shinokada/scoop-bucket
scoop install gitstart

Debian/Ubuntu

Download the latest .deb from the releases page and run:

sudo apt install ./gitstart_x.x.x_linux_amd64.deb

Fedora/RHEL

Download the latest .rpm from the releases page and run:

sudo rpm -i gitstart_x.x.x_linux_amd64.rpm

Go install

go install github.com/shinokada/gitstart@latest

This places the gitstart binary in your $GOPATH/bin or $GOBIN directory. Make sure that directory is in your PATH.

Usage

Basic Usage

# Login to GitHub
gh auth login
# Create a new repository
gitstart -d repo-name
# Create in current directorycd existing_project
gitstart -d .

After a Framework Starter

gitstart works seamlessly after scaffolding tools like npx sv create, npm create vite@latest, or composer create-project. Use --post-framework to skip prompts for files the framework already created, while still auto-detecting the language and branch:

npx sv create my-app &&cd my-app && gitstart -d . --post-framework
npm create vite@latest my-app &&cd my-app && gitstart -d . --post-framework
npm create vite@latest my-app -- --template react &&cd my-app && gitstart -d . --post-framework
composer create-project laravel/laravel my-app &&cd my-app && gitstart -d . --post-framework
npx nuxi@latest init my-app &&cd my-app && gitstart -d . --post-framework

Or use quiet mode for a minimal one-liner:

npx sv create my-app &&cd my-app && gitstart -d . -q

Options

-d, --directory DIRECTORY Directory name or path (use . for current directory)
-l, --language LANGUAGE Programming language for .gitignore (auto-detected if omitted)
-p, --private Create a private repository (default: public)
-P, --public Create a public repository
-b, --branch BRANCH Branch name (auto-detected from existing repo; default: main)
-m, --message MESSAGE Initial commit message (default: "Initial commit")
--description DESC Repository description
--no-license Skip LICENSE file creation
--no-readme Skip README.md creation
--post-framework Optimised for use after a framework starter
(implies --no-license --no-readme)
-n, --dry-run Show what would happen without executing
-q, --quiet Minimal output
-h, --help Show help message
version Show version

Language Auto-detection

When -l is not provided and no .gitignore exists, gitstart inspects the project directory for well-known marker files and infers the language automatically:

Marker file(s)Detected language
go.modGo
Cargo.tomlRust
pubspec.yamlDart
composer.jsonComposer (PHP)
GemfileRuby
pom.xml, build.gradle, build.gradle.ktsJava
requirements.txt, pyproject.toml, setup.py, setup.cfgPython
package.jsonNode

If multiple markers are present the first match in the table above wins. You can always override auto-detection with -l.

Branch Auto-detection

When --branch is not explicitly set and a .git directory already exists (e.g. created by a framework starter), gitstart reads the active branch from .git/HEAD and pushes to that branch instead of defaulting to main. Passing --branch explicitly always takes precedence.

Examples

Create a new repository:

gitstart -d my-project

Create with specific programming language:

gitstart -d my-python-app -l python

Create a private repository:

gitstart -d secret-project -p

Use custom commit message and branch:

gitstart -d my-app -m "First release" -b develop

Add repository description:

gitstart -d awesome-tool --description "An amazing CLI tool for developers"

Skip LICENSE and README (e.g. framework already created them):

cd my-existing-project
gitstart -d . --no-license --no-readme

Use --post-framework after a Svelte scaffold:

npx sv create my-app
cd my-app
gitstart -d . --post-framework

Use --post-framework after a React scaffold:

npm create vite@latest my-app -- --template react
cd my-app
gitstart -d . --post-framework

Preview changes without executing (dry run):

gitstart -d test-repo --dry-run

Quiet mode for scripts:

gitstart -d automated-repo -q

Initialize existing project:

cd my-existing-project
gitstart -d . -l javascript --description "My existing JavaScript project"

Show version:

gitstart version

Shell Completion

Gitstart supports Tab completion in your shell. Once set up, pressing Tab after typing part of a flag or subcommand will either complete it automatically or show you the available options. For example:

gitstart --di[TAB] # completes to --directory
gitstart --[TAB] # lists all flags
gitstart [TAB] # lists all subcommands: completion, help, version

Run the setup command for your shell once, then open a new terminal (or source your config file):

Bash

gitstart completion bash >>~/.bashrc
source~/.bashrc

Zsh

gitstart completion zsh >"${fpath[1]}/_gitstart"source~/.zshrc

Fish

gitstart completion fish >~/.config/fish/completions/gitstart.fish

PowerShell

gitstart completion powershell >>$PROFILE

Working with Existing Directories

Empty directory: Creates repository normally.

Directory with files but no git:

  • Warns about existing files
  • Asks for confirmation
  • Preserves existing files
  • Adds them to the initial commit

Directory with existing git repository:

  • Detects existing .git folder
  • Auto-detects the active branch from .git/HEAD
  • Adds remote to existing repository
  • Preserves git history

Existing LICENSE, README.md, or .gitignore:

  • Detects existing files and skips them
  • Use --no-license or --no-readme to explicitly suppress creation
  • Use --post-framework to suppress both at once

Interactive License Selection

When you run gitstart without --no-license, --post-framework, or -q, you'll be prompted to select a license:

Select a license:
1) mit: Simple and permissive
2) apache-2.0: Community-friendly
3) gpl-3.0: Share improvements
4) None

Error Handling

  • Automatic cleanup: If repository creation fails, the remote repository is automatically deleted
  • Validation checks: Ensures all required tools are installed
  • Auth verification: Confirms you're logged in to GitHub
  • File conflict detection: Detects existing files and skips safely
  • Detailed error messages: Clear information about what went wrong and how to fix it

About Licensing

Read more about Licensing.

Changelog

Version 1.2.2

Bug Fixes:

  • Add v1.2.1 changelog and README entries (missed before tagging)

Version 1.2.1

Bug Fixes:

  • Fixed goreleaser CI failure: corrected License to LICENSE in .goreleaser.yaml (archives files list and nfpms contents)

Version 1.2.0

New Features:

  • Auto-detect project language from marker files (go.mod, package.json, Cargo.toml, etc.) when -l is not provided
  • --no-license flag to skip LICENSE creation without suppressing all output
  • --no-readme flag to skip README.md creation without suppressing all output
  • --post-framework flag: optimised mode for use after framework starters — implies --no-license --no-readme
  • Auto-detect active branch from .git/HEAD when --branch is not explicitly set

Bug Fixes:

  • Fixed dry-run language detection to always auto-detect (not only when --post-framework is set)
  • Fixed composer.json marker mapping from PHP to Composer (PHP.gitignore does not exist in GitHub/gitignore)
  • Renamed internal resolvDir to resolveDir (typo fix)

Version 1.1.0

  • Added shell completion support (bash, zsh, fish, PowerShell)

Version 1.0.0 (2026)

Gitstart is now rewritten in Go with full cross-platform support (macOS, Linux, Windows).

Version 0.4.0 (2026-01-18)

New Features:

  • Private repository support with -p/--private flag
  • Custom commit messages with -m/--message flag
  • Custom branch names with -b/--branch flag
  • Repository description with --description flag
  • Dry run mode with --dry-run flag
  • Quiet mode with -q/--quiet flag
  • Full support for existing directories and files
  • Automatic rollback on errors
  • Detection and handling of existing git repositories

Improvements:

  • XDG-compliant config directory (~/.config/gitstart/config)
  • Better error messages with context
  • File conflict detection and user prompts
  • Smarter handling of existing LICENSE, README, and .gitignore files

Bug Fixes:

  • Fixed issue with gh repo create --clone in existing directories
  • Proper handling of existing files to prevent data loss

Version 0.3.0

  • Initial public release

Author

Shinichi Okada

License

Copyright (c) 2021-2026 Shinichi Okada (@shinokada) This software is released under the MIT License, see LICENSE.

About

One command to create a GitHub repo — with .gitignore, LICENSE, README, initial commit, and push. Zero manual steps.

Topics

Resources

Code of conduct

Stars

36 stars

Watchers

2 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { // Remove or un-stick sticky/fixed headers that block content (function() { function unstick() { document.querySelectorAll('header, nav, [role="banner"], .header, .navbar, .sticky, .fixed-top, [style*="position: fixed"], [style*="position:sticky"]').forEach(function(el) { if (el.style.position === 'fixed' || el.style.position === 'sticky' || getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') { el.style.position = 'static'; el.style.top = 'auto'; el.style.zIndex = 'auto'; } }); } unstick(); var observer = new MutationObserver(unstick); observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] }); })(); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); })(); GitHub - shinokada/gitstart: One command to create a GitHub repo — with .gitignore, LICENSE, README, initial commit, and push. Zero manual steps. · GitHub
Skip to content

Repository files navigation

Buy Me a Coffee at ko-fi.com

Gitstart

Overview

Gitstart creates, adds, and pushes with one line.

Gitstart automates creating a GitHub repository. It will:

  • Auto-detect project language and create .gitignore (or use -l to specify)
  • Create a license file based on your choice
  • Create a new repository at GitHub.com (public or private)
  • Create a README.md file with the repository name
  • Initialize a git repository (if needed)
  • Auto-detect the active branch from an existing repo
  • Add files and commit with a custom message
  • Add the remote and push
  • Support existing directories and projects

Requirements

  • GitHub CLI (gh), authenticated
  • git installed
  • macOS, Linux, or Windows

Installation

Homebrew (macOS/Linux)

brew install shinokada/gitstart/gitstart

Windows Scoop

scoop bucket add shinokada https://github.com/shinokada/scoop-bucket
scoop install gitstart

Debian/Ubuntu

Download the latest .deb from the releases page and run:

sudo apt install ./gitstart_x.x.x_linux_amd64.deb

Fedora/RHEL

Download the latest .rpm from the releases page and run:

sudo rpm -i gitstart_x.x.x_linux_amd64.rpm

Go install

go install github.com/shinokada/gitstart@latest

This places the gitstart binary in your $GOPATH/bin or $GOBIN directory. Make sure that directory is in your PATH.

Usage

Basic Usage

# Login to GitHub
gh auth login
# Create a new repository
gitstart -d repo-name
# Create in current directorycd existing_project
gitstart -d .

After a Framework Starter

gitstart works seamlessly after scaffolding tools like npx sv create, npm create vite@latest, or composer create-project. Use --post-framework to skip prompts for files the framework already created, while still auto-detecting the language and branch:

npx sv create my-app &&cd my-app && gitstart -d . --post-framework
npm create vite@latest my-app &&cd my-app && gitstart -d . --post-framework
npm create vite@latest my-app -- --template react &&cd my-app && gitstart -d . --post-framework
composer create-project laravel/laravel my-app &&cd my-app && gitstart -d . --post-framework
npx nuxi@latest init my-app &&cd my-app && gitstart -d . --post-framework

Or use quiet mode for a minimal one-liner:

npx sv create my-app &&cd my-app && gitstart -d . -q

Options

-d, --directory DIRECTORY Directory name or path (use . for current directory)
-l, --language LANGUAGE Programming language for .gitignore (auto-detected if omitted)
-p, --private Create a private repository (default: public)
-P, --public Create a public repository
-b, --branch BRANCH Branch name (auto-detected from existing repo; default: main)
-m, --message MESSAGE Initial commit message (default: "Initial commit")
--description DESC Repository description
--no-license Skip LICENSE file creation
--no-readme Skip README.md creation
--post-framework Optimised for use after a framework starter
(implies --no-license --no-readme)
-n, --dry-run Show what would happen without executing
-q, --quiet Minimal output
-h, --help Show help message
version Show version

Language Auto-detection

When -l is not provided and no .gitignore exists, gitstart inspects the project directory for well-known marker files and infers the language automatically:

Marker file(s)Detected language
go.modGo
Cargo.tomlRust
pubspec.yamlDart
composer.jsonComposer (PHP)
GemfileRuby
pom.xml, build.gradle, build.gradle.ktsJava
requirements.txt, pyproject.toml, setup.py, setup.cfgPython
package.jsonNode

If multiple markers are present the first match in the table above wins. You can always override auto-detection with -l.

Branch Auto-detection

When --branch is not explicitly set and a .git directory already exists (e.g. created by a framework starter), gitstart reads the active branch from .git/HEAD and pushes to that branch instead of defaulting to main. Passing --branch explicitly always takes precedence.

Examples

Create a new repository:

gitstart -d my-project

Create with specific programming language:

gitstart -d my-python-app -l python

Create a private repository:

gitstart -d secret-project -p

Use custom commit message and branch:

gitstart -d my-app -m "First release" -b develop

Add repository description:

gitstart -d awesome-tool --description "An amazing CLI tool for developers"

Skip LICENSE and README (e.g. framework already created them):

cd my-existing-project
gitstart -d . --no-license --no-readme

Use --post-framework after a Svelte scaffold:

npx sv create my-app
cd my-app
gitstart -d . --post-framework

Use --post-framework after a React scaffold:

npm create vite@latest my-app -- --template react
cd my-app
gitstart -d . --post-framework

Preview changes without executing (dry run):

gitstart -d test-repo --dry-run

Quiet mode for scripts:

gitstart -d automated-repo -q

Initialize existing project:

cd my-existing-project
gitstart -d . -l javascript --description "My existing JavaScript project"

Show version:

gitstart version

Shell Completion

Gitstart supports Tab completion in your shell. Once set up, pressing Tab after typing part of a flag or subcommand will either complete it automatically or show you the available options. For example:

gitstart --di[TAB] # completes to --directory
gitstart --[TAB] # lists all flags
gitstart [TAB] # lists all subcommands: completion, help, version

Run the setup command for your shell once, then open a new terminal (or source your config file):

Bash

gitstart completion bash >>~/.bashrc
source~/.bashrc

Zsh

gitstart completion zsh >"${fpath[1]}/_gitstart"source~/.zshrc

Fish

gitstart completion fish >~/.config/fish/completions/gitstart.fish

PowerShell

gitstart completion powershell >>$PROFILE

Working with Existing Directories

Empty directory: Creates repository normally.

Directory with files but no git:

  • Warns about existing files
  • Asks for confirmation
  • Preserves existing files
  • Adds them to the initial commit

Directory with existing git repository:

  • Detects existing .git folder
  • Auto-detects the active branch from .git/HEAD
  • Adds remote to existing repository
  • Preserves git history

Existing LICENSE, README.md, or .gitignore:

  • Detects existing files and skips them
  • Use --no-license or --no-readme to explicitly suppress creation
  • Use --post-framework to suppress both at once

Interactive License Selection

When you run gitstart without --no-license, --post-framework, or -q, you'll be prompted to select a license:

Select a license:
1) mit: Simple and permissive
2) apache-2.0: Community-friendly
3) gpl-3.0: Share improvements
4) None

Error Handling

  • Automatic cleanup: If repository creation fails, the remote repository is automatically deleted
  • Validation checks: Ensures all required tools are installed
  • Auth verification: Confirms you're logged in to GitHub
  • File conflict detection: Detects existing files and skips safely
  • Detailed error messages: Clear information about what went wrong and how to fix it

About Licensing

Read more about Licensing.

Changelog

Version 1.2.2

Bug Fixes:

  • Add v1.2.1 changelog and README entries (missed before tagging)

Version 1.2.1

Bug Fixes:

  • Fixed goreleaser CI failure: corrected License to LICENSE in .goreleaser.yaml (archives files list and nfpms contents)

Version 1.2.0

New Features:

  • Auto-detect project language from marker files (go.mod, package.json, Cargo.toml, etc.) when -l is not provided
  • --no-license flag to skip LICENSE creation without suppressing all output
  • --no-readme flag to skip README.md creation without suppressing all output
  • --post-framework flag: optimised mode for use after framework starters — implies --no-license --no-readme
  • Auto-detect active branch from .git/HEAD when --branch is not explicitly set

Bug Fixes:

  • Fixed dry-run language detection to always auto-detect (not only when --post-framework is set)
  • Fixed composer.json marker mapping from PHP to Composer (PHP.gitignore does not exist in GitHub/gitignore)
  • Renamed internal resolvDir to resolveDir (typo fix)

Version 1.1.0

  • Added shell completion support (bash, zsh, fish, PowerShell)

Version 1.0.0 (2026)

Gitstart is now rewritten in Go with full cross-platform support (macOS, Linux, Windows).

Version 0.4.0 (2026-01-18)

New Features:

  • Private repository support with -p/--private flag
  • Custom commit messages with -m/--message flag
  • Custom branch names with -b/--branch flag
  • Repository description with --description flag
  • Dry run mode with --dry-run flag
  • Quiet mode with -q/--quiet flag
  • Full support for existing directories and files
  • Automatic rollback on errors
  • Detection and handling of existing git repositories

Improvements:

  • XDG-compliant config directory (~/.config/gitstart/config)
  • Better error messages with context
  • File conflict detection and user prompts
  • Smarter handling of existing LICENSE, README, and .gitignore files

Bug Fixes:

  • Fixed issue with gh repo create --clone in existing directories
  • Proper handling of existing files to prevent data loss

Version 0.3.0

  • Initial public release

Author

Shinichi Okada

License

Copyright (c) 2021-2026 Shinichi Okada (@shinokada) This software is released under the MIT License, see LICENSE.

About

One command to create a GitHub repo — with .gitignore, LICENSE, README, initial commit, and push. Zero manual steps.

Topics

Resources

Code of conduct

Stars

36 stars

Watchers

2 watching

Forks

Releases

Packages

Contributors

Languages