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

para-cli

v1.21.0

Published

Command-line tool for Para backend servers

Downloads

221

Readme

Logo

Para Command-Line Interface (CLI)

NPM version Join the chat at https://gitter.im/Erudika/para

What is this?

Para was designed as a simple and modular backend framework for object persistence and retrieval. It helps you build applications faster by taking care of the backend. It works on three levels - objects are stored in a NoSQL data store or any old relational database, then automatically indexed by a search engine and finally, cached.

This is the command-line tool for interacting with a Para server.

Installation

npm install -g para-cli
para-cli setup
para-cli ping

Usage

                                 ________    ____
      ____  ____ __________ _   / ____/ /   /  _/
     / __ \/ __ `/ ___/ __ `/  / /   / /    / /
    / /_/ / /_/ / /  / /_/ /  / /___/ /____/ /
   / .___/\__,_/_/   \__,_/   \____/_____/___/
  /_/

  Command-line tool for Para backend servers

  Usage:
	  $ para-cli [command] [file]

	Commands:
	  setup                                  Initial setup, prompts you to enter your Para API keys and endpoint
	  apps                                   Returns a list of all Para apps
	  select <appid>                         Selects a Para app as a target for all subsequent read/write requests.
	  endpoints [add|remove]                 List and select Para server endpoints, add new or remove an exiting one.
	  create <file|glob> [--id] [--type]     Persists files as Para objects and makes them searchable
	  read --id 123 [--id 345 ...]           Fetches objects with the given ids
	  update <file.json|glob> ...            Updates Para objects with the data from a JSON file (must contain id field)
	  delete [glob] --id 123 ...             Deletes one or more objects from Para
	  search "query" [--limit --page --sort] Searches the Para index for objects given a query string
	  rebuild-index                          Rebuilds the entire search index
	  app-settings                           Returns all settings for the authenticated app
	  new-key                                Generates a new secret key and saves it to config.json
	  new-jwt                                Generates a new JWT super token to be used for app authentication
	  new-app <name> --name --shared         Creates a new Para app. Only works if you have the keys for the "root" app
	  delete-app <id>                        Deletes an existing Para app. Only works for child apps, not the "root" app
	  export                                 Exports all data from the app's table
	  import <file>                          Imports data from a previously exported ZIP archive
	  ping                                   Tests the connection to the Para server
	  me                                     Returns the JSON for the currently authenticated user or app

	Options:
	  --type          Sets the "type" field of an object
	  --id            Sets the "id" field of an object
	  --sanitize      Strips all symbols from input files
	  --accessKey     Sets the Para access key
	  --secretKey     Sets the Para secret key
	  --endpoint      Sets the URL of the Para server
	  --sort          Sets the field on which to sort search results
	  --desc          Descending sort for search results (default: true)
	  --page          Page number for search results, "all" will auto-paginate through all results
	  --limit         Limits the number of search results
	  --lastKey       Sets the last id for search-after pagination
	  --cwd           Sets the current directory - used for resolving file paths
	  --encodeId      By default all ids are Base64 encoded, unless this is 'false'
	  --help          Prints the list of commands
	  --version       Prints the version of the program

	Examples:
	  $ para-cli setup
	  $ para-cli create my-blog-post.md
	  $ para-cli read --id my-blog-post.md
	  $ para-cli create index.html --type webpage --id "My new article" --sanitize
	  $ para-cli delete --id 123 --id "my-blog-post.md"
	  $ para-cli search "type:article AND title:*" --sort timestamp --desc false --limit 10
	  $ para-cli search "*" --type article --page all
	  $ para-cli new-key
	  $ para-cli new-app "mynewapp" --name "Full app name"
	  $ para-cli apps
	  $ para-cli select scoold
	  $ para-cli endpoints

The tool supports basic CRUD operations on files and can also generate JWT 'super tokens' or new secret keys for your app. You can use the CLI to upload multiple files, like blog posts, for example. The files can be HTML, text or JSON.

The plan is to add more functionality in the near future.

Configuration

Quick start:

para-cli setup

The configuration file is located in ~/.config/para-cli-nodejs/config.json and contains the keys used to authenticate with a Para server. The properties accessKey, secretKey and endpoint can be passed as arguments or loaded from the config file. Also you can choose to set the environment variables PARA_ACCESS_KEY, PARA_SECRET_KEY and PARA_ENDPOINT. The command-line arguments take precedence over environment variables, and if those are missing we read from config.json.

Here's an example config.json file:

{
  "accessKey": "app:para",
  "secretKey": "abc231234ufnX85123o1few==",
  "endpoint": "http://localhost:8080"
}

Once configured you can test your connection to the server:

para-cli ping

To get the currently authenticated app/user object run:

para-cli me

Switching between apps and endpoints

Para CLI can be configured to work with multiple Para servers and apps. Here's how to add additional Para server endpoints:

para-cli endpoints add

To select a specific endpoint run:

para-cli endpoints

After selecting the Para server you wish to connect to, you can list and select apps within it:

para-cli apps

Select the 'scoold' app, for example:

para-cli select scoold

Para Docs

Read the Docs

Contributing

  1. Fork this repository and clone the fork to your machine
  2. Create a branch (git checkout -b my-new-feature)
  3. Implement a new feature or fix a bug and add some tests
  4. Commit your changes (git commit -am 'Added a new feature')
  5. Push the branch to your fork on GitHub (git push origin my-new-feature)
  6. Create new Pull Request from your fork

For more information see CONTRIBUTING.md

License

Apache 2.0