npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@chikin14niwa/asana-cli

v0.1.0

Published

Codex-friendly backup CLI for Asana REST API task, subtask, and comment operations.

Downloads

35

Readme

asana-cli

Codex から Asana REST API を直接呼ぶためのバックアップ CLI です。MCP が接続できない場合でも、Node.js だけでタスク、サブタスク、コメントを操作できます。

前提

  • Node.js 18 以上
  • Asana Personal Access Token または OAuth access token
  • 環境変数 ASANA_ACCESS_TOKEN
export ASANA_ACCESS_TOKEN="your-token"

Asana API token は Authorization: Bearer <token> として送信します。token はログやコードに残さないでください。

インストール

グローバルにインストールすると、asana-cli コマンドを利用できます。

npm install --global @chikin14niwa/asana-cli
asana-cli --help

インストールせず一度だけ実行する場合:

npx @chikin14niwa/asana-cli --help

使い方

依存パッケージはありません。

asana-cli --help

Codex からは dry-run でリクエストを確認してから実行すると安全です。

asana-cli tasks get 1200000000000000 --dry-run

タスク

タスク検索は Asana の workspace search endpoint を使います。

asana-cli tasks search --workspace 123456789 --text "release" --limit 20
asana-cli tasks search --workspace 123456789 --project 987654321 --assignee me

タスク取得、作成、変更:

asana-cli tasks get 1200000000000000
asana-cli tasks create --workspace 123456789 --name "調査する" --notes "Codex から作成"
asana-cli tasks create --project 987654321 --name "実装する"
asana-cli tasks update 1200000000000000 --completed true
asana-cli tasks update 1200000000000000 --data-json '{"name":"名称変更","notes":"本文"}'

任意フィールドは --set key=value または --data-json で指定できます。

asana-cli tasks update 1200000000000000 --set custom_fields.12345="value"

サブタスク

Asana の subtask は task と同じ resource です。変更は task update endpoint に送られます。

asana-cli subtasks list 1200000000000000
asana-cli subtasks create 1200000000000000 --name "サブタスク"
asana-cli subtasks update 1200000000000001 --completed true

コメント

Asana API ではコメントは task story として扱われます。この CLI の comments list は既定で comment story だけを返します。system story も含めたい場合は --include-system を指定します。

asana-cli comments list 1200000000000000
asana-cli comments create 1200000000000000 --text "対応しました"
asana-cli comments update 1200000000000002 --text "コメントを修正しました"

補助コマンド

asana-cli me
asana-cli workspaces list

共通オプション

  • --dry-run: Asana に送信せず、method、URL、body を JSON で出力
  • --base-url <url>: API base URL を変更
  • --token <token>: ASANA_ACCESS_TOKEN の代わりに token を指定
  • --opt-fields <fields>: opt_fields をカンマ区切りで指定
  • --query key=value: 任意の query parameter を追加
  • --data-json '<json>': Asana の data object を JSON で指定
  • --data-file <path>: JSON ファイルから data object を読み込み
  • --stdin-json: stdin から data object を読み込み
  • --set key=value: data object に任意フィールドを追加
  • --compact: JSON を 1 行で出力

--data-json{"name":"x"}{"data":{"name":"x"}} の両方を受け付けます。

Asana API 対応

  • tasks search: GET /workspaces/{workspace_gid}/tasks/search
  • tasks list: GET /tasks
  • tasks get: GET /tasks/{task_gid}
  • tasks create: POST /tasks
  • tasks update: PUT /tasks/{task_gid}
  • subtasks list: GET /tasks/{task_gid}/subtasks
  • subtasks create: POST /tasks/{task_gid}/subtasks
  • subtasks update: PUT /tasks/{subtask_gid}
  • comments list: GET /tasks/{task_gid}/stories
  • comments create: POST /tasks/{task_gid}/stories
  • comments update: PUT /stories/{story_gid}

タスク検索 endpoint は Asana 側で Premium access が必要な場合があり、検索 index の eventual consistency により作成直後の変更がすぐ反映されないことがあります。書き込み直後の確認には tasks get または tasks list を使ってください。

参照:

テスト

npm test

リポジトリを直接利用する開発者向けの zsh command function は、./scripts/setup-zsh-alias.sh で設定できます。npm からインストールする場合、この設定は不要です。

公開手順と公開前チェックリストは docs/npm-publishing.md を参照してください。