Giter VIP home page Giter VIP logo

asana's Introduction

Build Status

OverView

Asana command line client implemented in Go.

Install

Requirements: go

Mac OS X

$ brew tap thash/asana
$ brew install asana

Others

$ go get github.com/thash/asana

Usage

$ asana help

NAME:
   asana - asana cui client ( https://github.com/thash/asana )

USAGE:
   asana [global options] command [command options] [arguments...]

VERSION:
   x.x.x

COMMANDS:
   config, c            Asana configuration. Your settings will be saved in ~/.asana.yml
   workspaces, w        get workspaces
   tasks, ts            get tasks
   task, t              get a task
   comment, cm          Post comment
   done                 Complete task
   due                  set due date
   browse, b            open a task in the web browser
   help, h              Shows a list of commands or help for one command

GLOBAL OPTIONS:
   --help, -h           show help
   --version, -v        print the version

Configure

$ asana config
visit: http://app.asana.com/-/account_api
  Settings > Apps > Manage Developer Apps > Personal Access Tokens
  + Create New Personal Access Token

paste your Personal Access Token: _ <Copy Token from URL above and paste it.>

When you paste valid token, your workspaces will be displayed.

2 workspaces found.
[0]    4444444444444 My Project
[1]     999999999999 Work

Choose one out of them: _

Select one workspace. Configurations are saved in ~/.asana.yml.

$ cat ~/.asana.yml

personal_access_token: 0/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
workspace: 4444444444444

Tasks

asana tasks or asana ts list your tasks.

$ asana ts

0 [ 2014-08-13 ] Write README.
1 [ 2014-08-18 ] Buy gift for coworkers.
2 [ 2014-08-29 ] Read "Unweaving the Rainbow".
3 [            ] haircut

asana task <index> or asana t <index> shows the task in detail. When you run it without index, top of the tasks list will be used.

-v option adds comments and modification histories to the output.

$ asana t -v 0

[ 2014-08-13 ] Write README.
--------
Write README.md for Asana Cli project.

----------------------------------------

assigned to you (2014-07-07T05:31:18.278Z)
--------
changed the name to "Write README." (2014-07-18T08:52:57.020Z)
--------
changed the due date to August 8 (2014-08-04T10:33:07.168Z)
--------
How about progress?
by Lain Iwakura (2014-08-10T04:17:57.741Z)
--------
moved from Piyo to Hoge (2014-08-11T02:02:53.051Z)
--------
No progress.
by Hash (2014-08-11T01:21:38.014Z)
--------
moved from Hoge to Piyo (2014-08-11T02:02:53.051Z)
--------
changed the due date to August 13 (2014-08-11T10:30:39.785Z)

Complete, set due on a task

To complete task, use asana complete <index> or asana done <index>.

$ asana done 12

To change(or newly set) due date, use asana due <index> <due_date>.

$ asana due 5 2014-08-21

Or, today or tomorrow.

$ asana due 5 today

Comment

asana comment <index> or asana cm <index> enable you to post new comment for the task.

$ asana cm 2

This command opens editor. Write comment, save and close.

You can change editor by updating $EDITOR environment variable.

Open a task in the browser

asana browse <index> or asana b <index> will open task in browser.

$ asana browse 1
// => open browser

TODO

See Issues

asana's People

Contributors

buzzsurfr avatar clemens-tolboom avatar grayson-nia avatar thash avatar tylerlubeck avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

asana's Issues

DEPRECATED Action signature

Hi,

Doesn't matter the action I choose, I've got this error message. It doesn't disturb the client, I can still do anything I want but I hope you could fix it, if ever cli changes something and makes your client no longer functional.

$>asana ts
 0 [ 2016-06-20 ] Task ...
DEPRECATED Action signature.  Must be `cli.ActionFunc`.  This is an error in the application.  Please contact the distributor of this application if this is not you.  See https://github.com/urfave/cli/blob/master/CHANGELOG.md#deprecated-cli-app-action-signature

Avoid 400 Error when client got too large tasks

curl -v output:

< HTTP/1.1 400 Bad Request
* Server nginx is not blacklisted
< Server: nginx
< Date: Fri, 15 Jan 2016 15:47:48 GMT
< Content-Type: application/json; charset=UTF-8
< Transfer-Encoding: chunked
< Connection: keep-alive
< X-Asana-Content-String-Length: 243
< Pragma: no-cache
< Set-Cookie: TooBusyRedirectCount=0
< Cache-Control: no-store
< X-Asana-Preferred-Release-Revision: 20160115_003254_8b63d653235d6438de41d497b6c47880dfbd744d
< X-Robots-Tag: none
<
* Connection #0 to host app.asana.com left intact
{"errors":[{"message":"The result is too large. You should use pagination!","help":"For more information on API status codes and how to handle them, read the docs on errors: https://asana.com/developers/documentation/getting-started/errors"}]}%

"go: cannot find main module" when installing from homebrew

Howdy! I was trying to install this on my MacOS machine (Monterey) with homebrew and the formula is pretty unhappy:

briefcase on ๎‚  main is ๐Ÿ“ฆ v1.0.0 via ๏ข˜ v16.13.1 via ๐Ÿ v3.8.8 (env) on โ˜๏ธ  (us-west-2) took 1m15s
โฏ brew install asana
Warning: Treating asana as a formula. For the cask, use homebrew/cask/asana
==> Cloning https://github.com/thash/asana.git
Updating /Users/jholbrook/Library/Caches/Homebrew/asana--git
==> Checking out tag v0.2.1
HEAD is now at da081e7 Merge pull request #18 from thash/v0.2.1
HEAD is now at da081e7 Merge pull request #18 from thash/v0.2.1
==> Installing asana from thash/asana
==> go get github.com/urfave/cli
==> go get github.com/thash/asana
==> go build -o asana
Last 15 lines from /Users/jholbrook/Library/Logs/Homebrew/asana/03.go:
2021-12-16 19:34:09 +0000

go
build
-o
asana

go: cannot find main module, but found .git/config in /private/tmp/asana-20211216-93870-10gho4f
	to create a module there, run:
	go mod init

If reporting this issue please do so at (not Homebrew/brew or Homebrew/core):
  https://github.com/thash/homebrew-asana/issues

I don't know what this error means :) not a go person - but hopefully an easy fix? Maybe there's a workaround?

Support projects

  • GET projects
  • GET tasks under a certain project
  • open a project in the browser #4

module declares its path as urfave/cli but was required as codegangsta/cli

I was unable to install asana CLI on a Fedora 35 OS.

[apitanga@p50 ~]$ go version
go version go1.16.8 linux/amd64
[apitanga@p50 ~]$ cat /etc/redhat-release
Fedora release 35 (Thirty Five)

Error:

apitanga@p50 ~]$ go get github.com/thash/asana
go: downloading github.com/thash/asana v0.2.1
go: downloading github.com/codegangsta/cli v1.22.5
go: downloading gopkg.in/yaml.v1 v1.0.0-20140924161607-9f9df34309c0
go get: github.com/codegangsta/cli@none updating to
	github.com/codegangsta/[email protected]: parsing go.mod:
	module declares its path as: github.com/urfave/cli
	        but was required as: github.com/codegangsta/cli
[apitanga@p50 ~]$ yum search asana
Last metadata expiration check: 3:24:37 ago on Sun 21 Nov 2021 03:33:21 PM EST.
===================================== Name & Summary Matched: asana ======================================
golang-github-tambet-asana-devel.noarch : Go library for accessing the Asana API
texlive-asana-math-doc.noarch : Documentation for asana-math
============[apitanga@p50 ~]$ go get github.com/thash/asana
go: downloading github.com/thash/asana v0.2.1
go: downloading github.com/codegangsta/cli v1.22.5
go: downloading gopkg.in/yaml.v1 v1.0.0-20140924161607-9f9df34309c0
go get: github.com/codegangsta/cli@none updating to
	github.com/codegangsta/[email protected]: parsing go.mod:
	module declares its path as: github.com/urfave/cli
	        but was required as: github.com/codegangsta/cli
[apitanga@p50 ~]$ yum search asana
Last metadata expiration check: 3:24:37 ago on Sun 21 Nov 2021 03:33:21 PM EST.
===================================== Name & Summary Matched: asana ======================================
golang-github-tambet-asana-devel.noarch : Go library for accessing the Asana API
texlive-asana-math-doc.noarch : Documentation for asana-math
========================================== Name Matched: asana ===========================================
oflb-asana-math-fonts.noarch : An OpenType font with a MATH table
texlive-asana-math.noarch : A font to typeset maths in Xe(La)TeX and Lua(La)TeX
[apitanga@p50 ~]$ go get github.com/thash/asana
go get: github.com/codegangsta/cli@none updating to
	github.com/codegangsta/[email protected]: parsing go.mod:
	module declares its path as: github.com/urfave/cli
	        but was required as: github.com/codegangsta/cli

Setup issue

Hey, I'm trying to setup this app locally following steps described at CONTRIBUTE.md, and get the following issue:

go get github.com/thash/asana/commands

# github.com/thash/asana/commands
src/github.com/thash/asana/commands/due.go:19:54: invalid operation: c.Args()[1] (type cli.Args does not support indexing)

My golang version: go version go1.12.5 linux/amd64

`asana tasks` doesn't show any tasks

I've been trying this out and I'm seeing a few weird behaviors. After working around #28 by looking up and setting the workspace gid in ~/.asana.yml I tried to list some tasks and I get nothing:

~ via ๐Ÿ v3.8.8 (env) on โ˜๏ธ  (us-west-2) took 3s
โฏ asana tasks

I also tried grabbing an individual task with an ID I pulled from the UI and JSON unmarshalling is really unhappy:

~ via ๐Ÿ v3.8.8 (env) on โ˜๏ธ  (us-west-2)
โฏ asana t {my task ID}
400 Bad Request
2021/12/16 14:57:40 fatal: json: cannot unmarshal array into Go value of type api.Task_t

I'm wondering if this is due to changes in Asana's API, similar to what I suspect is going on in #28 ?

Open a task/project into browser

As task edit is a feature request still I rather have the issue opening into a browser esp. to attach screenshots.

(Nice to see a plugin using go-lang. I hope to contribute while learning go)

Error parsing json?

Listing tasks works, but getting info on a specific task fails, with an error that looks like a JSON parsing issue?

$ asana tasks
 0 [            ] Improve performance
 1 [            ] Add python profiling data
 2 [            ] Improve CI configuration

$ asana t 1
fatal: %v
json: cannot unmarshal object into Go value of type string

This error occurs on ~half of my tasks. I haven't yet been able to figure out what's different about these tasks, but will update if I figure it out. It fails in the same way whether I do asana task 1 or asana t 1 or asana t -v 1 or asana task -v 1.

Diagnostic info:
macOS 10.12

$ brew info asana
memerelics/asana/asana: stable 0.2.0
https://github.com/memerelics/asana
/usr/local/Cellar/asana/0.2.0 (4 files, 7.6M) *
  Built from source on 2017-02-13 at 10:23:54
From: https://github.com/memerelics/homebrew-asana/blob/master/asana.rb
==> Dependencies
Build: go โœ”
==> Requirements
Build: git โœ”

$ brew info go 
go: stable 1.7.5 (bottled), devel 1.8rc3, HEAD
The Go programming language
https://golang.org
/usr/local/Cellar/go/1.7.5 (6,440 files, 250.8M) *
  Poured from bottle on 2017-02-13 at 10:23:46
From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/go.rb

`asana w` gives every workspace ID as "0"

I installed this tool from git and have been trying it out, and I'm getting a number of weird behaviors. One of them is that when I type asana w I see the following:

~ via ๐Ÿ v3.8.8 (env) on โ˜๏ธ  (us-west-2)
โฏ asana w
               0 {my employer's workspace}
               0 Josh H's Workspace

These numbers should look like IDs, right? If I hit up this API endpoint I see well-formed GIDs. Maybe Asana changed the API and go is defaulting the "missing" value to 0?

Homebrew installation fails

I'm trying to install this via homebrew, as specified in the README.md.
But I run into the same issue as here: #20, as you can see in the attached screenshot.

How can I install this tool?

Screenshot 2020-05-18 at 14 36 28

Unassign task

Want to unassign myself to a task

Lets say I have:

asana ts

1 [2018] task

asana assign 1

"unassigning task"

asana ts

"No tasks"

Installation problem: cli module path

I tried to install as instructed, but it fails with this issue:

$ go get github.com/thash/asana
go get: github.com/codegangsta/cli@none updating to
	github.com/codegangsta/[email protected]: parsing go.mod:
	module declares its path as: github.com/urfave/cli
	       but was required as: github.com/codegangsta/cli

Seems like cli apparently moved from github.com/codegangsta/cli to github.com/urfave/cli, probably it just needs to be updated in the source code?

404 Not Found

Hello
We use Asana through Okta, and although I can create a PAT OK and configure the asana cli to use it, I'm getting the above error. I followed the README, so could you let me know what is missing please? And whether this repo is still in dev.

Can't select a project, hence can't see tasks inside.

From cli, I am able to see tasks in My Tasks section; but cannot see the ones inside one of my projects. There is not only workspaces, but also projects inside Asana.

If you confirm the issue, I can work on this @memerelics.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.