Asana command line client implemented in Go.
This is an enhanced fork of thash/asana maintained by Deep Neuron Lab. We've added several features and fixes to improve the CLI experience:
- ✅ Asana API v1.0 Compatibility: Fixed support for the new
gid(Global ID) string format - ✅ Custom Fields Display: View task metadata like Urgency, Dev Severity, Environment, etc.
- ✅ JSON Output Format: Machine-readable output with
--jsonflag for automation and scripting - ✅ Attachment Support: View and download file attachments from tasks
See the Changes section below for detailed information.
Upstream PRs: We've opened pull requests (#30, #31, #32, #33) to contribute these improvements back to the original project.
- Go 1.16 or higher
go get github.com/deepneuronlab/asana-clibrew tap thash/asana
brew install asanaasana helpCOMMANDS:
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
download, dl download attachment from a task
help, h Shows a list of commands or help for one command
First, configure the CLI with your Asana Personal Access Token:
asana configVisit: https://app.asana.com/-/account_api
- Go to Settings > Apps > Manage Developer Apps > Personal Access Tokens
- Create New Personal Access Token
- Copy and paste the token when prompted
Your configuration will be saved in ~/.asana.yml:
personal_access_token: 0/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
workspace: 4444444444444asana tasks
# or short form
asana tsOutput:
0 [ 2014-08-13 ] Write README.
1 [ 2014-08-18 ] Buy gift for coworkers.
2 [ 2014-08-29 ] Read "Unweaving the Rainbow".
3 [ ] haircut
View a specific task by its index:
asana task 0
# or short form
asana t 0Custom fields are automatically displayed:
asana task 64Output includes:
[ 2025-12-04 ] [Customer-Reported] KI Vorschläge
Custom Fields:
Urgency: Very High
Dev Severity: High
Environment: Production
Ticket Type: Bug
Dev Team: Backend, Customer Support
[Task notes and description...]
asana task -v 0Shows the task with all comments and activity history.
Get machine-readable output for automation:
# Basic JSON output
asana task --json 64
asana task -j 64
# JSON with stories/comments
asana task -j -v 64Example JSON structure:
{
"task": {
"gid": "1212293030279497",
"name": "[Customer-Reported] KI Vorschläge",
"custom_fields": [
{
"gid": "1212278811468834",
"name": "Urgency",
"display_value": "Very High",
"type": "enum"
}
],
"notes": "...",
"assignee": {...}
},
"stories": [...],
"attachments": [...]
}# Extract urgency field
asana task -j 64 | jq '.task.custom_fields[] | select(.name=="Urgency")'
# Get all attachment names
asana task -j 64 | jq '.attachments[].name'Attachments are listed when viewing a task:
asana task 64Output includes:
Attachments (1):
[0] Screenshot.png (GID: 1212292979508802)
Download by task index and attachment index:
# Download first attachment from task 64
asana download 64 0
# Download with custom output path
asana download -o /tmp/screenshot.png 64 0
asana download --output /tmp/screenshot.png 64 0Download directly by attachment GID:
asana download 1212292979508802
asana download -o myfile.png 1212292979508802asana done 12# Specific date
asana due 5 2014-08-21
# Relative dates
asana due 5 today
asana due 5 tomorrowasana comment 2
# or short form
asana cm 2This opens your $EDITOR to write a comment. Save and close to post.
asana browse 1
# or short form
asana b 1This fork includes the following enhancements over the original thash/asana:
Problem: Asana's API changed from integer id fields to string gid (Global ID) fields, causing 404 errors.
Solution:
- Added
Gidstring field to structs with backward compatibility forId - Added
GetTaskId()method that prefersGidoverId - Updated cache to store string GIDs
- Added proper JSON tags for all API fields
Status: Pull Request #30 opened upstream
Feature: Automatically display Asana custom fields when viewing tasks.
Details:
- Shows fields like Urgency, Dev Severity, Environment, Ticket Type, etc.
- Only displays fields with values (hides empty fields)
- Works with all custom field types (enum, multi_enum, text, number, date)
- No additional flags or API calls needed
Status: Pull Request #31 opened upstream
Feature: Added --json / -j flag for machine-readable output.
Use Cases:
- Automation and scripting
- Integration with other tools
- Data processing with jq, Python, etc.
Details:
- Outputs complete task data in JSON format
- Includes custom fields, attachments, assignee, dates, etc.
- Works with
--verboseflag to include stories/comments - Fully backward compatible (default text output unchanged)
Status: Pull Request #32 opened upstream
Feature: View and download file attachments from tasks.
Capabilities:
- List attachments with indices when viewing tasks
- Download by task index + attachment index
- Download directly by attachment GID
- Custom output paths with
--output/-oflag - Automatic handling of temporary S3 download URLs
- Included in JSON output for automation
Status: Pull Request #33 opened upstream
git clone https://github.com/deepneuronlab/asana-cli.git
cd asana-cli
go build
./asana helpgo test ./...Contributions are welcome! Please feel free to submit a Pull Request.
We maintain compatibility with the upstream repository and contribute improvements back when appropriate.
This project maintains the same license as the upstream thash/asana repository.
- Original project by thash
- Enhancements and maintenance by Deep Neuron Lab
- Built with urfave/cli
- This Fork: https://github.com/deepneuronlab/asana-cli
- Upstream: https://github.com/thash/asana
- Upstream PRs: #30, #31, #32, #33
- Asana API Documentation: https://developers.asana.com/docs