diff --git a/git-hangman-lab/SKILL.md b/git-hangman-lab/SKILL.md index f3d1448..0c68e9f 100644 --- a/git-hangman-lab/SKILL.md +++ b/git-hangman-lab/SKILL.md @@ -33,23 +33,18 @@ Generate an access token for the current user. {baseDir}/scripts/git-ctrl generate-access-token ``` -### Create Repository +### Repository Operations -Create a new git repository on git.hangman-lab.top. +Manage repositories on git.hangman-lab.top via the `repo` subcommand: ```bash -{baseDir}/scripts/git-ctrl create-repo +{baseDir}/scripts/git-ctrl repo create +{baseDir}/scripts/git-ctrl repo add-collaborators --user --repo +{baseDir}/scripts/git-ctrl repo list-all +{baseDir}/scripts/git-ctrl repo config --repo-path ``` -> **Note**: The repository will be created at `${AGENT_WORKSPACE}/${repo-name}` (default: `/root/.openclaw/workspace/workspace-mentor`) - -### List Projects - -List all repositories visible to the current user on git.hangman-lab.top in markdown table format. - -```bash -{baseDir}/scripts/git-ctrl list-projs -``` +> **Note**: `create` creates the repo at `${AGENT_WORKSPACE}/${repo-name}` ### Pull Request Operations @@ -75,30 +70,6 @@ Link Keycloak account with Gitea (for OAuth binding). {baseDir}/scripts/git-ctrl link-keycloak ``` -### Add Repository Collaborator - -Add a collaborator to a repository. - -```bash -{baseDir}/scripts/git-ctrl repo-add-collaborators --user --repo -``` - -### Repository Config - -When you clone a repository from git.hangman-lab.top and are ready to develop, or after creating a new local repo with git init, run: - -```bash -{baseDir}/scripts/git-ctrl repo-config --repo-path -``` - -### List Projects - -List all repositories visible to the current user on git.hangman-lab.top in markdown table format. - -```bash -{baseDir}/scripts/git-ctrl list-projs -``` - ### External Login Control Enable or disable local login on Gitea. @@ -114,4 +85,4 @@ Reset password for the current user (reads username from secret-mgr). ```bash {baseDir}/scripts/git-ctrl reset-password -``` +``` \ No newline at end of file diff --git a/git-hangman-lab/scripts/git-ctrl b/git-hangman-lab/scripts/git-ctrl index dcdcbe3..8d5999a 100755 --- a/git-hangman-lab/scripts/git-ctrl +++ b/git-hangman-lab/scripts/git-ctrl @@ -1,9 +1,7 @@ #!/bin/bash -# Get the directory where this script is located SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" -# Check if subcommand is provided if [[ $# -eq 0 ]]; then echo "Usage: $0 [options]" echo "" @@ -14,19 +12,16 @@ if [[ $# -eq 0 ]]; then echo " pr Pull request operations (create/list/commits/merge/show)" echo " generate-access-token Generate access token for current user" echo " link-keycloak Link Keycloak account with Gitea" - echo " repo-add-collaborators Add collaborator to repository" - echo " repo-config Configure repository" + echo " repo Repository operations (create/add-collaborators/list-all/config)" echo " external-login-ctrl Enable/disable local login" - echo " list-projs List all visible repositories - reset-password Reset user password" + echo " list-projs List all visible repositories" + echo " reset-password Reset user password" exit 1 fi -# Get subcommand subcommand="$1" shift -# Route to appropriate script case "$subcommand" in check-git-cred) "$SCRIPT_DIR/check-git-cred" "$@" @@ -46,16 +41,12 @@ case "$subcommand" in link-keycloak) "$SCRIPT_DIR/link-keycloak" "$@" ;; - repo-add-collaborators) - "$SCRIPT_DIR/repo-add-collaborators" "$@" - ;; - repo-config) - "$SCRIPT_DIR/repo-config" "$@" + repo) + "$SCRIPT_DIR/repo" "$@" ;; external-login-ctrl) "$SCRIPT_DIR/external-login-ctrl" "$@" ;; - list-projs) "$SCRIPT_DIR/list-projs" "$@" ;; @@ -67,4 +58,4 @@ case "$subcommand" in echo "Run '$0' for usage information" exit 1 ;; -esac +esac \ No newline at end of file diff --git a/git-hangman-lab/scripts/repo b/git-hangman-lab/scripts/repo new file mode 100755 index 0000000..9f18e95 --- /dev/null +++ b/git-hangman-lab/scripts/repo @@ -0,0 +1,37 @@ +#!/bin/bash + +SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" + +if [[ $# -eq 0 ]]; then + echo "Usage: $0 [options]" + echo "" + echo "Commands:" + echo " create Create a new repository" + echo " add-collaborators Add collaborator to repository" + echo " list-all [args] List all visible repositories" + echo " config Configure repository" + exit 1 +fi + +subcommand="$1" +shift + +case "$subcommand" in + create) + "$SCRIPT_DIR/create-repo" "$@" + ;; + add-collaborators) + "$SCRIPT_DIR/repo-add-collaborators" "$@" + ;; + list-all) + "$SCRIPT_DIR/list-projs" "$@" + ;; + config) + "$SCRIPT_DIR/repo-config" "$@" + ;; + *) + echo "Unknown command: $subcommand" + echo "Run '$0' for usage information" + exit 1 + ;; +esac \ No newline at end of file