[go: up one dir, main page]

Skip to content
This repository has been archived by the owner on Aug 4, 2024. It is now read-only.
/ eggs Public archive

[archived] 🥚 Nest.land's Multipurpose CLI, forked and fixed (ish).

License

Notifications You must be signed in to change notification settings

deno911/eggs

Repository files navigation


Important

This project is archived and no longer maintained. In the v1.4x cycle, Deno introduced the JSR - "The JavaScript Registry" as the successor to deno.land/x, and since nest.land itself seems to be abandoned for quite a while now, this repository is now archived. All open issues and pulls were closed as wontfix. I recommend checking out JSR, and all the new capabilities that come with it.

Thanks for your understanding,
Nicholas Berlette

The CLI used to manage, update, and publish modules on nest.land.

Note: Since the official CLI is no longer maintained and doesn't work
with newer Deno versions, this unofficial
(and unstable) fork was born.

Contents

Installation

For more information on the Nest.land Registry, see the official documentation.

deno.land

deno install -Afq --unstable https://deno.land/x/eggs@0.3.50/cli.ts

nest.land

deno install -Afq --unstable https://x.nest.land/eggy0.3.50/cli.ts

Warning: You need to upgrade to Deno v1.25 or newer in order to use this version of CLI.

land · zero install

The land project is an ingenious solution for Command Line projects on Deno. It allows you to run any program with a cli.ts file, without having to install it first.

deno install -Afn land https://deno.land/x/land/cli.ts

Then this command is all you need to use the eggs CLI:

land eggs

The best part is never needing to upgrade - the latest version is always used.


Commands

completions

Generates shell completions for the eggs CLI in bash, fish, or zsh environments.

bash

# ~/.bashrc
source <(eggs completions bash)

fish

# ~/.config/fish/config.fish
source (eggs completions fish | psub)

zsh

# ~/.zshrc
source <(eggs completions zsh)

link

Before publishing a package to our registry, you'll need to get an API key. Visit nest.land to generate one.

Then, use the link command to add it to the CLI:

eggs link <key>

Alternatively, you can manually create a .nest-api-key file in your home dir.


init

The easiest path to publish a package on Nest.land is to create an egg.json or egg.yaml file at the root of your project. Otherwise you'll have to manually specify the project details via command line arguments every time you publish.

The good news is the eggs CLI comes with a built-in tool to help jump start your new projects!

eggs init

Note: If you'd like to specify a version that you'll publish to, you can include a version variable in egg.json.


install

Just like deno install, you can install scripts globally with eggs. By installing it this way, you will be notified if an update is available for your script.

The verification is smart, it can't be done more than once a day. To install a script, simply replace deno with eggs.

deno install --allow-write --allow-read -n [NAME] https://x.nest.land/[MODULE]@[VERSION]/cli.ts

Becomes:

eggs install --allow-write --allow-read -n [NAME] https://x.nest.land/[MODULE]@[VERSION]/cli.ts

The supported registries are the same as the update command.


publish

After you've filled in the information located in egg.json, you can publish your package to our registry with this command:

eggs publish

You'll receive a link to your package on our registry, along with an import URL for others to import your package from the Arweave blockchain!

Note: It may take some time for the transaction to process in Arweave. Until then, we upload your files to our server, where they are served for 20 minutes to give the transaction time to process.


update

You can easily update your dependencies and global scripts with the update command.

eggs update [...deps] [options]

Your dependencies are checked in the deps.ts file by default (current working directory). You can change this with the --file option.

eggs update # default to deps.ts
eggs update --file dependencies.ts

If you run this command with no arguments, all dependencies are updated.

You can pick and choose which to update by adding their name as arguments:

eggs update # Updates everything
eggs update http fs eggs # Updates only http, fs, eggs

Supported Registries

If you want to add a registry, open an Issue by specifying the Registry URL and we'll add it.

An example dependency file, prior to updating:

import * as colors from "https://deno.land/std@0.144.0/fmt/colors.ts";
import * as bcrypt from "https://deno.land/x/bcrypt@v0.2.0/mod.ts";
import "https://deno.land/x/this@0.153.0/mod.ts";

After eggs update:

import * as colors from "https://deno.land/std@0.159.0/fmt/colors.ts";
import * as bcrypt from "https://deno.land/x/bcrypt@v0.2.1/mod.ts";
import "https://deno.land/x/this@0.159.0/mod.ts";

upgrade

Upgrading the eggs CLI is pretty straightforward:

eggs upgrade

Contributing

All contributions are welcome! If you can think of a command or feature that might benefit nest.land, fork this repository and make a pull request from your branch with the additions. Make sure to use Conventional Commits. Please also read the Contribution Guide.