Giter Club home page Giter Club logo

ignis's Introduction

IGNIS

Ignis is a simple Firebase/Firestore command-line tool that allows you to list, view, and copy collections and documents both within a project and between projects.

IMPORTANT: This tool will modify your Firestore database, please be careful and know what you are doing. Always make backups and double-check commands! This tool is intended for power users only.

INSTALLATION

npm install -g @d4lton/ignis

USAGE

Start ignis, optionally selecting the default project:

ignis [--project <project-id>]

COMMANDS

Once running, try help.

EXAMPLES

default > login my_firebase_config.json
<set the Firebase login keys for the current project>

default* > ls
<list of top-level collections in your default project>

default* > cat config/main
<JSON blob representing the contents of this document sent to stdout>

default* > cat config/main > some_file.json --pretty
(dumps contents of "config/main" to a local file named "some_file.json")

default* > $vi some_file.json
(opens vi to allow editing of some_file.json, note that "$" will execute any shell command)

default* > cat some_file.json > config/main
(dumps contents of local file named "some_file.json" to "config/main")

default* > cp config/main config/backup
(copies contents of "config/main" to "config/backup")

default* > use production
(switches project to "production")

production > login production_firebase_config.json

production* > cp default:config/main config/main
(copies "config/main" from the "default" project to "config/main" in the "production" project)

PROJECTS

When you first start ignis, you will be in the "default" project (unless you specified the --project command-line option).

The prompt will show you the current project, and you can switch to a new project with the project <project-id> command. Note that project-id is an arbitrary ID you create. Spaces aren't allowed in the ID, and it probably makes sense to have it match the project ID for your Firebase project.

Before you can do any operations on a project, you will have to log in with the login <firebase-config-json> file. This config will be cached under your ~/.config directory, so you don't have to log in every time you use ignis.

Any place you use a <path>, you can choose to specify a project ID. For example:

production > cp production:config/main staging:config/main

This will copy the config/main document in your production project to config/main in your staging project.

CONFIGURATION SECURITY

The configuration file is stored in ".config/com.basken.ignis/config.json" in your home directory, and is plaintext by default. If you want this file to be encrypted:

  • exit from ignis
  • delete .config/com.basken.ignis/config.json
  • set the IGNIS_ENCRYPTION_KEY environment variable to a 32 character (256 bit) AES-256 key
  • run ignis and set your projects up with use and login as before
  • the .config/com.basken.ignis/config.json config file should be encrypted

WARNING ABOUT CORE-JS

When ignis is installed, you will see a warning about core-js being deprecated. This is a package included by the firebase-admin module, and from what I understand, is harmless. The core-js package, while included in firebase-admin, is not actually used. Hopefully this unused package will be removed in the near future so the warning will go away.

ignis's People

Contributors

d4lton avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.