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

@rarandeyo/iniad-moocs-cli

v0.3.1

Published

CLI for INIAD MOOCs — imoocs

Readme

iniad-moocs-cli (imoocs)

ターミナルや AI agent から使うことを想定した INIAD MOOCs非公式 CLI

コース・レッスン・課題情報・スライド・Drive 配布物の閲覧、取得、整理を支援

imoocs assignment submit / upload による提出操作もできるが、提出物の内容、提出判断、提出操作等すべての責任は利用者にあります

実装の性質上、予告なく動かなくなる可能性があります。利用は自己責任でお願いします

主な機能

  • 閲覧 — コース・レッスン・課題・スライド・Drive 配布物を CLI で表示
  • 取得 — スライド PDF や Drive ファイルをローカルにダウンロード
  • 提出 — 課題の submit / upload。confirm モードなら人間が push で最終確定
  • URL ルーティングimoocs open <url> で URL を適切なコマンドに振り分け
  • AI agent 対応 — 全コマンドが JSON envelope + 固定 exit code を返し、agent からも上記すべての操作を実行可能 (agent skill 同梱)

Quick start

  1. CLI をインストール

    推奨: npm (要 Node.js、クロスプラットフォーム)

    npm install -g @rarandeyo/iniad-moocs-cli

    Linux / macOS (shell installer):

    curl --proto '=https' --tlsv1.2 -LsSf \
      https://github.com/rarandeyo/iniad-moocs-cli/releases/latest/download/imoocs-cli-installer.sh | sh

    Windows (PowerShell):

    irm https://github.com/rarandeyo/iniad-moocs-cli/releases/latest/download/imoocs-cli-installer.ps1 | iex

    ソースから (Rust toolchain 必須):

    cargo install --git https://github.com/rarandeyo/iniad-moocs-cli imoocs-cli

    agent-browser もインストール (課題提出 / Drive / スライド取得に必須)

    imoocs はブラウザ操作を agent-browser (ヘッドレス Chrome) に委譲する。課題の閲覧だけなら無くても動くが、 submit / upload / push / drive / slide 系には必須。

    npm install -g agent-browser   # または: cargo install agent-browser --locked
  2. MOOCs / Google SSO にログイン

    imoocs setup

    備考: パスワードは OS の keyring に保存する。Linux は D-Bus secret-service (gnome-keyring / KeePassXC の secret-service 機能など) が動作している必要がある。

    以下の 4 step が順に走る:

    • INIAD MOOCs ログイン — username / password を対話入力
    • Google SSO セッション取得 — 自動
    • 提出モード (assignment.confirm) — 答案提出 (submit) / ファイル提出 (upload) の挙動を confirm / auto から選ぶ (詳細は Config)
      • confirm — ローカル draft に stage するだけ。サーバ確定は TTY で imoocs assignment push を叩いたとき (AI agent の誤操作対策)
      • autosubmit / upload で即サーバ確定
    • shell 補完の自動配置 — XDG 標準パスに配置するか確認
  3. Agent skill をインストール (要 GitHub CLI (gh))

    AI agent (Claude Code など) から imoocs を使うための agent skill を 2 つ入れる。

    gh skill install rarandeyo/iniad-moocs-cli imoocs
    gh skill install rarandeyo/iniad-moocs-cli imoocs-drive-setup
  4. 履修コースと Drive フォルダを紐付け (AI agent 内で agent skill として起動)

    AI agent (Claude Code など) の対話プロンプトで以下を実行:

    /imoocs-drive-setup

    skill が起動し、履修中のコースごとに授業資料の Drive フォルダを 対話で登録する (保存先:$XDG_CONFIG_HOME/imoocs/course-drive-folders.toml)。root は Drive 上の [受講生]講義資料 フォルダ名から自動発見する。

  5. セットアップ完了を確認

    imoocs doctor

    認証・設定・completion・Drive フォルダを一括検査する。最後の行が Quick start: ✓ 全項目クリア になれば Quick start 完了。⚠ が残っていれば該当 step に戻る。 JSON envelope の quickStartComplete: true も同じ判定に使える。

Config

$XDG_CONFIG_HOME/imoocs/config.toml に保存される。imoocs setup で一部項目は対話設定されるが、手で編集してもよい。

| key | 値 | デフォルト | 用途 | |---|---|---|---| | [slides] out_dir | "cache" / "tmp" / 絶対パス | "tmp" | imoocs slide fetch / imoocs lesson show / imoocs open (lesson URL) が既定で取得する PDF の保存先。"cache"$XDG_CACHE_HOME/imoocs/slides/"tmp"/tmp/imoocs/slides/ (OS が自動クリーンアップ)。 | | [assignment] confirm | "auto" / "confirm" | 未設定 (エラー) | submit / upload の挙動 (即サーバ確定 or ローカル stage)。下表参照。 |

[assignment] confirm の挙動

submit / uploadpush で 2-step 運用を切り替える軸。submit / upload は 「答案を記録する」verb、push は「stage した draft をサーバに確定送信する」verb。

| mode | submit / upload | push | |---|---|---| | 未設定 | Validation エラーで停止 (imoocs setup で選ぶか config を直接編集してください) | 同左 | | auto | 確認なしで即サーバ確定(従来互換) | stage があればサーバ確定、無ければ NOT_FOUND | | confirm | ローカル draft に stage するだけ(TTY/非 TTY 共通、サーバ未送信)。$XDG_STATE_HOME/imoocs/drafts/ に保存される | TTY 必須。対話プロンプトで y を押したときだけ put_answers(force=true) と各 post_file(force=true) を順次送信 |

confirm モードは AI agent がうっかり submit を叩いてもサーバに副作用が出ない 安全装置。ユーザは agent が提示した draft の中身を確認してから、TTY で imoocs assignment push を叩いて確定する 2-step フローになる。

例:

[slides]
out_dir = "cache"

[assignment]
confirm = "auto"

Commands

完全なコマンド/オプション/config/XDG 状態の説明は docs/cli-reference.md を参照。

imoocs setup [--username <u>] [--password-stdin] [--skip-google] [--install-completion]
imoocs auth {login,login-google,logout,status,export}
imoocs course {list,show}
imoocs lesson show <courseId> <lessonId> [--page <p>] [--no-assignments] [--no-fetch-slides] [--no-cache]
imoocs slide fetch <embedUrl>
imoocs assignment {list,show,submit,upload,push,drafts}  # confirm モードでは submit/upload は stage のみ、push で確定 (送信は agent-browser 経由)
imoocs assignment drafts {list,show,clear}               # $XDG_STATE_HOME/imoocs/drafts/ の操作
imoocs drive {list,search,fetch,folders}            # list/search/fetch は agent-browser (Chrome) 経由で Drive、folders は course-drive-folders.toml を表示
imoocs open <url>                                   # URL 1 本でルーティング
imoocs reset [--scope auth|config|cache|drafts|all] [--yes] [--dry-run]  # credential / 設定 / cache / draft を一括削除
imoocs completion {generate,install}                # generate=stdout / install=XDG 標準パスに配置
imoocs {doctor,version}

All commands output a stable JSON envelope:

{ "success": true, "data": {...} }
{ "success": false, "error": { "code": "...", "message": "...", "hint": "..." } }

Exit code: 0 / 1 API / 2 Auth / 3 Validation / 4 NotFound / 5 Internal / 6 Network / 7 NetworkRestricted / 8 NonPublic.

Development

Rust toolchain は rust-toolchain.toml1.93.1 + rustfmt + clippy に固定。 rustup が入っていれば repo に cd するだけで自動適用される。

cargo build --workspace

cargo-dist など Rust 以外のツールは mise で管理。

mise trust . && mise install       # 初回のみ (cargo-dist を入れる)

Linux でビルド時に dbus-1 が見つからないエラーが出たら libdbus-1-devpkg-config を OS のパッケージマネージャで入れる。

Docs

License

MIT. Includes adapted code from moocs-collect (MIT, Copyright 2024 Yuki Natori). See LICENSE-THIRD-PARTY.md.