Command-line wrapper around the official Asana Python SDK
Project description
asana-api-cli
Call any Asana endpoint from your shell — no throwaway Python script
needed. asana-api <group> <command> turns every method of the official
python-asana SDK into a
command, so you can read, create, and inspect Asana data one line at a time.
And because each command maps 1:1 to an SDK method, the call you work out in the shell is the call you write in Python:
# Work it out interactively...
asana-api tasks get-tasks --project 123 --opt-fields name,assignee.name
# ...then drop the same call into your app:
asana.TasksApi(client).get_tasks({"project": "123", "opt_fields": "name,assignee.name"})
Why asana-api-cli
- Explore the whole API from the shell. Every method of every
*Apiclass is a command — list tasks, create a project, poll events — with no script and no boilerplate. - What you learn transfers to Python. Flags map to SDK method
parameters, and JSON output matches the SDK's response shape — so a
working shell call becomes a working SDK call. Each option's
--helpeven names where its value lands in the SDK. - Always matches your SDK version. The command tree is built at startup
by introspecting the installed
asanapackage. Install it beside your project's SDK and the two stay in lock-step — new upstream methods appear the momentpip install -U asanalands, with noasana-api-clirelease and no stale docs. - Shell-native ergonomics. JSON / table / CSV / text output,
jqfiltering (--query), automatic pagination, structured error envelopes, and--debugrequest tracing with the auth token masked.
Installation
pip install asana-api-cli
For best results, install asana-api-cli into the same Python environment
that holds your project's python-asana so the CLI surface tracks the
exact SDK version your application uses (see As a
dev-dependency below).
As a dev-dependency
If your project already uses python-asana, add asana-api-cli to your dev
group so the CLI tracks the same SDK version your application code uses:
# pyproject.toml
[project]
dependencies = ["asana>=5.2,<6"]
[dependency-groups] # uv
dev = ["asana-api-cli"]
# Poetry
[tool.poetry.group.dev.dependencies]
asana-api-cli = "*"
After uv sync (or equivalent), asana-api resolves to the project's
.venv and introspects whatever asana version is locked there. Calls
prototyped with asana-api tasks ... translate directly to the SDK calls
you'll write in your app.
Installing globally with pipx
If you would rather isolate asana-api-cli from any project's dependencies
— for example, when you administer Asana from the shell without writing
Python — install it with pipx:
pipx install asana-api-cli
In this setup the CLI uses the python-asana version pipx resolved when
installing asana-api-cli; pipx upgrade asana-api-cli updates only
asana-api-cli itself, not the bundled python-asana. To pull a newer
python-asana into the existing pipx install without reinstalling the
CLI:
pipx runpip asana-api-cli install -U asana
The next asana-api run sees the new SDK and any newly added methods
automatically.
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 validation errors.
export ASANA_ACCESS_TOKEN="2/12345..."
export ASANA_DEFAULT_WORKSPACE="12345678" # optional
On Windows PowerShell:
$env:ASANA_ACCESS_TOKEN = "2/12345..."
$env: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.
Click does not generate PowerShell completion. Windows users can install
completion under WSL or Git Bash using the bash_source line above.
Usage
# Version and help
asana-api --version
asana-api --help
asana-api tasks --help
asana-api tasks get-tasks --help
# List workspaces
asana-api workspaces get-workspaces
# List up to 50 projects
asana-api projects get-projects-for-workspace --item-limit 50
asana-api projects get-projects --workspace <WORKSPACE_GID> --item-limit 50
# List every task in a project (walks every page by default)
asana-api tasks get-tasks --project <PROJECT_GID>
# Preview the first few items
asana-api tasks get-tasks --project <PROJECT_GID> --item-limit 5
# One HTTP call: return the first page + the next_page cursor
asana-api tasks get-tasks --project <PROJECT_GID> --limit 100 --full-payload
# Single task
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":["<PROJECT_GID>"]}}'
# Output formats — pair non-JSON formats with `--query '.data'` to unwrap the
# `{"data": [...]}` envelope into one row per item.
asana-api tasks get-tasks --project <PROJECT_GID> --query '.data' --output table
asana-api tasks get-tasks --project <PROJECT_GID> --query '.data' --output csv
# CSV output is UTF-8 without a BOM by default. Pass --csv-bom for Excel on
# Windows, which otherwise displays non-ASCII characters as garbled text.
asana-api tasks get-tasks --project <PROJECT_GID> --output csv --csv-bom > tasks.csv
# --output none suppresses the success payload — handy for side-effect-only
# calls (delete/update) where only the exit code matters. The `--query` pass
# still runs, so jq syntax errors are caught even when output is silenced.
asana-api tasks delete-task --task <TASK_GID> --output none
For the complete option reference — global options, pagination, output formats,
workspace resolution, error handling, and exit codes — see
docs/usage.md.
Asana only accepts Bearer-token authentication (personal access token, Service
Account, or OAuth), so authenticate with --access-token or
$ASANA_ACCESS_TOKEN.
Development
See docs/development.md for building from source and project layout.
License
Project details
Release history Release notifications | RSS feed
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-3.1.1.tar.gz.
File metadata
- Download URL: asana_api_cli-3.1.1.tar.gz
- Upload date:
- Size: 95.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 |
f07ba463bc0ba136386a6b5563948d53367e0755b66efb1afbdcdb141782ed9a
|
|
| MD5 |
f319919f2ff1bd8d5028331a31913310
|
|
| BLAKE2b-256 |
cdabdc41689c95a789c15a380efb4c43b122cc08956e9b09cdc544371e7ff7db
|
Provenance
The following attestation bundles were made for asana_api_cli-3.1.1.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-3.1.1.tar.gz -
Subject digest:
f07ba463bc0ba136386a6b5563948d53367e0755b66efb1afbdcdb141782ed9a - Sigstore transparency entry: 1682723505
- Sigstore integration time:
-
Permalink:
izumo-m/asana-api-cli@015836e6f2ee2e66bb887391b51b789aefba37f6 -
Branch / Tag:
refs/tags/v3.1.1 - Owner: https://github.com/izumo-m
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@015836e6f2ee2e66bb887391b51b789aefba37f6 -
Trigger Event:
push
-
Statement type:
File details
Details for the file asana_api_cli-3.1.1-py3-none-any.whl.
File metadata
- Download URL: asana_api_cli-3.1.1-py3-none-any.whl
- Upload date:
- Size: 48.2 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 |
d485a5de9710c95dd4a5773b4ee12e9fd8edf48ea379d1164a17db27c13680f6
|
|
| MD5 |
62451d306b5559fffc21613d38654bcc
|
|
| BLAKE2b-256 |
2c399a94dccbf119299dc5f82f7f340ab5a32f9b89e69694f9a94603a5f48330
|
Provenance
The following attestation bundles were made for asana_api_cli-3.1.1-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-3.1.1-py3-none-any.whl -
Subject digest:
d485a5de9710c95dd4a5773b4ee12e9fd8edf48ea379d1164a17db27c13680f6 - Sigstore transparency entry: 1682723599
- Sigstore integration time:
-
Permalink:
izumo-m/asana-api-cli@015836e6f2ee2e66bb887391b51b789aefba37f6 -
Branch / Tag:
refs/tags/v3.1.1 - Owner: https://github.com/izumo-m
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@015836e6f2ee2e66bb887391b51b789aefba37f6 -
Trigger Event:
push
-
Statement type: