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

training-agent

v0.9.0

Published

Simple browser-use agent that opens online trainings and follows on-screen instructions.

Readme

training-agent

A small browser-use agent that opens an online training and follows the on-screen instructions until it is done.

It can:

  • open a course / LMS URL
  • start or resume the training
  • read and follow Next / Continue / quiz / video instructions
  • switch between browser tabs and windows when a lesson opens a document, video, or quiz separately
  • keep a Chrome profile so LMS logins persist

Install

This package is not on PyPI yet, so pip install training-agent will fail with "No matching distribution found".

Python 3.11+ is required (python3 on macOS is often 3.9). Use 3.12 from this repo:

cd /path/to/Training
python3.12 -m pip install -e .
training-agent setup

Or with uv:

uv sync
uv run training-agent setup

npm (wrapper around the same Python package)

From this repo:

npm install -g .

A published npm install -g training-agent still needs Python 3.11+; it installs the bundled Python sources, not PyPI.

API key

Create a .env file (see .env.example) and edit llm.json to choose Azure, GCP, or AWS models.

# Azure OpenAI
AZURE_OPENAI_API_KEY=
AZURE_OPENAI_ENDPOINT=https://YOUR_RESOURCE.openai.azure.com

# GCP Vertex AI
GOOGLE_CLOUD_PROJECT=
GOOGLE_CLOUD_LOCATION=us-central1

# AWS Bedrock
AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
AWS_REGION=us-east-1

After install, create an editable llm.json in this folder:

training-agent init
training-agent llm path
training-agent llm show

That writes:

  • ./llm.json in the current directory
  • ~/.training-agent/llm.json as a fallback

Open llm.json and set Azure, GCP, or AWS models. Put API keys in .env, not in the JSON file.

training-agent configure --provider azure --model gpt-4.1 \
  --endpoint https://YOUR_RESOURCE.openai.azure.com \
  --api-key YOUR_KEY

Run

training-agent complete https://your-lms.example.com/course/123

A URL alone is enough:

training-agent https://your-lms.example.com/course/123

Useful flags:

training-agent complete https://your-lms.example.com \
  -f examples/steps.txt \
  --max-steps 400

The steps file can be numbered, bulleted, or one step per line:

1. Go to https://your-lms.example.com and sign in if needed.
2. Open assigned or incomplete trainings.
3. Complete the first one fully.
4. Return to the list and do the next one.
5. Stop when nothing open remains.

If the file already contains a URL, you can omit the URL argument:

training-agent complete -f examples/steps.txt

| Flag | What it does | | --- | --- | | -f, --steps-file | Load multiple steps from a text file | | --instructions-file | Same as --steps-file | | --instructions | Extra instructions as a single string | | --username / --password | LMS login. Prefer TRAINING_USERNAME and TRAINING_PASSWORD in .env | | --profile | Chrome profile directory so cookies survive. Default: ~/.training-agent/chrome-profile | | --system-chrome | Use your installed Chrome (close Chrome first) | | --headless | Hide the browser window | | --keep-alive | Leave the browser open when the agent stops | | --provider / --model | Override llm.json (azure, gcp, aws, …) | | --llm-config | Path to llm.json | | --allowed-domain | Restrict navigation, repeatable |

If the site asks for 2FA or a captcha, the agent can pause and ask you in the terminal.

Python API

import asyncio
from training_agent import complete_training

async def main():
    report = await complete_training(
        url="https://your-lms.example.com/course/123",
        instructions="Finish the assigned safety module.",
    )
    print(report.completed, report.summary)

asyncio.run(main())

Or with more control:

from training_agent import TrainingAgent, TrainingConfig

config = TrainingConfig(
    url="https://your-lms.example.com/course/123",
    headless=False,
    max_steps=150,
)
report = TrainingAgent(config).run_sync()

How it behaves

The agent is a thin wrapper around browser_use.Agent with:

  1. A training-specific system prompt (read instructions, don’t skip required media, handle iframes)
  2. Extra tools: list_open_tabs, switch_to_matching_tab, wait_for_training_media, ask_human
  3. Structured output (completed, progress, blockers, tabs_used)

When a lesson opens a new tab or window, it lists tabs, switches to the new one, finishes that step, then returns to the player.

Publish (maintainers)

# npm (checks login, version, tests, then uploads)
npm run publish:npm:dry
npm run publish:npm
npm run publish:npm -- --otp 123456

# PyPI (needs a token: export UV_PUBLISH_TOKEN=pypi-...)
npm run publish:pypi:dry
npm run publish:pypi

Until those publishes happen, install from the repo with pip install -e . or npm install.