watchup-cli
v1.0.4
Published
watchup-cli is a small command-line interface (CLI) for interacting with the Watchup monitoring service from your terminal. It allows you to log in, list and manage projects and monitors, and perform common tasks without visiting the web dashboard.
Readme
watchup-cli
watchup-cli is a small command-line interface (CLI) for interacting with the Watchup monitoring service from your terminal. It allows you to log in, list and manage projects and monitors, and perform common tasks without visiting the web dashboard.
Key features
- Login/logout and token management
- List, create, and delete projects
- List, create, select, and delete monitors
- Interactive prompts and non-interactive options for automation
Repository
- CLI entry:
index.js - Package: see
package.jsonfor metadata andbinmapping
Installation
Globally via npm:
npm install -g watchup-cliOr install locally for development:
cd <project-folder>
npm installQuick Start
- Install the CLI (see Installation).
- Run
watchup loginand provide your credentials. - Use
watchup projects:listto view projects, orwatchup monitors:list --project <projectId>to view monitors.
Commands
The CLI exposes the following commands (interactive where noted):
watchup login— Login to Watchup (interactive prompt).watchup logout— Remove saved token and logout.watchup whoami— Show the logged-in user info (tries token, then server).watchup projects:list— List your projects.watchup projects:create [--name <name>] [--description <desc>]— Create a project (interactive fallback).watchup projects:delete [--project <id>]— Delete a project (interactive fallback).watchup monitors:list --project <id>— List monitors for a project.watchup monitors:create [--project <id>]— Create a monitor (interactive fallback).watchup monitors:delete [--project <id>]— Delete a monitor (interactive fallback).watchup monitors:select— Interactively pick a project and monitor to view details.
Examples:
watchup login
watchup projects:list
watchup monitors:list --project abc123
watchup monitors:create --project abc123Configuration & Token Storage
- The CLI saves the auth token to a file in the current user's home directory (typically
~/.watchup_token.json). - Do not commit your token file to source control. A
token.jsonexists in this repo template but is not required.
If you need CI/CD publishing or automation, prefer setting a NPM_TOKEN environment variable and using ~/.npmrc rather than committing tokens to the repo.
Publishing to npm
Checklist before publishing:
- Make sure the
nameinpackage.jsonis unique on npm. - Bump the
versionfield for each publish. - Fill
description,author, andrepositoryinpackage.json. - Add a short
README.md(this file). - Exclude sensitive files like local token files via
.npmignoreor by placing them outside the package.
Dry-run and publish commands:
cd "C:\Users\emman\OneDrive\Desktop\watchup-cli"
npm publish --dry-run
# if dry-run looks correct and you're authenticated
npm publishAuthentication:
- Create an automation token at https://www.npmjs.com/settings//tokens.
- Add it to your user
~/.npmrcas//registry.npmjs.org/:_authToken=YOUR_TOKEN, or exportNPM_TOKENand use it at publish time.
Contributing
- Clone the repo and open it locally.
- Run
npm installto install dependencies. - Make changes and test commands locally with
node index.js <command>or by linking:npm link.
Please open issues or pull requests for bugs, feature requests, or improvements.
Troubleshooting
- If publish fails due to an existing version, bump
versioninpackage.json. - If you see authentication errors, ensure your npm token is valid and present in
~/.npmrcorNPM_TOKEN. - If network errors occur, verify the
API_URLinindex.jsand your internet connection.
License
This project currently lists ISC in package.json. Update the license field in package.json if you choose a different license.
If you'd like, I can also:
- Add usage examples for each command with expected output.
- Create a
.npmignoreto excludetoken.jsonand other sensitive files. - Run
npm publish --dry-runfor you (you'll need to authenticate locally or provide a token).
File: README.md
