Add repo subcommand with create/add-collaborators/list-all/config; clean up SKILL.md

This commit is contained in:
lyn
2026-04-13 13:46:46 +00:00
parent 7c0b857a2f
commit f3c19ba6e2
3 changed files with 51 additions and 52 deletions

View File

@@ -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 <repo-name>
{baseDir}/scripts/git-ctrl repo create <repo-name>
{baseDir}/scripts/git-ctrl repo add-collaborators --user <user> --repo <repo>
{baseDir}/scripts/git-ctrl repo list-all
{baseDir}/scripts/git-ctrl repo config --repo-path <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 <user> --repo <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 <path to your repo>
```
### 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
```
```

View File

@@ -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 <command> [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

37
git-hangman-lab/scripts/repo Executable file
View File

@@ -0,0 +1,37 @@
#!/bin/bash
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
if [[ $# -eq 0 ]]; then
echo "Usage: $0 <command> [options]"
echo ""
echo "Commands:"
echo " create <repo-name> Create a new repository"
echo " add-collaborators <args> Add collaborator to repository"
echo " list-all [args] List all visible repositories"
echo " config <args> 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