2.0.0 • Published 8 years ago

ideman-cli v2.0.0

Weekly downloads
2
License
MIT
Repository
github
Last release
8 years ago

Identity Manager Command Line Interface Tool

Tool for creation of database schemas and others boring jobs usefull for ideman and ideman-acl node modules. It supports postgres, mysql, mariasql and sqlite3.

Summary

Installation

In your project root run from command line:

$ npm install -g ideman-cli

Usage

ideman-cli provides a set of interactive commands that can be used from command line:

$ ideman-cli <command> [arguments]

The availables commands are:

config

Initializes a configuration for database connection.

Example

$ ideman-cli config

tables

Initializes tables names.

Example

$ ideman-cli tables

reset

Resets all configurations to default.

Example

$ ideman-cli reset

list env

Shows a JSON object with current configurations.

Example

$ ideman-cli list [development|production]

env

Shows the current environment.

Example

$ ideman-cli env

switch

Switches environment.

Example

$ ideman-cli switch

init application

Initializes database schemas for specified application. If force was specified, tables will be dropped. If application was not specified, it takes the application value set into configuration.

Example

$ ideman-cli init [ideman|ideman-acl] [force]

insert entity

Inserts a new entity into database.

Example

$ ideman-cli insert [user|client|token|code|role|userRole|permission|resource|policy]

delete entity

Removes an existing entity from database.

Example

$ ideman-cli delete [user|client|token|code|role|userRole|permission|resource|policy]

import filename

Import entities from a JSON file. File to import must be in this format:

{
  "data": [
    {
      "entity": "user",
      "columns": {
        "username": "admin",
        "password": "$2a$05$Sbvj/0fQB/H/GaQZJg88iOP/ppZXTEtwCEF1Iff0hCt1t/PcJIfDa",
        "email": "admin@node.com",
        "firstName": "super",
        "lastName": "administrator"
      },
      "returning": "id"
    },
    {
      "entity": "client",
      "columns": {
        "name": "dashboard",
        "secret": "a1l4PsbkgQHgZzaN1lFQSw==",
        "description": "the dashboard client application",
        "domain": "localhost"
      },
      "returning": "id"
    }
  ]
}

Example

$ ideman-cli import [path]

cipher

Ciphers a text.

Example

$ ideman-cli cipher

decipher

Deciphers a text.

Example

$ ideman-cli decipher

crypt

Crypts a text.

Example

$ ideman-cli crypt

Credits

  • knex by Tim Griesser

License

The MIT License

Copyright (c) 2016 Michele Andreoli http://thinkingmik.com