0.1.12 • Published 6 years ago

botfarm-cli v0.1.12

Weekly downloads
4
License
ISC
Repository
github
Last release
6 years ago

Botfarm CLI

Build Status

Like cron with superpowers. You can write scripts (or "bots") and tell them when to run. Botfarm takes care of setup, scheduling, and capturing logs.

  • ⏲️ Schedule: Configure bots to run at specific times or at intervals.
  • 📺 Console: Observe bots and explore outputs.
  • 📦 Git: Sync your own repos of bots with botfarm to make updates easier.
  • 🏃‍♀️ Easy: No setup required, just add some bots and you're done!

Having trouble? Submit an issue or ask Jason a question on twitter.

Install

  • npm install -g node-gyp
  • npm install -g botfarm-cli

Troubleshooting

Sometimes the install will fail on Linux environments with EACCES permission errors. To remedy this, you can re-install with the --unsafe-perm flag:

npm install -g --unsafe-perm node-gyp botfarm-cli


Get started in 2 steps

Once botfarm-cli is installed, botfarm can be accessed through the bots command.

1) Add a repo

Note: Make sure the repository can be cloned by the current machine. Invalid permissions will cause the add process to stall or fail.

To add a new repository of bots to botfarm, simply run (replace the url and name with your own):
bots repo add http://url-to-repo repo-name

2) Start the service

The background service must be running if you want bots to actually run. Start the service by running:
bots service start

Check if the service is running with:
bots service status

Stop the service by running:
bots service stop


Bot repo configuration

Botfarm isn't opinionated about the structure of repos. The only requirement is to have a botfile.js file in the root of the repo.

The botfile

Every repo should have a botfile in its root. A botfile is a simple JS file that tells botfarm what to run and when to run it. It exports a function that returns an object containing bots.

For example, let's say we have a repo containing two bots. One need's to be run every night at 12am, and the other runs on the hour every hour:

module.exports = () => ({
  'midnight-bot': {
    load: './run-me-at-midnight.js',
    autorun: '12am', // Tell the bot to run every midnight
  },

  'regular-bot': {
    load: './run-every-hour.js',
    autorun: ':00', // Tell the bot to run at every o'clock
  }
});

Autorun strings

Botfarm understands multiple time formats for autorun strings.

ExamplesMeanings
5 hours or 1 minute or 25 secondsRun the bot at specified intervals.
:10 or :45Run the bot at the same time every hour.
3:15pm or 8amRun the bot at a specific time every day.
2:30pm, 9pmRun the bot at 2:30pm and at 9pm every day.

The console

The botfarm console is the nerve center for your bots. With the console you can monitor the queue to see when bots are due. Monitor the history to see which bots ran successfully, which ones took a long time, and which ones failed. And see a stream of logs neatly organised by each bot.

Access the console by running:
bots console

The queue

Botfarm keeps an internal queue where it stores the time that each bot is next due to be run. To see the queue:
bots queue show

Sometimes you might want to manually rebuild the queue. To rebuild the queue, run:
bots queue rebuild


Remaning docs coming soon. See bin/cli.js for all commands.

Logs

Manually run a bot

Update bot repos

Delete a repo


Contributions are encouraged 😃

0.1.12

6 years ago

0.1.11

6 years ago

0.1.10

6 years ago

0.1.9

6 years ago

0.1.8

6 years ago

0.1.7

6 years ago

0.1.6

6 years ago

0.1.5

6 years ago

0.1.4

6 years ago

0.1.3

6 years ago

0.1.2

6 years ago

0.1.1

6 years ago

0.1.0

6 years ago

0.0.20

6 years ago

0.0.19

6 years ago

0.0.18

6 years ago

0.0.17

6 years ago

0.0.16

6 years ago

0.0.15

6 years ago

0.0.14

6 years ago

0.0.13

6 years ago

0.0.12

6 years ago

0.0.11

6 years ago

0.0.10

6 years ago

0.0.9

6 years ago

0.0.8

6 years ago

0.0.7

6 years ago

0.0.6

6 years ago