# Asana CLI Skill Use `asana` for all Asana operations. Direct REST API with 30s timeouts and automatic retry. ## Output Flags `--json` and `-v` work in any position (before or after subcommand): ```bash asana --json tasks -p # Before subcommand asana tasks -p --json # After subcommand asana sections -v # Show GIDs ``` `-v` controls whether GIDs are shown. Without it, output is clean names only. ## Markdown (Default) Markdown-to-rich-text conversion is **on by default**. All text passed via `-n` or `-m` is converted to Asana rich text automatically. ```bash # Markdown conversion happens automatically asana create "Task" -n "## Summary\n- Point one" asana update -n "**Done:** fixed bug" asana comment "### Update\nFixed the **bug**" # -m with text still works as shorthand for -n "text" asana create "Task" -m "## Summary\n- Point one" asana update -m "**Done:** fixed bug" # Use --plain to disable markdown conversion (send as literal text) asana create "Task" -n "Use the * operator" --plain asana comment "raw text, no conversion" --plain ``` ## Command Reference ### Read ```bash asana workspaces # List workspaces asana projects # List projects (add --archived for archived) asana projects -l 100 # Limit results asana task # Full task details (shows subtask count if any) asana task --subtasks # Include subtask list inline asana task # Description displayed as markdown by default asana task --plain # Display raw description without markdown conversion asana subtasks # List subtasks asana stories # Comments and activity asana stories -l 20 # Limit to 20 entries asana tasks -p # Tasks in project (default: 100) asana tasks -s # Tasks in section asana tasks -p -i # Incomplete only asana tasks -p -i -l 50 # Incomplete, limit 50 asana tasks -p -a me -i # My incomplete tasks in project asana tasks -p -a # Tasks assigned to specific user asana tasks -a me -i # All my incomplete tasks (any project) asana search "query text" # Search tasks asana search "query" -i # Incomplete only asana search "query" -a me # Assigned to me asana search "query" -a # Assigned to specific user asana search "query" -p # Within project asana search -t "query" -i -l 20 # Text via flag, incomplete, limit 20 asana search "query" --custom-field # Filter by custom field (repeatable) asana my-tasks # All my tasks asana my-tasks -i # My incomplete tasks asana sections # List sections (names only, use -v for GIDs) asana custom-fields # List custom fields asana help search # Help for a specific command ``` ### Dependencies ```bash asana dep # Show blockers and dependents asana dep add --blocked-by # Task is blocked by another asana dep add --blocks # Task blocks another asana dep add --blocked-by # Multiple blockers at once asana dep rm --blocked-by # Remove a blocker asana dep rm --blocks # Remove a dependent asana dep chain # Chain: gid1 → gid2 → gid3 ``` ### Write ```bash # Create task asana create "Task name" asana create "Task name" -p asana create "Task name" -p -a me -d 2026-03-15 asana create "Task name" -p --start 2026-03-01 -d 2026-03-15 # Date range asana create "Task name" -n "Plain description" asana create "Task name" -n "## Rich description\n- bullet" # markdown by default asana create "Task name" -p --custom-fields '{"": "value"}' # Update task asana update --name "New name" asana update -n "New description" # markdown by default asana update -c true # Mark complete asana update -c false # Mark incomplete asana update -a me # Assign to self asana update -a # Assign to user asana update -d 2026-03-15 # Set due date asana update --start 2026-03-01 -d 2026-03-15 # Set date range asana update --start "" # Clear start date # Comment asana comment "Comment text" asana comment "**Bold** comment with _formatting_" # markdown by default # Organize asana move -s # Move to section asana move -s --after # Position after task asana set-parent -p # Make subtask asana set-parent -p none # Remove parent ``` ### Goals (uses asana_sdk) ```bash asana goals # All goals in workspace asana goals -t # Filter by team asana goals -p # Filter by time period asana goal # Goal details asana create-goal "Goal name" --owner --notes "Description" asana update-goal --status green --notes "On track" asana goal-metric 75 # Update metric progress ``` ## Output Options | Flag | Effect | |------|--------| | `--json` | Raw JSON output | | `-v` / `--verbose` | Show GIDs in formatted output (sections, projects, workspaces, tasks) | Default output shows clean names/data without GIDs. Use `-v` when you need GIDs for follow-up commands. ## Result Limits Default limits: tasks=100, search=50. When results hit the limit, the CLI shows: ``` (100 tasks shown, more exist - use -l to increase limit) ``` Use `-l` to adjust: ```bash asana tasks -p -l 200 # Fetch up to 200 tasks asana search "query" -l 100 # Search up to 100 results ``` **Note:** When combining `-a` (assignee) with `-p` (project), the CLI delegates to the search API since `GET /tasks` doesn't support both filters together. ## Supported Markdown These markdown features are converted to Asana rich text by default: - `# H1`, `## H2` (H3-H6 rendered as H2) - `**bold**`, `*italic*`, `~~strikethrough~~` - `` `inline code` `` and fenced code blocks - `- unordered` and `1. ordered` lists - `[text](url)` links - `> blockquotes` - `---` horizontal rules ## Common Agent Mistakes 1. **Not using `-v` when GIDs are needed** → Default output omits GIDs for readability. Use `-v` to see them for follow-up commands. 2. **Using `--plain` when markdown is intended** → Only use `--plain` when you explicitly want literal text without rich formatting. ## Project Configuration Check for `.asana-config.json` in the project root at the start of any Asana operation. This is a **GID registry** — stable identifiers for the workspace's projects, sections, custom fields, users, and goals. Use its GIDs as defaults instead of asking the user. The `context` field explains when/how to use each resource. This file is **not** for workflows, conventions, or agent logic — those belong in skills and agent definitions. ```json { "workspace": { "gid": "...", "name": "..." }, "projects": { "key": { "gid": "...", "name": "...", "context": "when to use this project", "sections": { "key": { "gid": "...", "name": "..." } } } }, "custom_fields": { "key": { "gid": "...", "name": "...", "values": { "key": { "gid": "...", "name": "..." } } } }, "users": { "key": { "gid": "...", "name": "..." } }, "goals": { "key": { "gid": "...", "name": "..." } } } ``` If no `.asana-config.json` exists, rely on env vars and ask for GIDs as needed. ## Environment ```bash # Required: Personal access token export ASANA_ACCESS_TOKEN="your_token" # Optional: Default workspace GID export ASANA_WORKSPACE="your_workspace_gid" ``` Or use OAuth: ```bash cd asana && python3 oauth_setup.py ```