Introducing utopian-cli - A command-line interface for the Utopian.io API
I was recently browsing the development section of Utopian.io and one of the contributions caught my eye: A command line GoDaddy API Implementation (in Python). When I saw this I knew I wanted to make my own CLI, more specifically a Utopian.io CLI, so I started looking for ways to implement one, and ended up deciding to use the Python package Click.
What is the project about?
As mentioned above, it's a command-line interface implemented using the Python package Click. Some more information about it can be found in the README of my GitHub repository! I wanted to implement this because of a few reasons, but the main ones were that I wanted to learn about how to implement a CLI (I still am learning and will improve it along the way) and because I thought it would be useful for myself and other Utopian.io users who use the terminal regularly.
Usage: utopian [OPTIONS] COMMAND [ARGS]...
Options:
--help Show this message and exit.
Commands:
contributions
moderators
Currently it allows the user to filter moderators and contributions and print them to the terminal. Below I will show an example of both commands with their respective options!
Moderators
One of the CLI's commands is the "moderators" command. Its options are currently
which are shown in action in the GIF below
Contributions
The other command is the "contributions" command. Its options are currently
of which some are shown in the GIF below
The only option that I didn't show in the GIF is the --reviewed / --unreviewed
flag, which is very useful in my opinion and allows you to find e.g. unreviewed Dutch translations (very useful for me)!
Technology stack
I used the following to create the CLI
- Python3.6 using Click and requests
I haven't tested it with other versions, except Python2.7, and it doesn't work for that. In the future I will look at adding support for multiple versions and actually testing them to see if they work or not.
Roadmap
I don't have any definite plans, but I might make it show the permlink of contributions instead of the title and I will work on adding the rest of the Utopian.io API to the CLI. I will probably think of other things that will help me personally (when moderating for example) and add them as well. I am also hoping people will suggest commands/options/arguments they would like to see implemented, so if you have any, let me know!
How to contribute?
- Fork the repository
- Create a feature branch with
git checkout -b your-feature
- Code and document your feature
- Commit your changes with
git commit -m "add my features"
- Push to your branch with
git push origin your-feature
- Create a new pull request
Anything you can add to the project is valuable to me, be it bug reports, suggestions etc. so please don't hesitate!
Posted on Utopian.io - Rewarding Open Source Contributors
Thank you for the contribution. It has been approved.
Very well documented, very nice touch with the animated gif. I love that purple!
You can contact us on Discord.
[utopian-moderator]
Thanks!
@amosbastian, Approve is not my ability, but I can upvote you.
I thought about urls when I was looking into gifs :) maybe an -option to show as permlink could be useful.
that's really looking lovely, gotta check that click's documentation first and I'm finally getting familiar with github. Let's see if I can make it to a PR.
Hey @amosbastian I am @utopian-io. I have just upvoted you!
Achievements
Community-Driven Witness!
I am the first and only Steem Community-Driven Witness. Participate on Discord. Lets GROW TOGETHER!
Up-vote this comment to grow my power and help Open Source contributions like this one. Want to chat? Join me on Discord https://discord.gg/Pc8HG9x