Movatterモバイル変換


[0]ホーム

URL:


Skip to content
DEV Community
Log in Create account

DEV Community

renanbastos93
renanbastos93

Posted on • Edited on

     

Boneless: a CLI to create your apps with Go

Boneless is a powerful tool that offers a wide range of features to facilitate application development. In this blog post, we will explore some essential tools that can be used in conjunction withBoneless:Service Weaver,Go Migrate,SQLC, andFiber. Let's discover how these tools can boost productivity and efficiency in application development.


After setting the context and providing a comprehensive introduction, we will demonstrate how to use our CLI. First, we need to install the necessary CLI tools.


By the way, first, we need to install the binary of Service Weaver, Go Migrate, SQLC, and Boneless. Even so, I suggest you read the documentation of all of them on your official websites.

$goinstall-tags'mysql sqlite3' github.com/golang-migrate/migrate/v4/cmd/migrate@latest$goinstallgithub.com/sqlc-dev/sqlc/cmd/sqlc@latest$goinstallgithub.com/ServiceWeaver/weaver/cmd/weaver@latest$goinstallgithub.com/renanbastos93/boneless/cmd/boneless@latest
Enter fullscreen modeExit fullscreen mode

Well, let's go on an adventure


Create scratch project

Always remember to check the available methods by executingboneless help. After that, we can proceed to create a new folder and ago.mod file.

$mkdir-p myapp$cdmyapp$go mod tidy myapp# "Now we can start utilizing commands from Boneless$boneless create-scratch
Enter fullscreen modeExit fullscreen mode

After creating the project, we can go ahead and execute it.

$ SERVICEWEAVER_CONFIG="./weaver.toml" boneless run
Enter fullscreen modeExit fullscreen mode

Adding a New app

If you want to add a new component to your application built with Boneless, the process is straightforward. Here are the steps you can follow

$boneless create-app user
Enter fullscreen modeExit fullscreen mode

After that, you need to make changes according to your requirements.

In addition, there are other Boneless commands available that you can use when they are truly necessary. See below:

$bonelesshelpUsage: boneless[target]Targets:helpShow commandsforuse  version                                  Show version  new  <sql|sqlite3>                       Create a project from scratch using Weaver, SQLC, and go-migrate  create-scratch <sql|sqlite3>             Create a project from scratch using Weaver, SQLC, and go-migrate  build                                    Build the Weaver component with SQLC  make-migrate <app-name> <name>           Create a new migrationforan app  migrate <app-name> <up|down>             Run migrationsforan app  create-app <app-name>                    Create a new app based on a template  build-app <app-name>                     Build an app using Weaver and SQLC  run                                      Run the project using WeaverParameters:  <app-name>                               Name of the app to create or run migrations on  <name>                                   Name of the migration to create  <up|down>                                Specify"up" to apply migrations or"down" to rollback migrations  <sql|sqlite>                             Specify"sql" to use some SQL"sqlite3" to use sqlite3 and it is the defaultExamples:  bonelesshelpboneless version  boneless create-scratch  boneless build  boneless make-migrate my-app migration-name  boneless migrate my-app up  boneless create-app my-app  boneless build-app my-app  boneless run
Enter fullscreen modeExit fullscreen mode

Conclusion

In summary, we have explored the powerful tools available for application development using Boneless. We discussed the Command Line Interface (CLI) that facilitates the creation of web applications, along with Service Weaver, Go Migrate, SQLC, and Fiber. These tools provide essential features to boost productivity and efficiency in developing distributed applications, managing database migrations, generating secure code, and building fast web applications.

By utilizing these tools together, developers have a wide range of resources at their disposal to create robust, scalable, and secure applications. Through the Boneless CLI, you can initiate projects, manage database migrations, and leverage the benefits of Service Weaver and Fiber to build efficient and responsive APIs.

We hope this article has provided a comprehensive overview of these tools and sparked your interest in further exploring the potential of Boneless and its components. With the right combination of tools and knowledge, you will be well-positioned to develop high-quality web applications.

Top comments(19)

Subscribe
pic
Create template

Templates let you quickly answer FAQs or store snippets for re-use.

Dismiss
CollapseExpand
 
ewaldhorn profile image
Ewald
I love tinkering with code, building interesting things and learning a lot!
  • Location
    Cape Town, South Africa
  • Education
    Nope.
  • Pronouns
    He/Him
  • Work
    Cook and bottle washer at NoFuss Solutions.
  • Joined

That's interesting. The main reason I love Go is because I have complete control over dependencies, as they vary per project.

It's always so neat to see different perspectives. If I may ask, what did you end up using instead of Go?

CollapseExpand
 
renanbastos93 profile image
renanbastos93
I love technology, innovation, and entrepreneurship. I have been working as a Software Engineer, but I'm always seeking to learn new things.
  • Email
  • Location
    Florianópolis - SC - Brazil
  • Education
    Analysis and systems development
  • Work
    Software Engineer
  • Joined

Currently, I primarily use Go with minimal dependencies to create projects from scratch. I believe in continuously improving my projects with small, incremental changes. However, I'm interested in providing more flexibility for others to choose their preferred dependencies.

If you're interested in contributing or suggesting changes, I encourage you to either reach out to me directly or open an issue on GitHub. I appreciate collaborative input and value the opportunity to enhance the project based on the needs and perspectives of the community. Your contributions and feedback are always welcome."

Thread Thread
 
ewaldhorn profile image
Ewald
I love tinkering with code, building interesting things and learning a lot!
  • Location
    Cape Town, South Africa
  • Education
    Nope.
  • Pronouns
    He/Him
  • Work
    Cook and bottle washer at NoFuss Solutions.
  • Joined

Awesome, I'll keep that in mind!

CollapseExpand
 
renanbastos93 profile image
renanbastos93
I love technology, innovation, and entrepreneurship. I have been working as a Software Engineer, but I'm always seeking to learn new things.
  • Email
  • Location
    Florianópolis - SC - Brazil
  • Education
    Analysis and systems development
  • Work
    Software Engineer
  • Joined

Thank you for your message! I completely understand your concern about managing dependencies in Golang. It can be a time-consuming task. I'm glad to hear that you found the tool I created helpful. I appreciate your kind words, and I'm confident it will make your future development projects much easier. If you have any questions or need further assistance, feel free to let me know

CollapseExpand
 
gerimate profile image
Geri Máté
devrel
  • Location
    Szeged, Hungary
  • Education
    University of Szeged
  • Work
    self-employed
  • Joined

Looks amazing, congrats!

CollapseExpand
 
renanbastos93 profile image
renanbastos93
I love technology, innovation, and entrepreneurship. I have been working as a Software Engineer, but I'm always seeking to learn new things.
  • Email
  • Location
    Florianópolis - SC - Brazil
  • Education
    Analysis and systems development
  • Work
    Software Engineer
  • Joined

Thank you so much! If you have any questions or if there's anything else I can assist you with, please feel free to reach out.

 
ewaldhorn profile image
Ewald
I love tinkering with code, building interesting things and learning a lot!
  • Location
    Cape Town, South Africa
  • Education
    Nope.
  • Pronouns
    He/Him
  • Work
    Cook and bottle washer at NoFuss Solutions.
  • Joined

Ah I see. I hope you get some time to do fun personal projects again!

Thread Thread
 
renanbastos93 profile image
renanbastos93
I love technology, innovation, and entrepreneurship. I have been working as a Software Engineer, but I'm always seeking to learn new things.
  • Email
  • Location
    Florianópolis - SC - Brazil
  • Education
    Analysis and systems development
  • Work
    Software Engineer
  • Joined

Nice, interesting man. Well, What did you think about Boneless? I will be happy to know

Thread Thread
 
ewaldhorn profile image
Ewald
I love tinkering with code, building interesting things and learning a lot!
  • Location
    Cape Town, South Africa
  • Education
    Nope.
  • Pronouns
    He/Him
  • Work
    Cook and bottle washer at NoFuss Solutions.
  • Joined

It looks interesting, I haven't had time to play with it yet, I have too many side projects already!!

Thread Thread
 
renanbastos93 profile image
renanbastos93
I love technology, innovation, and entrepreneurship. I have been working as a Software Engineer, but I'm always seeking to learn new things.
  • Email
  • Location
    Florianópolis - SC - Brazil
  • Education
    Analysis and systems development
  • Work
    Software Engineer
  • Joined

of course, no worries dude. Well, when you test it share your opinion, open issues, etc. Thanks.

Thread Thread
 
ewaldhorn profile image
Ewald
I love tinkering with code, building interesting things and learning a lot!
  • Location
    Cape Town, South Africa
  • Education
    Nope.
  • Pronouns
    He/Him
  • Work
    Cook and bottle washer at NoFuss Solutions.
  • Joined

Will do!

CollapseExpand
 
ewaldhorn profile image
Ewald
I love tinkering with code, building interesting things and learning a lot!
  • Location
    Cape Town, South Africa
  • Education
    Nope.
  • Pronouns
    He/Him
  • Work
    Cook and bottle washer at NoFuss Solutions.
  • Joined

This is a neat tool, I can see it being of benefit, especially to new Go developers, but also for older hands who just want to get the config done and get coding already.

Nicely done!

CollapseExpand
 
renanbastos93 profile image
renanbastos93
I love technology, innovation, and entrepreneurship. I have been working as a Software Engineer, but I'm always seeking to learn new things.
  • Email
  • Location
    Florianópolis - SC - Brazil
  • Education
    Analysis and systems development
  • Work
    Software Engineer
  • Joined

Awesome, thanks for you feedback.

CollapseExpand
 
guipassos profile image
Guilherme C. Passos
As a seasoned software developer since 2010, I possess over a decade of expertise in crafting robust back-end solutions and scalable applications.
  • Location
    Rolante RS - Brazil
  • Joined

Great Job my friend!
This CLI is exceptionally, functional and user-friendly!

CollapseExpand
 
renanbastos93 profile image
renanbastos93
I love technology, innovation, and entrepreneurship. I have been working as a Software Engineer, but I'm always seeking to learn new things.
  • Email
  • Location
    Florianópolis - SC - Brazil
  • Education
    Analysis and systems development
  • Work
    Software Engineer
  • Joined

Thank you so much! I'm glad you think so. I put a lot of effort into making this CLI exceptionally functional and user-friendly, so it's great to hear that you appreciate it. Your kind words mean a lot to me.

CollapseExpand
 
k1lgor profile image
k1lgor
I am a Linux and Python enthusiast with a hobby in hacking. I am skilled in Bash scripting and always eager to learn new technologies and techniques
  • Location
    Varna, Bulgaria
  • Work
    Junior DevOps
  • Joined

Is thisboneless similar tocobra

CollapseExpand
 
renanbastos93 profile image
renanbastos93
I love technology, innovation, and entrepreneurship. I have been working as a Software Engineer, but I'm always seeking to learn new things.
  • Email
  • Location
    Florianópolis - SC - Brazil
  • Education
    Analysis and systems development
  • Work
    Software Engineer
  • Joined

Why do you think about that?

CollapseExpand
 
k1lgor profile image
k1lgor
I am a Linux and Python enthusiast with a hobby in hacking. I am skilled in Bash scripting and always eager to learn new technologies and techniques
  • Location
    Varna, Bulgaria
  • Work
    Junior DevOps
  • Joined

answering with queston, nice..

Thread Thread
 
renanbastos93 profile image
renanbastos93
I love technology, innovation, and entrepreneurship. I have been working as a Software Engineer, but I'm always seeking to learn new things.
  • Email
  • Location
    Florianópolis - SC - Brazil
  • Education
    Analysis and systems development
  • Work
    Software Engineer
  • Joined

I am sorry dude. I did a mistake with you.
Well, Boneless and Cobra are not the same. Boneless is a CLI tool with the goal of facilitating the creation of web applications. It is often used in conjunction with other technologies like Service Weaver, Go Migrate, SQLC, and Fiber. Boneless provides functionality specific to web application development.

On the other hand, Cobra is a CLI library in the Go programming language that helps create other CLI tools. It provides a framework for building powerful and flexible command-line interfaces with features such as command hierarchies and flags. Cobra is focused on enabling the development of general-purpose CLI applications.

So, while both Boneless and Cobra are CLI-related tools, they have different purposes and functionalities. Boneless is geared towards web application development, while Cobra is a library for creating various types of CLI tools.

Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment'spermalink.

For further actions, you may consider blocking this person and/orreporting abuse

I love technology, innovation, and entrepreneurship. I have been working as a Software Engineer, but I'm always seeking to learn new things.
  • Location
    Florianópolis - SC - Brazil
  • Education
    Analysis and systems development
  • Work
    Software Engineer
  • Joined

More fromrenanbastos93

DEV Community

We're a place where coders share, stay up-to-date and grow their careers.

Log in Create account

[8]ページ先頭

©2009-2025 Movatter.jp