Running Asterobot without a command starts it, as you do every day. The same program also has commands for jobs you can do without Asteroboard: listing and downloading game versions, managing the library, and resetting settings or the cache.
Run a command
Commands run in a terminal, from the folder where you put Asterobot:
- Windows: open PowerShell in that folder and type
.\asterobot.exe, then the command and its options. - macOS and Linux: open a terminal in that folder and type
./asterobot, then the command and its options.
Commands come in groups, one for each part of Asterobot they work on: gamemanager for game versions, library for packages, config for settings and cache for the cache folder. You type the group, then the command. For example, to list your game versions:
.\asterobot.exe gamemanager list
./asterobot gamemanager list
The examples below use ./asterobot. On Windows, write .\asterobot.exe instead.
Options start with two hyphens and take a value after a space: --version latest. Put quotes around a value that contains spaces or special characters, such as a regular expression.
Every command first prints the same line as a normal start, with Asterobot's version, then does its job. A command that takes a while, such as a download, shows a progress bar, and Ctrl+C interrupts it. When a command fails, it prints a line with asterobot execution failed, followed by the reason.
When the command line itself is wrong, nothing happens: Asterobot prints a line with Incorrect usage:, followed by the mistake.
| Mistake | What follows Incorrect usage: |
|---|---|
| A group that doesn't exist | unknown command "gamemanger". Did you mean "gamemanager"? |
| A command the group doesn't have | No help topic for 'lst'. Did you mean "list"? |
| A required option left out | Required flag "version" not set, after the command's options are listed |
Help and version
| Type | To get |
|---|---|
./asterobot --help or ./asterobot -h |
The list of groups, then the folder options with this computer's default folders. |
./asterobot gamemanager or ./asterobot gamemanager --help |
The commands of one group. |
./asterobot gamemanager download --help |
The options of one command, then the folder options under GLOBAL OPTIONS. |
./asterobot --version or ./asterobot -v |
The version, on a line that reads Asterobot version followed by the number. |
Choose the folders
Asterobot keeps its files in three folders, one for its settings, one for its data and one for its cache (Files and folders). An option puts each of them somewhere else, for a normal start as for any command:
| Option | Environment variable | Folder |
|---|---|---|
--config-dir |
ASTEROBOT_CONFIG_DIR |
The settings folder, with config.toml |
--appdata-dir |
ASTEROBOT_APPDATA_DIR |
The data folder: bots, Ankama accounts, packages and the rest of your data |
--cache-dir |
ASTEROBOT_CACHE_DIR |
The cache folder: game versions and everything else that can be downloaded again |
For example, to keep the game versions on another disk:
./asterobot --cache-dir /mnt/games/asterobot-cache
Asterobot uses the folder you give as it is, without adding a subfolder, and creates it when it's missing. A relative path starts from the folder the terminal is in. The option can come before or after the command, as in ./asterobot gamemanager list --cache-dir /mnt/games/asterobot-cache. An environment variable works like its option for every run that sees it, and the option wins when both are set.
Asterobot doesn't remember these folders. A run without the option or its environment variable uses the default folder, so give the same folders to every start and every command: a game version downloaded with --cache-dir only shows in Game Manager when Asterobot starts with the same cache folder.
The three folders have to stay apart, and away from your home folder, since cache reset deletes everything in the cache folder. Before it runs anything, Asterobot refuses these folders with a line with Incorrect usage::
| Folders | What follows Incorrect usage:, for example |
|---|---|
| Two options with the same folder, or one option's folder inside another's | --appdata-dir and --cache-dir must be separate folders, neither inside the other: /data and /data/cache |
| Your home folder, or a folder that contains it | --cache-dir can't be your home folder or a folder that contains it: /home/me |
| An empty value, such as an environment variable set to nothing | --cache-dir needs a folder |
All commands
| Command | What it does | In Asteroboard |
|---|---|---|
server |
Starts Asterobot. Same as running it without a command. | |
gamemanager list |
Lists the game versions Asterobot knows. | Game Manager |
gamemanager registry |
Lists the game versions Ankama's download servers offer. | |
gamemanager download |
Downloads a game version. | Download a game |
gamemanager verify |
Checks a version's files and downloads again the ones that don't match. | Verify files |
gamemanager remove |
Deletes a game version. | Delete |
gamemanager chunks verify |
Checks every stored chunk. | Check all chunks |
gamemanager chunks clear |
Deletes every stored chunk. | Remove all chunks |
library list |
Lists the packages in your library. | Library Manager |
library install |
Installs a package from a folder. | Import a .zip |
library remove |
Removes one package version. | Remove |
config reset |
Puts every setting back to its default. | Reset all on Server > Config |
cache reset |
Deletes Asterobot's cache folder. |
While Asterobot is running
A command works on the same files as Asterobot when both use the same folders, and an Asterobot already running in another terminal isn't told what a command changed. A game version downloaded with gamemanager download, for example, only appears in Game Manager after Rescan or a restart (Manage game versions).
To stay on the safe side, stop Asterobot before you run a command that changes files, and start it again afterwards. For cache reset, stopping it first is a must.
Game versions
The commands that name a version take the same four options, and all four are required:
| Option | What to give | Example |
|---|---|---|
--game |
The game's code | dofus |
--environment |
The environment | dofus3 |
--platform |
The platform | windows |
--version |
The version number | 3.6.11.13 |
These are the values the Game, Environment, Platform and Version columns of Game Manager show. Download a game version explains them.
gamemanager list
./asterobot gamemanager list
Prints a table of the game versions Asterobot knows, installed or not, one row per version: game, environment, platform, version and status, such as installed, downloading or failed.
GAME ENVIRONMENT PLATFORM VERSION STATUS
dofus dofus3 windows 3.6.11.13 installed
gamemanager registry
./asterobot gamemanager registry
Prints a table of the game versions found in the lists of Ankama's download servers that Asterobot keeps in its cache folder: game, environment, platform and version. How many lists are kept depends on cytrus.keepMostRecentIndexes (Settings reference).
gamemanager download
./asterobot gamemanager download --game dofus --environment dofus3 --platform windows --version latest
Downloads a game version and waits until it's done, with a progress bar. Besides the four options above:
| Option | What it does |
|---|---|
--version latest |
Downloads the newest version Ankama offers for that game, environment and platform. |
--file-filter |
A regular expression. Only the files whose path matches are downloaded. |
--fragment-filter |
A regular expression matched against the names of the parts Ankama splits a game into. Only the matching parts are downloaded. |
The command works differently from Download a game in two ways:
- Without
--file-filter, it downloads every file of the version, not only the ones a bot needs, which takes much more space. To download only what bots need, copy the pattern from the File filter (regex) field of Asteroboard's download dialog and give it to--file-filter, between quotes. - It doesn't extract game data. Extract the version from Game Manager afterwards (Extract game data).
gamemanager verify
./asterobot gamemanager verify --game dofus --environment dofus3 --platform windows --version 3.6.11.13
Checks the files of a version that are on disk against the list Ankama publishes, and downloads again the ones that don't match. It needs the exact version number: latest only works with gamemanager download. --file-filter and --fragment-filter narrow the check to part of the files, and never add files that weren't downloaded.
gamemanager remove
./asterobot gamemanager remove --game dofus --environment dofus3 --platform windows --version 3.6.11.13
Deletes a game version: its files and its extracted game data. Stored chunks stay, like with Delete in Game Manager. It prints Game removed, or fails with game is not installed when Asterobot doesn't know that version. Bots set to the version aren't checked: move them first (When Dofus updates).
gamemanager chunks verify
./asterobot gamemanager chunks verify
Reads every stored chunk and deletes the ones whose content doesn't match, with a progress bar. It ends with All chunks have been validated!. A deleted chunk is downloaded again the next time a download needs it.
gamemanager chunks clear
./asterobot gamemanager chunks clear
Deletes every stored chunk, for every game and version, and prints Chunks removed. Your game versions keep working. The next download or check fetches the chunks it needs again, which makes it slower. Manage game versions explains chunks.
Packages
Note
The package commands also set up Asterobot's asterobot.net sign-in. If Asterobot isn't signed in, they print a sign-in link and may open it in your browser. You can ignore it: listing, installing and removing local packages doesn't need the sign-in.
library list
./asterobot library list
Prints a table of the package versions in your library, one row per version: name, version, provenance (local, community or official) and publisher.
library install
./asterobot library install --path ./my-harvester --name my-harvester --version 1.0.0
Installs a package from a folder on your computer. All three options are required:
| Option | What to give |
|---|---|
--path |
The folder that holds the package's .js or .mjs files, with index.js directly inside it, and its asterobot.json if it has one. |
--name |
The name the package gets in your library. A plain name, such as my-harvester, makes a local package. A name like @publisher:name makes it show Community, or Official with @asterobot:. |
--version |
The exact version, such as 1.0.0. |
It prints Package my-harvester@1.0.0 installed. When that name and version are already installed, the files are replaced. A missing option stops the command with an error such as Required flag "version" not set.
Script authors working with an external editor will find more in Zip files and the command line.
library remove
./asterobot library remove --name my-harvester --version 1.0.0
Removes one version of a package and prints Package removed. Both options are required. Unlike Remove in Library Manager, it doesn't warn you about bots set to that version or packages that depend on it.
Resets
Both resets delete things for good, so each one asks before it does anything. [y/N] at the end of the question means Enter alone answers no: type y or yes, then Enter, to go ahead. Any other answer stops the command with not confirmed, and nothing changes.
To answer yes in advance, for example in a script, add --yes after the command. Without --yes, a reset reads its answer from the terminal. When its input is a pipe or a file instead, it doesn't ask and stops with this command needs a confirmation: run it again with --yes, so piping y into it doesn't confirm anything.
A reset works on the folders of its own run. If you start Asterobot with folder options or their environment variables, give the reset the same folders.
config reset
./asterobot config reset
It asks Put every setting back to its default value? [y/N]. Once you confirm, it puts every setting back to its default and empties config.toml, printing Resetting the configuration.. then All configuration settings have been reset to their default values.
What you lose is everything you changed on Server > Config, including:
- Asterobot's asterobot.net sign-in: you'll confirm a new sign-in code.
- The network settings, such as
server.listenAddress,server.basicAuthandserver.tls, which go back to accepting connections from this computer only, without a password. - Your MITM ports, hosts and Dofus folder, and your automatic sign-in settings.
Your bots, Ankama accounts, packages and game versions are kept. If Asterobot is running, it reads the emptied file right away, as it does after a hand edit: it's signed out at once, and the settings that need a restart go back to their defaults at the next start.
cache reset
./asterobot cache reset
It asks Delete <folder> with everything in it? [y/N], with the full path of the cache folder in place of <folder>, so check that it's the folder you mean. Once you confirm, it deletes the cache folder with everything in it, then creates it again, empty, printing Resetting the cache.. then All cache have been removed.
What you lose: every game version, with its files and extracted game data, every stored chunk, Ankama's download lists, and the screenshots of failed automatic sign-ins. Bots set to a deleted game version are skipped when Asterobot starts, until you download and extract that version again. Your settings, bots, Ankama accounts and library stay, since their folders are never inside the cache folder.
Stop Asterobot before you run it.
Reset and start over helps you choose the right reset.