StarRail
Honkai: Star Rail CLI Automation Package
Install / Use
/learn @ReZeroE/StarRailREADME
Honkai: Star Rail - starrail
<p align="center">
<img src="https://i.imgur.com/lE9hrlV.png" height="auto" alt="Centered Image"/>
</p>
Overview
The starrail package is a CLI (command-line interface) tool designed for managing and interacting with the game, Honkai: Star Rail, directly from your terminal.
Key Features:
-
Game Launch Control
- Start/Stop the game application directory from the terminal (skips launcher).
- Schedule the game to start/stop at any given time (i.e. 10:30AM).
-
Simple Automation
- Custom Macros: Record and playback recorded mouse + keyboard click sequences in-game.
- Uniform Click: Allows automatic uniform-interval mouse clicking (duration can be randomized).
-
Binary Decoding
- Web Cache: Access decoded web cache URLs containing information about pulls, events, and announcements.
- Streaming Assets: Access detailed client streaming asset information (read-only).
- Supplement Binary Decoder: Provides supplementary tools to decode any ASCII-based binary file.
-
Other Features
- Screenshots: Open the screenshots directory from the CLI without the game launcher.
- Official Pages: Open the official HoyoVerse web pages easily from the CLI.
<br/>[!NOTE]
Installation Requirements
- Windows 10 or later
- Python 3.7 or later
- Official Honkai: Star Rail Installation
Please review the CHANGELOG for the latest project updates and the developer's note for more information regarding the project overhaul.
<br/><br/>

Installation / Setup
STEP 1 - To Install the starrail package, run with admin permissions:
> pip install starrail==1.0.5
OR
> git clone https://github.com/ReZeroE/StarRail.git
> cd StarRail/
> pip install -e .
<br/>
STEP 2 - To configure the starrail module after installing, run:
> starrail configure
<br/>
STEP 3 - To verify that the installation was successful, run:
> starrail config
<br/>
<br/>[!NOTE] If you encounter any issues during the installation/setup process, visit this page for more help!
<br/>
Start CLI
The starrail package provides its own standalone CLI environment. You may access the CLI by running:
> starrail
This will bring up the StarRail CLI environment where all the commands can be executed without the starrail prefix.

The StarRail CLI environment facilitates efficient execution of the package's supported commands (see Usage Guide section below). Although all commands can be executed directly outside of the CLI environment in any terminal, activating the StarRail CLI allows you to run commands without the starrail prefix.
[!NOTE]
Inside of the StarRail CLI:
> aboutOutside of the StarRail CLI (any terminal):
> starrail about
For this guide, all following commands will be shown as if the CLI environment has not been activated.
<br/><br/>
Usage Guide
Below is a brief overview of all the features supported by the starrail package. Each section includes a link to a full documentation page where each function is detailed comprehensively.
-
- About Package
- Version
- Author
- Repository
-
- Start Game
- Stop Game
- Schedule Start/Stop
-
- Real-time Game Status
- Base Game Information
- Detailed Client Information
-
- Custom Automation
- Uniform Clicks
-
- Official Homepage
- Official Youtube Page
- Official HoyoLab Page
-
- Decoded Web Cache (events, pulls, announcements)
- Cached Pull History
- Supplementary Binary Decoder
-
- View Screenshots
- View Game Logs
For the entire list of commands available in the starrail package, run:
> starrail help
<br/>
1. Package Info
To see the general information about the starrail package, run:
> starrail about # Shows all information about the package
OR
> starrail version # Shows HSR and SR-CLI package version
> starrail author # Shows author information
> starrail repo [--open] # Shows repository link
<br/>
<br/>
2. Start/Stop & Schedule Game
To start, stop, or schedule the start or stop of Honkai: Star Rail, the following commands are provided.
☆ Start Game
To start Honkai: Star Rail, run:
> starrail start
<br/>
☆ Stop Game
To stop Honkai: Star Rail, run:
> starrail stop
<br/>
☆ Schedule Start/Stop
To schedule the start/stop of Honkai: Star Rail at a given time, you may use the scheduler supplied in the starrail package.
To view the scheduler's help panel, run:
> starrail schedule
Supported Scheduler Commands (see usage below)
- Show Schedule
- Add Schedule
- Remove Schedule
- Clear (remove all) Schedules
Example Command Description
---------------------------------------- ----------------------------------------------
starrail schedule add --time 10:30 --action start Schedule Honkai Star Rail to START at 10:30 AM
starrail schedule add --time 15:30 --action stop Schedule Honkai Star Rail to STOP at 3:30 PM
starrail schedule remove Remove an existing scheduled job
starrail schedule show Show all scheduled jobs and their details
starrail schedule clear Cancel all scheduled jobs (irreversible)
<br/>[!NOTE] For the full documentation on scheduling, visit this page.
<br/>
3. Game Configuration
To view Honkai: Star Rail's configuration as well as its detailed client information, several commands are provided.
☆ Real-time Game Status
To show the real-time status of the game while it's running, run:
> starrail status
HSR Status Details
------------- -------------------------------------
Status ✓ Running
Process ID 59420
Started On 2024-0x-xx 15:11:04
CPU Percent 1.3%
CPU Affinity 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15
IO Operations Writes: 247728, Reads: 580093
To show live game status non-stop, run with argument -l or --live:
> starrail status [-l|--live]
<br/>
☆ Base Game Information
To view the game's basic information configured under the starrail package listed below, run:
- Game Version
- Game Executable Location
- Game Screenshots Directory
- Game Logs Directory
- Game Executable SHA256
> starrail config
Title Details Related Command
------------------ ------------------------------------------------ --------------------
Game Version 2.3.0 starrail version
Game Executable E:\Star Rail\Game\StarRail.exe starrail start/stop
Game Screenshots E:\Star Rail\Game\StarRail_Data\ScreenShots starrail screenshots
Game Logs E:\Star Rail\logs starrail game-logs
Game (.exe) SHA256 2axxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx2c
<br/>
☆ Detailed Client Information
To view detailed information about Honkai: Star Rail, run:
- Client Version
- Client Datetime
- Client Detailed Version
- Application Identifier
- Service Entrypoint(s)
- Client Engine Version
- Other Information
> starrail details
Title Details (binary)
---------------------- --------------------------------------------------------
Version V2.3Live
Datetime String 20240607-2202
Detailed Version 7x02406xx-2xx2-V2.3Live-7xxxxx5-CNPRODWin2.3.0-CnLive-v2
Application Identifier com.miHoYo.hkrpg
Service Endpoints https://globaldp-prod-cn0x.bhsr.com/query_dispatch
Engine Version EngineReleaseV2.3
Other StartAsset
StartDesignData
dxxxxxxxxb
f4xxxxxxxxxxxxxxxxxxxxxxa7
<br/>
<br/>
4. Simple Automation
The starrail package supports two automation features to assist with the gameplay of Honkai: Star Rail.
☆ Custom Automation
This feature enables users to record a sequence of keyboard and mouse actions and replay them within the game. It is specifically optimized for Honkai: Star Rail, ensuring that all actions are only recorded and executed when the game is in focus, thereby preventing unintentional interactions with other applications.
To start, enter the following to bring up the help panel for automation:
> starrail automation
Example Command Description
-------------------------- ----------------------------------------------------
starrail aut
