@apso/cli v0.1.6
Apso CLI
Prerequisites
You need to have setup access to Mavric's private NPM packages. Find out how here
Usage
$ npm install -g @mavric/apso-cli
$ apso COMMAND
running command...
$ apso (--version)
@mavric/apso-cli/0.0.26 linux-x64 node-v18.20.2
$ apso --help [COMMAND]
USAGE
$ apso COMMAND
...Local Development
Clone apso-cli on your machine. Navigate to the repo in your code editor and run the below commands
npm install
npm run build && npm linkThis will build the apso cli and make it available for use globally on your machine. Now make a new directory where you want to setup a new backend service. Run the below command in order to create a new service boilerplate. This will clone the apso-service-template from github.
Incase you face permission denied issue make sure that you have SSH key added in github and your local machine. Follow this link for SSH keys generation.
apso server new -n <project-name>Then navigate to the newly created service and update the apsorc file according to your project entities and relations.
Sample of apsorc files for both v1 and v2 are given in apso-cli code at "test/apsorc-json" so you can check it out in order to make sure that your apsorc file follows the right pattern.
For detailed examples of configuring complex relationships, especially ManyToMany and self-referencing patterns, see the Relationship Configuration Use Cases.
You can also provide the key "apiType" in the apsorc file e.g (Rest, Graphql) incase you want to generate the GraphQL backend by default it would be REST.
Install the npm modules before continuing further.
Now we will run the scaffold command which will generate the all the relevant modules for us.
apso server scaffoldDebugging
For debugging we would use the debug package so you need to import the package in file where you want to debug any code.
var debug = require("debug")("{name of your choice}");Then just add the debug statements wherever you want.
debug(`variable1 value is:`, variable1);Now inorder to see the debug output you need to run the cli in debug mode like this.
env DEBUG=\* ./bin/run server scaffoldSo we are setting the env variable DEBUG and then giving the path of the bin/run file and then next will be your cli commmand.
Note: Whenever you make a change you need to rebuild the cli before running it in order to reflect the changes.
npm run buildCommands
apso help [COMMANDS]apso pluginsapso plugins:install PLUGIN...apso plugins:inspect PLUGIN...apso plugins:install PLUGIN...apso plugins:link PLUGINapso plugins:uninstall PLUGIN...apso plugins:uninstall PLUGIN...apso plugins:uninstall PLUGIN...apso plugins update
apso help [COMMANDS]
Display help for apso.
USAGE
$ apso help [COMMANDS] [-n]
ARGUMENTS
COMMANDS Command to show help for.
FLAGS
-n, --nested-commands Include all nested commands in the output.
DESCRIPTION
Display help for apso.See code: @oclif/plugin-help
apso plugins
List installed plugins.
USAGE
$ apso plugins [--json] [--core]
FLAGS
--core Show core plugins.
GLOBAL FLAGS
--json Format output as json.
DESCRIPTION
List installed plugins.
EXAMPLES
$ apso pluginsSee code: @oclif/plugin-plugins
apso plugins:install PLUGIN...
Installs a plugin into the CLI.
USAGE
$ apso plugins:install PLUGIN...
ARGUMENTS
PLUGIN Plugin to install.
FLAGS
-f, --force Run yarn install with force flag.
-h, --help Show CLI help.
-v, --verbose
DESCRIPTION
Installs a plugin into the CLI.
Can be installed from npm or a git url.
Installation of a user-installed plugin will override a core plugin.
e.g. If you have a core plugin that has a 'hello' command, installing a user-installed plugin with a 'hello' command
will override the core plugin implementation. This is useful if a user needs to update core plugin functionality in
the CLI without the need to patch and update the whole CLI.
ALIASES
$ apso plugins add
EXAMPLES
$ apso plugins:install myplugin
$ apso plugins:install https://github.com/someuser/someplugin
$ apso plugins:install someuser/somepluginapso plugins:inspect PLUGIN...
Displays installation properties of a plugin.
USAGE
$ apso plugins:inspect PLUGIN...
ARGUMENTS
PLUGIN [default: .] Plugin to inspect.
FLAGS
-h, --help Show CLI help.
-v, --verbose
GLOBAL FLAGS
--json Format output as json.
DESCRIPTION
Displays installation properties of a plugin.
EXAMPLES
$ apso plugins:inspect mypluginapso plugins:install PLUGIN...
Installs a plugin into the CLI.
USAGE
$ apso plugins:install PLUGIN...
ARGUMENTS
PLUGIN Plugin to install.
FLAGS
-f, --force Run yarn install with force flag.
-h, --help Show CLI help.
-v, --verbose
DESCRIPTION
Installs a plugin into the CLI.
Can be installed from npm or a git url.
Installation of a user-installed plugin will override a core plugin.
e.g. If you have a core plugin that has a 'hello' command, installing a user-installed plugin with a 'hello' command
will override the core plugin implementation. This is useful if a user needs to update core plugin functionality in
the CLI without the need to patch and update the whole CLI.
ALIASES
$ apso plugins add
EXAMPLES
$ apso plugins:install myplugin
$ apso plugins:install https://github.com/someuser/someplugin
$ apso plugins:install someuser/somepluginapso plugins:link PLUGIN
Links a plugin into the CLI for development.
USAGE
$ apso plugins:link PLUGIN
ARGUMENTS
PATH [default: .] path to plugin
FLAGS
-h, --help Show CLI help.
-v, --verbose
DESCRIPTION
Links a plugin into the CLI for development.
Installation of a linked plugin will override a user-installed or core plugin.
e.g. If you have a user-installed or core plugin that has a 'hello' command, installing a linked plugin with a 'hello'
command will override the user-installed or core plugin implementation. This is useful for development work.
EXAMPLES
$ apso plugins:link mypluginapso plugins:uninstall PLUGIN...
Removes a plugin from the CLI.
USAGE
$ apso plugins:uninstall PLUGIN...
ARGUMENTS
PLUGIN plugin to uninstall
FLAGS
-h, --help Show CLI help.
-v, --verbose
DESCRIPTION
Removes a plugin from the CLI.
ALIASES
$ apso plugins unlink
$ apso plugins removeapso plugins:uninstall PLUGIN...
Removes a plugin from the CLI.
USAGE
$ apso plugins:uninstall PLUGIN...
ARGUMENTS
PLUGIN plugin to uninstall
FLAGS
-h, --help Show CLI help.
-v, --verbose
DESCRIPTION
Removes a plugin from the CLI.
ALIASES
$ apso plugins unlink
$ apso plugins removeapso plugins:uninstall PLUGIN...
Removes a plugin from the CLI.
USAGE
$ apso plugins:uninstall PLUGIN...
ARGUMENTS
PLUGIN plugin to uninstall
FLAGS
-h, --help Show CLI help.
-v, --verbose
DESCRIPTION
Removes a plugin from the CLI.
ALIASES
$ apso plugins unlink
$ apso plugins removeapso plugins update
Update installed plugins.
USAGE
$ apso plugins update [-h] [-v]
FLAGS
-h, --help Show CLI help.
-v, --verbose
DESCRIPTION
Update installed plugins.