diff --git a/README.md b/README.md index d2a3b28..db4d1c4 100644 --- a/README.md +++ b/README.md @@ -247,11 +247,12 @@ The stored token is handed to git ephemerally through environment-based config ( ### `stoke repo create` -Create a new repository for the authenticated user. +Create a new repository for the authenticated user or an organization. ```text Options: --name repository name (required) + -o, --owner repository owner (authenticated user or organization) -d, --description repository description --private make the repository private --public make the repository public @@ -265,9 +266,13 @@ Example: ```bash stoke repo create --name stoke-test --private \ -d "Test repository created via stoke" +stoke repo create -o heavy-duty --name shared-project --private ``` -Calls `POST /api/v1/user/repos`. +When `--owner` is omitted or names the authenticated user (case-insensitively), +calls `POST /api/v1/user/repos`. For another owner, calls +`POST /api/v1/orgs/{owner}/repos`; Forgejo returns `403` when the caller cannot +create repositories for that organization. ### `stoke repo list` diff --git a/changelog.d/24.md b/changelog.d/24.md new file mode 100644 index 0000000..5384946 --- /dev/null +++ b/changelog.d/24.md @@ -0,0 +1 @@ +- `repo create --owner` can now create organization-owned repositories while preserving the authenticated-user default. (#24).