Initialize a gitlab project both locally and remotely with a single command This shell script, with only a few configurations, has the goal of initializing a project on Gitlab.com without having to go through the go through the website's ui.
This means: Let's say you just a project with a few source files, but you haven't done anything with git yet. The goal of this script is to allow you to write something like git-init-remote &lt;my_repository_name&gt; on the command line and have both the project on your personal gitlab.com and the local git repository.
#!/bin/sh

repo=$1
token=&lt;YOUR-PRIVATE-TOKEN&gt; # You get this from https://gitlab.com/-/profile/personal_access_tokens
username=&lt;YOUR-USERNAME&gt;

test -z $repo &amp;&amp; echo &quot;Repo name required.&quot; 1&gt;&amp;2 &amp;&amp; exit 1

curl --request POST --header &quot;Private-Token: $token&quot; --header &quot;Content-Type: application/json&quot; --data &quot;{\&quot;name\&quot;:\&quot;$repo\&quot;}&quot; &quot;https://gitlab.com/api/v4/projects&quot;

echo &quot;\nDone initializing on remote.&quot;
echo &quot;\nCreating local git repository...&quot;

git init
git remote add origin https://gitlab.com/$username/$repo.git
git add .
git commit -m &quot;Initial commit&quot;
git push -u origin master

echo &quot;\nDone.&quot;


I would like to have any of your thoughts on how this can break and how scalable this can go. I had trouble finding similar scripts on the web so I felt like a had to write here.
Welcome to CodeReview.SE and thanks for submitting your script for a code review!
Good points

Good output conveying how progress is being made.
Clear variable names

Suggestions

Are there limitations for what characters can be in a repo name?  If so, you might want to check that before sending it to the API.  It is good that you're checking to make sure they passed something in.
Aside from making sure $1 is set, there is no error checking.  If the curl fails do you want to continue with the git commands?
It isn't clear if you want this to run in bash or POSIX sh.  The question is tagged for bash, but your sh-bang line points at POSIX shell.  But yay for including the sh-bang line.
One shell best practice is putting your variable substitutions in double quotes.  git remote add origin &quot;https://gitlab.com/$username/$repo.git&quot; shows how to change one of your lines of code.  You want the variables inside of double quotes so that spaces in a variable name don't cause the shell to split what you think is one argument into multiple arguments to the command.

Ideas

Do you really want the token stored in the source code?  Can you pull this from a secrets vault or store it in a separate file?  If you want to commit your source code to a code repository (like git) it would be much better if it didn't include secret tokens.
I'd try seeing if I could get this to work as a git subcommand.  Here is a medium article on writing your own git subcommands.
Use shellcheck to get automated best practice suggestions for your shell code.  It can also be run locally on the command line.