DEV Community

nasa9084
nasa9084

Posted on • Originally published at blog.web-apps.tech on

2

Generates LICENSE file: git-license

this post originally appears on blog.web-apps.tech

Generates LICENSE file: git-license

When we create a new repository on GitHub, we can choose an open source license.

Generates LICENSE file: git-license

We choose an OSS license, then, LICENSE file is put into the new repository.

Now, I'm usually using hub command to create a new repository.

I'll do below to create:

$ mkdir my_new_repository
$ cd my_new_repository
$ git init
#
# ... some code writing and commit ...
#
$ git create # git command is aliased to hub
$ git push -u origin master

In this flow, I can write description for repository[1], set homepage[2], make the repository private[3], but I CANNOT choose LICENSE.

I can choose and create LICENSE file on the GitHub web page, or I can copy from my other repositories because its content is fixed.

However, I don't do that.

Thus I created git-license, which is subcommand for git.

As you know, when you put git-XXX executable into your PATH, you can use git-XXX command as subcommand of git like git XXX.

git-license is written in Go.

So its executable is only one binary, and it means very easy to start using.

If you have already had Go environment, you can install with:

$ go get github.com/nasa9084/go-license

If not, you can download binary for your os from Releases page.

The command creates LICENSE file you choose using GitHub Licenses API, so network connection is required.

If there's some bugs, comment, or enhancement, please feel free to make issues or make Pull Request.


  1. with -d option ↩︎

  2. with -h option ↩︎

  3. with -p option ↩︎

AWS GenAI LIVE image

Real challenges. Real solutions. Real talk.

From technical discussions to philosophical debates, AWS and AWS Partners examine the impact and evolution of gen AI.

Learn more

Top comments (0)

Qodo Takeover

Introducing Qodo Gen 1.0: Transform Your Workflow with Agentic AI

Rather than just generating snippets, our agents understand your entire project context, can make decisions, use tools, and carry out tasks autonomously.

Read full post

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay