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

darwincli

v1.2.2

Published

The command line interface for Darwin

Downloads

5

Readme

Darwin Command Line Interface

Installing

Install this package by running:

npm install -g darwincli

or with yarn:

yarn global add darwincli

Setup & Credentials

You'll need to provide some credentials in order to use this command line interface. You can set the following as environment variables or you can create a file in your project directory called .env with the following content replacing ??? with your credentials:

DARWIN_CLIENT_ID=???
DARWIN_CLIENT_SECRET=???

To test and make sure darwincli is setup properly, run the command darwincli info. This will let you know if your credentials could be found and are proper.

Actions

Note that <param> means the parameter is required. Note that [param] means the parameter is optional.

Basic Actions

Basic actions used

- darwincli info

Used to test and make sure your client credentials are setup properly. Will show you an error if there is an issue and your client credentials are invalid.

Site

Commands for managing Darwin Websites

- darwincli site list

Lists out all of the sites for which you have access.

- darwincli site versions <siteID>

Lists out all of the versions of a particular site. You can use this to get the id of a specific version for rollabck.

- darwincli site rollback <siteID> <versionID>

Rollback your site to the specified version.

- darwincli site upload <siteID> <dir> [name] [description]

Uploads a new version of your website using the provided directory. Note that directory is relative to your current directory. Also, if name is unset then name and description will be taken from the last .git commit if the directory is under source control. If the project doesn't have source control and name is unset, then an error will occur. You can use a site.darwinignore file to list out the files you don't want uploaded for your site if any.

Developing This Package

This project uses yarn instead of npm. To develop for this app, you can run yarn start in place of darwincli and pass in arguments after like so -> yarn start info instead of darwincli info.

Once you have tested the app, you can install it globally by running:

yarn global add file:$PWD

This will install the app as its own command so now you can call darwincli {arguments}. Where {arguments} are the command line arguments you are passing to darwincli.

To remove the app globally, you can call:

yarn global remove darwincli

Project Structure

The yarn start command will transpile jsx files into js files placing them in bin/dist. You can look at the package.json entry for more details on how that works. If your file is not being transpiled look at the scripts->start entry for details (from now on, we will refer to .jsx files instead of .js files; know though that jsx files are never called, but are the files you should be editing as the js files are dynamically generated).

The entrypoint to the app is bin/sources/index.jsx. You'll see that this file is an index to other commands. Those commands are under /bin/sources/cmds. To create a new command, just create a new file under the cmds folder. info.jsx is a good example to copy. If your command is another index, look at site.jsx for a good example to copy as it indexes cmds/site_cmds files.

Publishing

To publish a new version of this package, run the command:

yarn publish

You'll be asked to provide a new package version and that's it! It's now available to the world. If you are not logged in, you can run yarn login or npm login whichever you prefer to login to npm for publishing.

Test Commands

The following is a command you can use to test uploading a new version of your website - make sure to replace x with some new number so you can tell the difference between sites:

yarn start site upload 4 /Users/Blane/Library/Mobile\ Documents/com~apple~CloudDocs/Darwin/Clients/InterfaceOp/Site\ Files/TestSiteX "cli-x" "Testing out the command line interface, should say version x"