Fandom

HabitRPG Wiki

Habash

768pages on
this wiki
Add New Page
Talk0 Share

Description

hasbash is a (very minimal) Habitica terminal client written entirely in Bash. It is great for:

  • creating habits
  • creating To-Do's
  • increasing task values (Use with To-Do & Dailies to complete. For habits, as a positive action)
  • decreasing task values (Use with To-Do & Dailies to un-complete. For habits as a negative action )

It can be used via the command-line or integrated with tools like Taskwarrior.

WARNING! This is a very basic Bash script that implements a subset of the Habitica API on the command-line. It is essentially a basic wrapper around curl, with some extra commands for ease of use.

Note that the current script does not handle tasks with check-lists correctly.

Installation

Required components:

  • Bash
  • curl
  • grep

You may need to alter the script to add the parameter -k for curl command lines to allow insecure connections, that is, connections to SSL sites without certs.

The environment variables HABITICA_TOKEN and HABITICA_UUID are required to be set. One method is to set them with the following command before executing the script
declare -x HABITICA_UUID=[USER ID]
declare -x HABITICA_TOKEN=[API TOKEN]
Your USER ID and API TOKEN can be found on the website, under Settings=>Site or on your mobile device under Settings => Account Details

However, be aware that as mentioned on the API settings page, your API token is a password, so care should be taken with it. For example, if you set the HABITICA_UUID and HABITICA_TOKEN variables in your .bashrc file, then make sure the file permissions are set so that only you have read access. This could be done with the following console commands:
cd ~
chmod 600 .bashrc
The first command changes to your home directory, and the second prevents other users accessing your .bashrc file. But if you are using habash then you probably know this already.

Usage

Available commands:

  • habash getidoftask TASK_TEXT
  • habash up TASK_TEXT
  • habash down TASK_TEXT
  • habash createtodo TASK_TEXT
  • habash createhabit TASK_TEXT
  • habash post API_PATH [CURL_ARGUMENTS]
  • habash get API_PATH [CURL_ARGUMENTS]
  • habash helpme


WARNING:

This script does not check inputs; if you do something like "habash rm -rf *", this script will execute "rm -rf *". You have been warned!

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.