Add repo subcommand with create/add-collaborators/list-all/config; clean up SKILL.md
This commit is contained in:
@@ -33,23 +33,18 @@ Generate an access token for the current user.
|
|||||||
{baseDir}/scripts/git-ctrl generate-access-token
|
{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
|
```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`)
|
> **Note**: `create` creates the repo at `${AGENT_WORKSPACE}/${repo-name}`
|
||||||
|
|
||||||
### 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
|
|
||||||
```
|
|
||||||
|
|
||||||
### Pull Request Operations
|
### Pull Request Operations
|
||||||
|
|
||||||
@@ -75,30 +70,6 @@ Link Keycloak account with Gitea (for OAuth binding).
|
|||||||
{baseDir}/scripts/git-ctrl link-keycloak
|
{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
|
### External Login Control
|
||||||
|
|
||||||
Enable or disable local login on Gitea.
|
Enable or disable local login on Gitea.
|
||||||
@@ -114,4 +85,4 @@ Reset password for the current user (reads username from secret-mgr).
|
|||||||
|
|
||||||
```bash
|
```bash
|
||||||
{baseDir}/scripts/git-ctrl reset-password
|
{baseDir}/scripts/git-ctrl reset-password
|
||||||
```
|
```
|
||||||
@@ -1,9 +1,7 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# Get the directory where this script is located
|
|
||||||
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
||||||
|
|
||||||
# Check if subcommand is provided
|
|
||||||
if [[ $# -eq 0 ]]; then
|
if [[ $# -eq 0 ]]; then
|
||||||
echo "Usage: $0 <command> [options]"
|
echo "Usage: $0 <command> [options]"
|
||||||
echo ""
|
echo ""
|
||||||
@@ -14,19 +12,16 @@ if [[ $# -eq 0 ]]; then
|
|||||||
echo " pr Pull request operations (create/list/commits/merge/show)"
|
echo " pr Pull request operations (create/list/commits/merge/show)"
|
||||||
echo " generate-access-token Generate access token for current user"
|
echo " generate-access-token Generate access token for current user"
|
||||||
echo " link-keycloak Link Keycloak account with Gitea"
|
echo " link-keycloak Link Keycloak account with Gitea"
|
||||||
echo " repo-add-collaborators Add collaborator to repository"
|
echo " repo Repository operations (create/add-collaborators/list-all/config)"
|
||||||
echo " repo-config Configure repository"
|
|
||||||
echo " external-login-ctrl Enable/disable local login"
|
echo " external-login-ctrl Enable/disable local login"
|
||||||
echo " list-projs List all visible repositories
|
echo " list-projs List all visible repositories"
|
||||||
reset-password Reset user password"
|
echo " reset-password Reset user password"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Get subcommand
|
|
||||||
subcommand="$1"
|
subcommand="$1"
|
||||||
shift
|
shift
|
||||||
|
|
||||||
# Route to appropriate script
|
|
||||||
case "$subcommand" in
|
case "$subcommand" in
|
||||||
check-git-cred)
|
check-git-cred)
|
||||||
"$SCRIPT_DIR/check-git-cred" "$@"
|
"$SCRIPT_DIR/check-git-cred" "$@"
|
||||||
@@ -46,16 +41,12 @@ case "$subcommand" in
|
|||||||
link-keycloak)
|
link-keycloak)
|
||||||
"$SCRIPT_DIR/link-keycloak" "$@"
|
"$SCRIPT_DIR/link-keycloak" "$@"
|
||||||
;;
|
;;
|
||||||
repo-add-collaborators)
|
repo)
|
||||||
"$SCRIPT_DIR/repo-add-collaborators" "$@"
|
"$SCRIPT_DIR/repo" "$@"
|
||||||
;;
|
|
||||||
repo-config)
|
|
||||||
"$SCRIPT_DIR/repo-config" "$@"
|
|
||||||
;;
|
;;
|
||||||
external-login-ctrl)
|
external-login-ctrl)
|
||||||
"$SCRIPT_DIR/external-login-ctrl" "$@"
|
"$SCRIPT_DIR/external-login-ctrl" "$@"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
list-projs)
|
list-projs)
|
||||||
"$SCRIPT_DIR/list-projs" "$@"
|
"$SCRIPT_DIR/list-projs" "$@"
|
||||||
;;
|
;;
|
||||||
@@ -67,4 +58,4 @@ case "$subcommand" in
|
|||||||
echo "Run '$0' for usage information"
|
echo "Run '$0' for usage information"
|
||||||
exit 1
|
exit 1
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
37
git-hangman-lab/scripts/repo
Executable file
37
git-hangman-lab/scripts/repo
Executable 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
|
||||||
Reference in New Issue
Block a user