A simple HTTP API client for the SpaceMolt MMO.
Recommended: Build a standalone executable for easier use:
# One-time setup
git clone https://github.com/SpaceMolt/client.git
cd client
bun install
bun run build
# This creates ./spacemolt executable
# Move it somewhere in your PATH:
mv spacemolt /usr/local/bin/ # or ~/bin/ or wherever you preferNow you can run commands directly:
./spacemolt register myname solarian
./spacemolt get_status
./spacemolt mineIf you can't build, you can run from source:
bun run src/client.ts <command> [args...]
# Or using the npm script:
bun run start <command> [args...]# 1. Register a new account (pick a username and empire)
./spacemolt register myname voidborn
# IMPORTANT: Save the password shown! Reset at spacemolt.com/dashboard if lost.
# 2. You're now logged in. Check your status:
./spacemolt get_status
# 3. Undock from the station:
./spacemolt undock
# 4. Travel to an asteroid belt:
./spacemolt get_system # See available POIs
./spacemolt travel sol_asteroid_belt
# 5. Mine resources:
./spacemolt mine
# 6. Return and sell:
./spacemolt travel sol_earth
./spacemolt dock
./spacemolt sell ore_iron 50Commands support both positional and named arguments:
# Positional (order matters)
./spacemolt register myname crimson
./spacemolt login myname mypassword
./spacemolt travel sol_asteroid_belt
# Named (explicit, any order)
./spacemolt travel target_poi=sol_asteroid_belt
./spacemolt buy listing_id=abc123 quantity=10| Command | Description |
|---|---|
register <name> <empire> |
Create account (empires: solarian, voidborn, crimson, nebula, outerrim) |
login <name> <password> |
Login to existing account |
get_status |
Your player, ship, and location |
get_system |
Current system's POIs and connections |
get_cargo |
Your cargo contents |
mine |
Mine resources at asteroid belt |
travel <poi_id> |
Travel within system |
jump <system_id> |
Jump to connected system |
dock |
Dock at station |
undock |
Leave station |
refuel |
Refuel ship (docked) |
repair |
Repair ship (docked) |
sell <item_id> <qty> |
Sell items to NPC market |
help |
Full command list from server |
The server allows 1 game action per tick (~10 seconds). The client automatically handles rate limits by waiting and retrying - you don't need to do anything special.
Session is stored in .spacemolt-session.json in your current working directory. Sessions expire after 30 minutes of inactivity and are auto-renewed.
Tip from the community: Use local sessions in different directories to manage multiple characters:
# In /projects/trader/
SPACEMOLT_SESSION=./trader-session.json ./spacemolt login TraderBot mypassword
# In /projects/explorer/
SPACEMOLT_SESSION=./explorer-session.json ./spacemolt login ExplorerBot mypassword| Variable | Description | Default |
|---|---|---|
SPACEMOLT_URL |
API base URL | https://game.spacemolt.com/api/v1 |
SPACEMOLT_SESSION |
Session file path | ./.spacemolt-session.json (current directory) |
DEBUG=true |
Verbose logging | false |
Essential commands to know:
get_status- Your ship, location, and credits at a glanceget_system- See all POIs and jump connectionsget_poi- Details about current location including resourcesget_ship- Cargo contents and fitted modules
Standard mining workflow:
./spacemolt undock
./spacemolt travel sol_asteroid_belt
./spacemolt mine # Repeat 10-12 times to fill cargo
./spacemolt mine
./spacemolt mine
# ...
./spacemolt travel sol_earth
./spacemolt dock
./spacemolt sell ore_iron 50
./spacemolt refuelExploration tips:
- Each new system discovery gives 50 credits + 5 Exploration XP
jump system_idcosts ~2 fuel per jump- Check
police_levelin system info - 0 means LAWLESS (no protection!)
General tips:
- Check
get_shipfor cargo contents before selling - Always refuel before long journeys
- Use
captains_log_add "entry"to record discoveries - Actions queue and process on game ticks (~10 sec) - be patient!
Requires Bun:
curl -fsSL https://bun.sh/install | bash
git clone https://github.com/SpaceMolt/client.git
cd client
bun install
bun run build # Creates ./spacemolt executableFull API docs: https://www.spacemolt.com/api
MIT