cat-gh-repo-creator

A Windows application written in Rust that detects local, unversioned Rust projects and interactively guides you through a series of steps on a TUI to publish them to GitHub.


Challenges and Solutions

Requirements


Installation

Rust is required.

cargo install --force --git https://github.com/cat2151/cat-gh-repo-creator

First Run

cat-gh-repo-creator

config.toml will be automatically generated, and the application will exit. Please configure the following settings:


Configuration

Upon first launch, config.toml will be automatically generated at the following path:

%LOCALAPPDATA%\cat-gh-repo-creator\config.toml

Please edit scan_directory in config.toml to match your environment (an error will occur if not edited).

scan_directory = "C:\\Users\\<YOUR NAME>\\repos"

Execution

cat-gh-repo-creator

Workflow

[DirList]      Scan results list. Move with j/k, select with ENTER
    ↓ ENTER
[RepoInspect]  Analysis results (OK/NG) and internal repository tree display
    ↓ ENTER (Only if OK)
[CopyDialog]   Confirmation of candidate files for copying found from nearby repositories  y / [N]
    ↓ y
[CopyResult]   Tree display after copying
    ↓ ENTER
[FetchFiles]   Fetch .gitignore / LICENSE using curl
    ↓ Completed
[FetchResult]  Display fetch results
    ↓ Automatic
[CreateDialog] Configuration confirmation for git init ~ gh repo create  y / [N]
    ↓ y
[Executing]    Sequentially execute git init / add / commit / branch -M main / gh repo create, while immediately showing a 250ms spinner and "処理中なのでお待ちください".
    ↓ Completed
[Done]         Automatically open the repository page in a browser → Press ENTER to exit

If the analysis is NG, or if ‘N’ is selected in the dialog, the app transitions to the interruption dialog, and pressing ENTER exits the application.


Key Bindings

Key Active Screen(s) Action
j / DirList Cursor down (moves only to target directories)
k / DirList Cursor up (moves only to target directories)
q All screens Exit application
ENTER All screens Confirm / Proceed to next step
y CopyDialog / CreateDialog Yes (Execute)
n / N / ENTER CopyDialog / CreateDialog No (Proceed to interruption dialog)

Directory Filter

Directories directly under scan_directory are listed in descending order of creation date. Those that meet both of the following conditions are considered targets:

In the TUI, target directories are displayed in white, and non-target directories in gray. The cursor only moves to target directories.


File Copying

Line to be Rewritten Transformed Content
repository: owner/old_name repository: owner/<new_repo_name>
baseurl: /old_name baseurl: /<new_repo_name>

Commands Executed by gh repo create

git init
git add .
git commit -m "Initial commit (generated via Claude chat UI)"
git branch -M main
gh repo create <repository_name> --public --source=. --remote=origin --push --disable-wiki

After completion, https://github.com/<repository_name> will automatically open in your browser.

Assumptions

Goals of This Application

Out of Scope