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 🙏

© 2024 – Pkg Stats / Ryan Hefner

umbrel-cli

v0.5.1

Published

A small cli tool to help you create and maintain your umbrel apps

Downloads

101

Readme

umbrelCLI

Node.js CI

This is a small CLI tool to help you create and manage your own Umbrel apps.

Get started

npm install -g umbrel-cli@latest
umbrel --help

Features

  • 🛍️ Support for the official Umbrel App Store as well as Community App Stores
  • 🗺️ Guides you through the creation of an app or an Community App Store
  • 🕵️ Finds errors in your app manifests and compose files early
  • ⬆️ Uploads your app to your Umbrel to quickly test it

Documentation

umbrel appstore create <name>

This command initializes an App Store.

<name> is an optional name for the App Store directory. When left empty, you get asked to provide one.

umbrel appstore create

umbrel app create <name>

[!NOTE]
This command can only be executed inside an App Store directory!

This command scaffoldes a new app. It needs to be invoked from inside an App Store directory.

<name> is an optional name for the app directory. When left empty, you get asked to provide one.

umbrel app create

umbrel lint <name>

[!NOTE]
This command can only be executed inside an App Store directory!

This command checkes your App Store and all Apps inside it for potential errors.

If <name> is specified, the linter only lints the specified app. When left empty, all apps get linted.

These files are being checked:

  • Validity of umbrel-app-store.yml
  • Existence of README.me
  • Validity of <app>/umbrel-app.yml
  • Validity of <app>/docker-compose.yml
  • Existence of .gitkeep files in empty directories
  • (WIP) Validity of <app>/exports.sh

umbrel lint

umbrel port generate

This command generates a new and not yet used port to be used inside one of your apps. It checks against the ports from the official App Store and when executed from a Community App Store, also against those ports.

umbrel port generate

umbrel test <name>

[!NOTE]
This command can only be executed inside an App Store directory!

Options

| Option | Description | Default | | ------------------ | ------------------------------------------------- | -------------- | | -H, --host | Changes the host of your umbrel to connect to | umbrel.local | | -P, --port | Changes the port of your umbrel to connect to | 22 | | -u, --username | Changes the username of your umbrel to connect to | umbrel | | -p, --password | Sets the password of your umbrel to connect to | - |

This command connects to your umbrel and installs the app there. If the app is already installed, or a older version of the app is already present in the app store, it asks you if you would like to overwrite it.

TODO screenshot

Roadmap

  • [x] 🛍️ Creating a Community App Store / cloning the official Umbrel App Store
  • [x] 🗺️ Creating an app
  • [ ] ⬇️ Creating an update an app
  • [x] 🕵️ Linting apps and appstores
  • [x] 🧪 Testing an app

Run Umbrel OS

To test your Umbrel apps, you need to have a running Umbrel. You can either buy an Umbrel Home, install it on a Raspberry Pi 4 or newer (min. 4GB RAM) or on any x86 computer or install it in a virtual machine.

Library mode

You can use some parts of this CLI programatically.

  • umbrel lint:

    import {
      lintUmbrelAppYml,
      lintUmbrelAppStoreYml,
      lintDockerComposeYml,
      lintDirectoryStructure,
    } from "umbrel-cli/dist/lib.js";
    import fs from "node:fs/promises";
    
    const result = await lintUmbrelAppYml(
      await fs.readFile("path/to/umbrel-app.yml"),
    );
    console.log(result);

[!TIP] Please let me know via a GitHub Issue, if you want to see more CLI functions made accessible this way

Development

To build and run the Umbrel CLI, simply clone this repository and run the following commands:

npm install
npm run dev -- -- --help

Set up umbrelOS development instance

Using Multipass, you can easily and quickly set up umbrelOS for testing your apps and playing around. Keep in mind, that this version of umbrelOS is not intended to be used in a production environment, as it may contain additional bugs!

Prerequisites:

This method diviates from the official installation method in that it clones the repository inside the vm instead of on the machine. This is necessary to ensure that in Windows the correct +x flags are set and the line breaks (\n instead of \r\n) are correct.

# Feel free to bump the specs
multipass launch --name umbrel-dev --cpus 4 --memory 8G --disk 50G 23.10
# Fake the mount directory by creating it manually
multipass exec umbrel-dev -- sudo mkdir /opt/umbrel-mount
multipass exec umbrel-dev -- sudo chown ubuntu:ubuntu /opt/umbrel-mount
# Cloning instead of mounting ensures the correct +x flags are set and the line breaks (\n instead of \r\n) are correct
multipass exec umbrel-dev -- git clone https://github.com/getumbrel/umbrel.git /opt/umbrel-mount
multipass exec umbrel-dev -- /opt/umbrel-mount/scripts/vm provision

Record those fancy CLI screenrecordings

Prerequisites:

# Start the recording, stop the recording by exiting the terminal with "exit"
termsvg rec <command>.cast
# Convert the .cast to .svg
termsvg export <command>.cast