Command-line wrapper around the official Asana Python SDK
Project description
asana-api-cli
A CLI tool for the Asana API. It thinly wraps the official
python-asana SDK with click, exposing
every API endpoint from the command line via asana-api <group> <command>.
Installation
pip install asana-api-cli
# or, to install as an isolated CLI tool
pipx install asana-api-cli
Environment variables
| Name | Required | Description |
|---|---|---|
ASANA_ACCESS_TOKEN |
Yes (at runtime only) | Asana Personal Access Token |
ASANA_DEFAULT_WORKSPACE |
No | Default workspace GID for endpoints that require it |
The token can be issued from the
Asana Developer Console.
No token is needed for --help or argument-error output.
export ASANA_ACCESS_TOKEN="1/12345..."
export ASANA_DEFAULT_WORKSPACE="12345678" # optional
Shell completion
asana-api is built with Click, which supports dynamic shell completion.
To enable bash completion, add the following line to your ~/.bashrc:
eval "$(_ASANA_API_COMPLETE=bash_source asana-api)"
Then reload the shell (source ~/.bashrc or open a new terminal). Pressing
<TAB> after asana-api will now complete subcommands and options.
For zsh or fish, replace bash_source with zsh_source or fish_source
and add the line to ~/.zshrc or ~/.config/fish/config.fish respectively.
Usage
# Show version
asana-api --version
# List commands
asana-api --help
asana-api tasks --help
asana-api tasks get-tasks --help
# List workspaces
asana-api workspaces get-workspaces
# List projects (workspace resolved from ASANA_DEFAULT_WORKSPACE)
asana-api projects get-projects-for-workspace
asana-api projects get-projects --workspace <WORKSPACE_GID>
# List tasks (first page)
asana-api tasks get-tasks --project <PROJECT_GID>
# Auto-fetch all pages
asana-api tasks get-tasks --project <PROJECT_GID> --paginate
# Single task (--task instead of positional argument)
asana-api tasks get-task --task <TASK_GID>
# Create a task (body is a JSON string)
asana-api tasks create-task --body '{"data":{"name":"new task","projects":["<PID>"]}}'
# Output formats
asana-api tasks get-tasks --project <PID> --output table
asana-api tasks get-tasks --project <PID> --query '.data' --output csv
Workspace resolution
Many API endpoints require a workspace. For those endpoints (e.g.
get-projects-for-workspace), the CLI resolves it in this order:
--workspace <GID>on the commandASANA_DEFAULT_WORKSPACEenvironment variable
For endpoints where workspace is optional (e.g. get-tasks), the env-var
fallback is not used — pass --workspace explicitly if needed. This
prevents conflicts with other scope parameters like --project that are
mutually exclusive with workspace in the Asana API.
Development
See docs/development.md for building from source, project layout, and library usage.
License
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file asana_api_cli-1.4.0.tar.gz.
File metadata
- Download URL: asana_api_cli-1.4.0.tar.gz
- Upload date:
- Size: 36.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b7cc160aa319e895dd60ab467fe10af47d7e31fa3d6de3698dff97b8c7ac2d26
|
|
| MD5 |
2c5e519d09dc89d04ff5fa6b637e5937
|
|
| BLAKE2b-256 |
c357362c21601776673fa23be621f852c04d0299c111bc6a63e3fd38636c332a
|
Provenance
The following attestation bundles were made for asana_api_cli-1.4.0.tar.gz:
Publisher:
publish.yml on izumo-m/asana-api-cli
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
asana_api_cli-1.4.0.tar.gz -
Subject digest:
b7cc160aa319e895dd60ab467fe10af47d7e31fa3d6de3698dff97b8c7ac2d26 - Sigstore transparency entry: 1308555425
- Sigstore integration time:
-
Permalink:
izumo-m/asana-api-cli@952988aa661a14d65b58c2779486518e7ae69345 -
Branch / Tag:
refs/tags/v1.4.0 - Owner: https://github.com/izumo-m
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@952988aa661a14d65b58c2779486518e7ae69345 -
Trigger Event:
push
-
Statement type:
File details
Details for the file asana_api_cli-1.4.0-py3-none-any.whl.
File metadata
- Download URL: asana_api_cli-1.4.0-py3-none-any.whl
- Upload date:
- Size: 73.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d54c11401002c0b2f1fbd243b27b5e5a4160f6a24a0fbd9ac90cfba174041a09
|
|
| MD5 |
7cff184f9ea1629169346087a4328098
|
|
| BLAKE2b-256 |
e816ea2200ce8a03a21df5515d0571a98bb30d892fe893d83167b1eca542c05b
|
Provenance
The following attestation bundles were made for asana_api_cli-1.4.0-py3-none-any.whl:
Publisher:
publish.yml on izumo-m/asana-api-cli
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
asana_api_cli-1.4.0-py3-none-any.whl -
Subject digest:
d54c11401002c0b2f1fbd243b27b5e5a4160f6a24a0fbd9ac90cfba174041a09 - Sigstore transparency entry: 1308555544
- Sigstore integration time:
-
Permalink:
izumo-m/asana-api-cli@952988aa661a14d65b58c2779486518e7ae69345 -
Branch / Tag:
refs/tags/v1.4.0 - Owner: https://github.com/izumo-m
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@952988aa661a14d65b58c2779486518e7ae69345 -
Trigger Event:
push
-
Statement type: