A CLI for creating Reactium / Actinium projects.
$ npm install -g reactium
$ reactium <command> [options]
Usage: reactium <command> [options]
Options:
-v, --version output the version number
-h, --help display help for command
Commands:
init [options] Initialize a new Reactium project
label [options] Label a directory for use in other commands.
update Update Reactium / Actinium in current directory.
commander [options] Create a CLI function.
config [options] Set ARCLI key:value pairs.
install [options] [name] Install an Actinium or Reactium Plugin.
list List arcli packages.
publish [options] Publish an Actinium or Reactium module.
uninstall <name> Uninstall an Actinium or Reactium Plugin.
Downloads and installs Reactium into the current working directory. If the directory is not empty, you will be prompted to overwrite it or cancel the operation.
$ reactium init
The config
reactium.repo
url is used when downloading Reactium. The configactinium.repo
url is used when downloading Reactium.
Detects if the current directory is Reactium or Actinium project. Downloads and installs Reactium or Actinium .core
and updates to the package.json
into the current working directory.
The current version of your project will be backed up to the .BACKUP
directory before update.
$ reactium update
Set or change configuration options.
$ reactium config --key 'reactium.repo' --value 'https://github.com/Atomic-Reactor/Reactium/archive/develop.zip'
The above would set the Reactium install package to the develop
branch.
--key, --value
The config object key. Use dot notation to access deeper keys in the config object.
The config object value. You can set array values by putting a space between each value.
$ reactium config --key 'toolkit.types' --value 'atom molecule organism template link page'
{
"prompt": {
"delimiter": "",
"prefix": "[ARCLI] > ",
"prefixColor": "cyan"
},
"commands": [
"[root]/commands", // Resolves to the ~/global/node_modules/ARCLI/commands directory. Used for global commands.
"[cwd]/.core/.cli/commands", // Resolves to the ~/project/.core/.cli/commands directory. Used for application core commands.
"[cwd]/.cli/commands" // Resolves to the ~/project/.cli/commands directory. Used for project specific commands.
"[cwd]/node_modules/**/.cli/commands" // Resolves to any .cli/commands directories in the ~/project/node_modules directory.
],
"reactium": {
"repo": "https://github.com/Atomic-Reactor/Reactium/archive/master.zip",
"types": [
"functional",
"class"
]
},
"actinium": {
"repo": "https://github.com/Atomic-Reactor/Actinium-2.0/archive/master.zip"
},
"registry": {
"app": "ReactiumRegistry",
"server": "https://v1.reactium.io/api"
},
"toolkit": {
"types": [
"atom",
"molecule",
"organism",
"template",
"link"
]
}
}
Create custom ARCLI commands.
$ reactium commander
You will be prompted for a destination and command name
--destination, --command, --overwrite
Path where the command is saved.
If you're creating a project specific command, use the shortcut: cwd/
when specifying the destination.
This is the recommended location for custom commands.
$ reactium commander --destination 'cwd/my/function'
The boilerplate code for a new ARCLI function will be created in the ~/.cli/commands/my/function
directory.
If you're creating an application specific command, use the shortcut app/
when specifying the destination.
Beware: Application specific commands are only suggested if you're contributing to the application and want those commands pushed out to future versions. For instance if you want to create a new Reactium or Actinium core command and plan on submitting a pull request for your new feature. Otherwise, they will be overwritten when you update your version of Reactium or Actinium.
$ reactium commander -d 'app/my/function'
The boilerplate code for a new ARCLI function will be created in the ~/.core/.cli/commands/my/function
directory.
If you're creating a new ARCLI command, use the shortcut root/
when specifying the destination.
Beware: Root commands are only suggested if you're contributing to ARCLI and plan on submitting a pull request for your new feature. Otherwise, they will be overwritten whenever you update your version of ARCLI.
$ reactium commander -d 'root/my/function'
The command prompt.
$ reactium commander --command fubar --destination 'cwd/fubar'
You can create a command that accepts parameters as well:
$ reactium commander --command 'fubar test'
Creates a command that would be run by entering the following: reactium fubar test
Create or replace a Reactium component.
$ reactium component
--name, --destination, --type, --type, --route, --redux, --redux-all, --actions, --actionTypes, --reducers, --services, --stylesheet, --overwrite
The component name. Used when importing the component.
Path of the component's parent directory.
If you're creating a component named Fubar
and specify components/
as the --destination
, the component will be saved to:
~/project/src/app/components/Fubar
The type of component to create.
Uses the config reactium.types
value for the list of types.
Default types: functional | class
Includes the route.js
file for a routed component.
Include _style.scss
file and import into a parent stylesheet.
Create a Reactium or Toolkit stylesheet.
$ reactium style -d 'cwd/public/assets/style' -f 'my-style.scss' -o
--destination, --filename, --overwrite
Path where the stylesheet is saved.
You can use the shortcut
components/
,common-ui/
, orcwd/
when specifying the destination.
The file name of the stylesheet.
Overwrite an existing version of the stylesheet.
Manage toolkit elements.
$ reactium element create
$ reactium element update
$ reactium element remove
If no flags are specified, you will be prompted to input corresponding values.
--id, --name, --group, --label, --menu-order, --stylesheet, --documentation, --code, --dna
The element ID. Used when indexing the element in the toolkit manifest file.
The element name. Used when importing the element into other components.
The group the element is apart of. Groups are how the toolkit menu structures elements.
The menu link text.
The menu link index relative to other elements in the group.
Add a stylesheet for the element.
Create a readme for the element and display it in the toolkit.
Show the Code View for the element.
Show the DNA info for the element.
Manage toolkit groups. Use this command to move things around in the toolkit manifest.
$ reactium group create
--id, --menu-order, --label, --overwrite
The group id.
The toolkit manifest index.
The menu item text label.
Overwrite the group object,
Downloads and installs Actinium into the current working directory. If the directory is not empty, you will be prompted to overwrite it or cancel the operation.
$ reactium init -t api
Actinium uses The Parse Platform and this command helps in creating new Parse.Cloud functions.
$ reactium cloud
--destination, --collection, --definitions, --beforeFind, --beforeDelete, --beforeSave, --afterSave, --afterDelete, --overwrite
Parent directory of the Cloud Function.
Actinium looks in the
~/src/app/cloud
directory for .js files and loads them as cloud functions. You can use thecloud/
shortcut when specifying the destination. Example:$ reactium element --destination 'cloud/my/function
will put the cloud function in the~/src/app/cloud/my/function
directory.
The database collection for before/after hooks.
// Use the Parse.User collection
$ reactium element --collection '_User'
Parse.Cloud.define() definitions.
$ reactium element --definitions 'userSave userDelete'
Note: you can specify multiple definitions by putting a space between values.
Include Parse.Cloud.beforeFind(COLLECTION) function.
Include Parse.Cloud.beforeDelete(COLLECTION) function.
Include Parse.Cloud.beforeSave(COLLECTION) function.
Include Parse.Cloud.afterDelete(COLLECTION) function.
Include Parse.Cloud.afterSave(COLLECTION) function.
See the Parse Cloud Guide for more information on Cloud functions.