screepsmod-cli
v1.0.3
Published
Allows CLI commands to be executed via HTTP calls
Downloads
96
Readme
screepsmod-cli
This is heavily inspired by screeps-launcher's climod.
Testing
Spin up the Docker container:
docker compose up -d
Then try using curl to post a command:
docker compose run curl -X POST http://localhost:21028/cli -d 'help()'
Usage
If you want to be able to access the CLI endpoint from outside the container, set the host to 0.0.0.0
in your config (and make sure the port is exposed in your docker-compose):
cli:
host: 0.0.0.0
port: 21028
Then you can call it directly:
curl -X POST http://localhost:21028/cli -d 'help()'
To pass in a script (note the response will only include the return value of the last command):
curl -X POST http://localhost:21028/cli -d '@testScript.js'