Skip to main content

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

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:

  1. --workspace <GID> on the command
  2. ASANA_DEFAULT_WORKSPACE environment 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

Apache License 2.0

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

asana_api_cli-1.2.1.tar.gz (37.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

asana_api_cli-1.2.1-py3-none-any.whl (73.3 kB view details)

Uploaded Python 3

File details

Details for the file asana_api_cli-1.2.1.tar.gz.

File metadata

  • Download URL: asana_api_cli-1.2.1.tar.gz
  • Upload date:
  • Size: 37.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for asana_api_cli-1.2.1.tar.gz
Algorithm Hash digest
SHA256 8c8e2356efad8d7ee4f0ee3d99f7281fe8f7b5b6fe22826af2f3c321e201d274
MD5 4f2bb9f3c5ffc73f4f23a0d89a99306d
BLAKE2b-256 0f40356a36ad36af05a25011b2248205e5f1e91fb0cf27afc3a7011c1f4a5485

See more details on using hashes here.

File details

Details for the file asana_api_cli-1.2.1-py3-none-any.whl.

File metadata

  • Download URL: asana_api_cli-1.2.1-py3-none-any.whl
  • Upload date:
  • Size: 73.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for asana_api_cli-1.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 fad2e9c558a3ddf7ddc69546473eedacd73bf6a0c0670e2f6ea87269116bafe2
MD5 5debcbc3617af6ac4e9a6ca950a1fb0e
BLAKE2b-256 a52b9f3d2c867d54b78193b3e587725e153ea459f51fb77e7cc8fc34b2b63c01

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page