# How can I create repos from a command script on a remote system (http or ssh?)

**URL:** <https://forum.gitea.com/t/how-can-i-create-repos-from-a-command-script-on-a-remote-system-http-or-ssh/6712>\
**Category:** General\
**Created:** [February 13, 2023, 10:25am UTC](https://forum.gitea.com/t/how-can-i-create-repos-from-a-command-script-on-a-remote-system-http-or-ssh/6712 "2023-02-13T10:25:50Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![brianread108](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/brianread108/32/5210_2.png) [@brianread108](https://forum.gitea.com/u/brianread108)\
**Post date:** [February 13, 2023, 10:25am UTC](https://forum.gitea.com/t/how-can-i-create-repos-from-a-command-script-on-a-remote-system-http-or-ssh/6712/1 "2023-02-13T10:25:50Z")

</div>

as for subject.

We have a few hundred repos to create and would like to make sure that are all created correctly!

---

<div class="post-metadata">

**Author:** ![jake](https://avatars.discourse-cdn.com/v4/letter/j/f475e1/32.png) [@jake](https://forum.gitea.com/u/jake)\
**Post date:** [February 14, 2023, 5:44pm UTC](https://forum.gitea.com/t/how-can-i-create-repos-from-a-command-script-on-a-remote-system-http-or-ssh/6712/2 "2023-02-14T17:44:18Z")

</div>

You can use Gitea’s API to [create repositories for a user](https://try.gitea.io/api/swagger#/repository/createCurrentUserRepo) or [for an organization](https://try.gitea.io/api/swagger#/organization/createOrgRepo) (note: this is documentation for development version, you can visit the same /api/… URL on your instance for your version of Gitea’s documentation).

---

<div class="post-metadata">

**Author:** ![brianread108](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/brianread108/32/5210_2.png) [@brianread108](https://forum.gitea.com/u/brianread108)\
**Post date:** [February 15, 2023, 11:00am UTC](https://forum.gitea.com/t/how-can-i-create-repos-from-a-command-script-on-a-remote-system-http-or-ssh/6712/3 "2023-02-15T11:00:37Z")

</div>

Thanks, I’ve found that now, and am trying the swagger “Try it out” interface. However I keep getting an “505 Internal Server Error” when I try and access /api/v1/user/repos, and use these parameters:

“auto\_init”: true,  
“default\_branch”: “master”,  
“description”: “a descr”,  
“gitignores”: “”,  
“issue\_labels”: “”,  
“license”: “”,  
“name”: “testrepo”,  
“private”: true,  
“readme”: “Hello World”,  
“template”: false,  
“trust\_model”: “default”

I’ve got the token sorted.

---

<div class="post-metadata">

**Author:** ![brianread108](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/brianread108/32/5210_2.png) [@brianread108](https://forum.gitea.com/u/brianread108)\
**Post date:** [February 15, 2023, 11:23am UTC](https://forum.gitea.com/t/how-can-i-create-repos-from-a-command-script-on-a-remote-system-http-or-ssh/6712/4 "2023-02-15T11:23:40Z")

</div>

Seems to be the Private parameter. “False” works and “True” gives an internal Server error.

… .and also “auto\_init” true gives me the Internal Server Error.

---

<div class="post-metadata">

**Author:** ![jake](https://avatars.discourse-cdn.com/v4/letter/j/f475e1/32.png) [@jake](https://forum.gitea.com/u/jake)\
**Post date:** [February 15, 2023, 9:49pm UTC](https://forum.gitea.com/t/how-can-i-create-repos-from-a-command-script-on-a-remote-system-http-or-ssh/6712/5 "2023-02-15T21:49:24Z")

</div>

I think `auto_init` being set to true and other parameters like `gitignores`, `issue_labels` and `license` being empty may be why it errors. As for private, not sure why that causes an error.

I would file an issue [Issues · go-gitea/gitea · GitHub](https://github.com/go-gitea/gitea/issues) for those so the developers can take a look at it.

---

<div class="post-metadata">

**Author:** ![brianread108](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/brianread108/32/5210_2.png) [@brianread108](https://forum.gitea.com/u/brianread108)\
**Post date:** [February 16, 2023, 9:51am UTC](https://forum.gitea.com/t/how-can-i-create-repos-from-a-command-script-on-a-remote-system-http-or-ssh/6712/6 "2023-02-16T09:51:20Z")

</div>

> <https://github.com/go-gitea/gitea/issues/22934>
>
> \### Description
> 
> Using the swagger “Try it out” interface. I keep getting an “…505 Internal Server Error” when I try and access /api/v1/user/repos, and use these parameters:
> 
> “auto\_init”: true,
> “default\_branch”: “master”,
> “description”: “a descr”,
> “gitignores”: “”,
> “issue\_labels”: “”,
> “license”: “”,
> “name”: “testrepo”,
> “private”: false,
> “readme”: “Hello World”,
> “template”: false,
> “trust\_model”: “default”
> 
> Seems to be the Private parameter. “true” works and “false” gives an internal Server error.
> … .and also “auto\_init” true gives me the Internal Server Error.
> 
> This is our own install of gitea, I can't currently see where on the web interface I can see the version number. I've asked the installer to let me have those details
> 
> Which means I can only remotely create a private and empty repo.
> 
> \### Gitea Version
> 
> See above (once I get the details I'll post here)
> 
> \### Can you reproduce the bug on the Gitea demo site?
> 
> No
> 
> \### Log Gist
> 
> \_No response\_
> 
> \### Screenshots
> 
> \_No response\_
> 
> \### Git Version
> 
> Latest I would expect
> 
> \### Operating System
> 
> Probably Centos 8 (see above)
> 
> \### How are you running Gitea?
> 
> Will let you know this.
> 
> I am guessing MYSQL is in use
> 
> \### Database
> 
> MySQL
