Skip to main content

Automatic human-readable ID assignment for Asana tasks

Project description

Asana Auto-ID

Automatic human-readable ID assignment for Asana tasks and subtasks.

What is this?

aa-cli automatically adds short, readable IDs to your Asana tasks - like PRJ-5 or PRJ-5-1. This makes tasks easier to reference in discussions, documentation, and team communication.

Key Features:

  • 🔢 Automatic hierarchical ID assignment
  • 🔄 Preserves existing IDs and detects conflicts
  • 🌳 Supports unlimited nesting depth
  • 🚀 Fast async processing
  • 🔍 Dry-run mode to preview changes

Installation

Prerequisites

Install UV if you don't have it:

# macOS/Linux
curl -LsSf https://astral.sh/uv/install.sh | sh

# Windows
powershell -c "irm https://astral.sh/uv/install.ps1 | iex"

Usage

No installation needed! Just use uvx:

uvx aa-cli --help

Optional: Install globally for shorter commands:

uv tool install aa-cli
aa-cli --help

Quick Start

1. Initialize

Create your configuration file:

uvx aa-cli init

This will:

  • Prompt for your Asana Personal Access Token
  • Fetch all your projects automatically
  • Create .aa.yml with everything configured

Get your token: Asana Developer Console → "Create new token"

2. Scan

Build the ID cache from your existing tasks:

uvx aa-cli scan

3. Update

Preview changes:

uvx aa-cli update --dry-run

Apply IDs to tasks:

uvx aa-cli update

Done! Your tasks now have IDs like PRJ-1, PRJ-2, etc.

ID Format

IDs follow a hierarchical pattern:

PRJ-1: Implement authentication
├── PRJ-1-1: Design login flow
├── PRJ-1-2: Create user model
│   ├── PRJ-1-2-1: Add validation
│   └── PRJ-1-2-2: Write tests
└── PRJ-1-3: Build API endpoints

PRJ-2: Setup CI/CD
└── PRJ-2-1: Configure GitHub Actions
  • Root tasks: CODE-N (e.g., PRJ-5)
  • Subtasks: CODE-N-M (e.g., PRJ-5-1)
  • Nested: CODE-N-M-K (e.g., PRJ-5-1-2)
  • Unlimited depth supported

Commands

init

Initialize configuration:

# Interactive mode (recommended)
uvx aa-cli init

# Create template only
uvx aa-cli init --force

scan

Scan projects and update cache:

# Scan all projects
uvx aa-cli scan

# Scan specific project
uvx aa-cli scan --project PRJ

# Ignore conflicts
uvx aa-cli scan --ignore-conflicts

update

Assign IDs to tasks:

# Preview changes
uvx aa-cli update --dry-run

# Apply changes
uvx aa-cli update

# Update specific project
uvx aa-cli update --project PRJ

Options

All commands support:

  • --config PATH - Custom config file location
  • -v - Verbose output (use -vv for debug)
  • --help - Show help

Configuration

.aa.yml

asana_token: 'your-personal-access-token'
projects:
  - code: PRJ      # 2-5 uppercase letters
    asana_id: '1234567890'
  
  - code: TSK
    asana_id: '9876543210'

Finding project IDs:

  • Open project in Asana
  • Look at URL: https://app.asana.com/0/1234567890/...
  • The number after /0/ is your project ID

Or just use uvx aa-cli init - it fetches everything automatically!

.aa.cache.yaml

Automatically managed by scan and update. Tracks the last assigned ID for each project:

projects:
  PRJ:
    last_root: 42
    subtasks:
      '5': 3      # PRJ-5-3 is last subtask of PRJ-5

Workflow

Regular Usage

# Add new tasks in Asana, then:
uvx aa-cli update

Adding New Projects

  1. Edit .aa.yml to add the project
  2. Run uvx aa-cli scan --project NEW
  3. Run uvx aa-cli update --project NEW

Handling Conflicts

If someone manually added IDs or cache is out of sync:

# Review the conflict
uvx aa-cli scan

# If safe, update cache to match Asana
uvx aa-cli scan --ignore-conflicts

Troubleshooting

"Config file not found"

  • Run uvx aa-cli init first

"Invalid token" or 401 errors

"Conflict detected"

  • Someone may have manually added IDs
  • Review tasks in Asana
  • Use --ignore-conflicts if safe

Tasks not getting IDs

  • Check if tasks already have IDs (they're skipped)
  • Make sure you're running update, not just scan
  • Remove --dry-run flag

Development

For contributors and developers:

Setup

git clone https://github.com/umaxfun/asana-tools
cd asana-tools
uv sync

Run Locally

uv run aa-cli --help

Project Structure

aa/
├── cli.py              # Main CLI entry point
├── commands/           # Command implementations
├── core/               # Business logic
├── models/             # Data models
└── utils/              # Utilities

Testing

uv run pytest

Adding Dependencies

uv add <package-name>

License

MIT

Support

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

aa_cli-0.3.0.tar.gz (58.0 kB view details)

Uploaded Source

Built Distribution

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

aa_cli-0.3.0-py3-none-any.whl (29.0 kB view details)

Uploaded Python 3

File details

Details for the file aa_cli-0.3.0.tar.gz.

File metadata

  • Download URL: aa_cli-0.3.0.tar.gz
  • Upload date:
  • Size: 58.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.10 {"installer":{"name":"uv","version":"0.9.10"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for aa_cli-0.3.0.tar.gz
Algorithm Hash digest
SHA256 d51009b6af6833197bdce5b57ee54e6233e6c7f727d63cf168adf87a3052f784
MD5 c44071746b82370a4559285a67145dd1
BLAKE2b-256 928700138cbceb6b009c02b4824b829aae18b5916a63b781f3952ed0be04cb98

See more details on using hashes here.

File details

Details for the file aa_cli-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: aa_cli-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 29.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.10 {"installer":{"name":"uv","version":"0.9.10"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for aa_cli-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3f39a93643f8880fc69af45f5bd4f4710393df0d5b1d1d14ec178abcc755c224
MD5 abb6460515c42eb3aeb6ae705bcb47b0
BLAKE2b-256 9aeee69ac541778f4facd910b826628244ff7b6ffb21face2beaeef660791dc4

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