https://github.com/jhen0409/redux-dispatch-cli
A CLI tool for Redux remote dispatch. Used in remote-redux-devtools
https://github.com/jhen0409/redux-dispatch-cli
Last synced: 6 days ago
JSON representation
A CLI tool for Redux remote dispatch. Used in remote-redux-devtools
- Host: GitHub
- URL: https://github.com/jhen0409/redux-dispatch-cli
- Owner: jhen0409
- License: mit
- Created: 2016-04-20T08:24:26.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2016-05-03T21:36:15.000Z (over 9 years ago)
- Last Synced: 2025-01-12T01:22:31.555Z (9 months ago)
- Language: JavaScript
- Size: 8.79 KB
- Stars: 30
- Watchers: 6
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Remote Redux Dispatch CLI [](https://www.npmjs.com/package/redux-dispatch-cli)
> A CLI tool for Redux remote dispatch. Used in [remote-redux-devtools](https://github.com/zalmoxisus/remote-redux-devtools)
## Screenshot

## Installation
```bash
$ npm install -g redux-dispatch-cli
```## Usage
Use `redux-dispatch` or `rrd` command.
```bash
# Connect to remotedev-server
$ redux-dispatch connect --hostname --port# Show instance list
$ redux-dispatch ls-instance# Select instance
$ redux-dispatch select# Sync currently selected instance states to all instances
$ redux-dispatch sync# Dispatch action
$ redux-dispatch action "{ type: 'ACTION', ... }"# Start daemon (`connect` can also start daemon)
$ redux-dispatch start
# Restart daemon
$ redux-dispatch restart
# Stop daemon
$ redux-dispatch stop
# Check daemon status
$ redux-dispatch status
```Run `redux-dispatch --help` or `redux-dispatch --help` for more information.
## Steps
#### Connect to [remotedev-server](https://github.com/zalmoxisus/remotedev-server) (hostname default: `localhost`)
```bash
$ rrd connect --hostname --port
```It will create a daemon, the daemon process will exit when `$HOME/.remotedev_d_port` is removed.
#### Show available instances
```bash
$ rrd ls-instance
```Make sure have instance can dispatch action.
#### Select a instance (default: `auto`)
```bash
$ rrd select
```#### Dispatch action
```bash
$ rrd action "{ type: 'ACTION', a: 1 }"
```## Credits
* Remote store create from [zalmoxisus/remotedev-app](https://github.com/zalmoxisus/remotedev-app)
* Daemon inspired by [mantoni/eslint_d.js](https://github.com/mantoni/eslint_d.js)
* Used [chentsulin/react-native-counter-ios-android](https://github.com/chentsulin/react-native-counter-ios-android) as a example of screenshot## License
[MIT](LICENSE.md)