Command-line client for viewing, adding, and completing tasks in Asana. Whenever you mention a workspace, project, or user, you don't need to use the entire word. For example, you can use "projects" to refer to a workspace called "Personal Projects" or "@tommy" to refer to a user named "Tommy MacWilliam". As long as what you supply is contained within the full workspace/project/user name on Asana, the client will figure out what you mean.
$ gem install asana-client
Now, open up Asana's web app and select "Account Settings". You should see a tab that says "API". Copy the text, then execute the following:
$ echo "api_key: PASTE_YOUR_API_KEY_HERE" > ~/.asana-client
Basically, that's just creating a YAML configuration file (containing your API key) called .asana-client in your home directory.
$ asana workspace
To also list completed tasks, add the -c
flag.
$ asana workspace/project
As for workspaces, add the -c
flag to also list completed tasks.
The -m
flag can be given to only list tasks assigned to you.
$ asana workspace this is the name of my new task
$ asana workspace/project this is the name of my new task
$ asana workspace/project do that the important thing @tommy
$ asana workspace/project fix it @tommy 4/25/12
$ asana workspace/project paper due friday
$ asana finish 12345
Copy the post-commit file into your repo's .git/hooks directory, and make sure to execute chmod +x .git/hooks/post-commit from the root of your repo.
Now, simply mention the ID of an Asana task inside your commit message, and the issue will be annotated automatically with your commit message and will optionally complete the task. If you're familiar with git annotations with Pivotal Tracker, these will be second nature. Commit message examples:
action | commit |
---|---|
annotate a task without finishing it | git commit -m "convert tabs to spaces in sort.c [#1234567890]" |
annotate a task and finish it | git commit -m "fix tricky bug [fixes #1234567890]" |
annotate a task and finish it | git commit -m "finish converting tabs [finishes #1234567890]" |