Overwolf CLI
Description
The Overwolf CLI is a tool to help you manage your Overwolf Applications. It's currently in early development, and we'll be adding more and more features over time.
Installation
$ npm i -g @overwolf/ow-cli
Usage
The CLI can be used from a terminal or from a node.js script.
Terminal
The CLI is comprised of commands divided into categories, or commands and sub-commands, if you will.
As of right now, we have 5 commands available:
-
config
: Configures the CLI. You will be prompted to enter your email (that you use to login to the Dev Console) and your API key (see below). Deprecates thedev config
command. -
opk pack
: Packs a folder into an OPK file. -
opk sign
: Signs an OPK. The app this OPK belongs to has to exist in the Dev Console and you must have permissions for it. Deprecates thedev sign-opk
command. -
opk upload
Uploads an OPK file to the Dev Console. The OPK must be valid, the app this OPK belongs to has to exist in the Dev Console, and you must have permissions for it. You can also upload to a test channel. -
client calc-uid
: Calculates an app's UID using its name and author.
You can always run the "help" command, ow help
, for a list of all available commands.
Also, if you're using a linux-based terminal (e.g git bash
), you could use autocomplete with <tab><tab>
. You might have to restart your terminal for the autocomplete to take effect.
From a Node.JS Script
If you install @overwolf/ow-cli
as a dependency in your node.js app. At your application's entry point, make sure you have the following lines:
import 'reflect-metadata';
import { OwCliContainer } from '@overwolf/ow-cli/bin';
OwCliContainer.init();
All of the available commands and their arguments can be found in '@overwolf/ow-cli/bin' as well. To get a command, use the OwCliContainer:
const signOpkCmd = OwCliContainer.resolve(SignOpkCommand);
Then, call the command's handler
method:
signOpkCmd.handler({ ... });
API Key
You can obtain your API key from the Dev Console. In the side navigation, go to Settings => Profile
, and there you'll see an option to revoke and regenerate your API key.
Pay attention! Revoking your API key means that the previous key will stop working immediately. Similar to a password, we could never recover your API key for you. With great power, comes great responsibility.
Credentials
Some actions in the CLI (signing and uploading, for now) require you to provide credentials. Your credentials are the email you use to sign in to the Dev Console, and your API key.
There are 2 ways to provide your credentials:
- The
config
command. As mentioned above, runningow config
(instead of the deprecatedow dev config
) will prompt you for your email and API key and store them locally in your user's root folder. - Environment variables. Whenever you run a command, you can specify
OW_CLI_EMAIL
andOW_CLI_API_KEY
using your operating system's syntax. Using this method will not store the credentials on your machine.