@wuwei-labs/srsly-cli
v1.0.4
Published
SRSLY Fleet Rental System CLI
Maintainers
Readme
SRSLY CLI
Command-line interface for managing fleet rentals on Solana.
Installation
Quick Install (Recommended)
curl -sSL https://raw.githubusercontent.com/wuwei-labs/srsly/main/cli/install.sh | bashManual Installation
Download the appropriate binary for your platform from the releases page.
Commands
Contract Management
Create Contract
Create a new rental contract for your fleet.
# Standard payment frequencies
srsly contract create --fleet <ADDRESS> --rate <AMOUNT> --max <DURATION> --pay <FREQUENCY>
# Examples:
srsly contract create --fleet ABC... --rate 100 --max 7d --pay daily
srsly contract create --fleet ABC... --rate 50 --max 30d --min 7d --pay weekly
# Custom cron expressions (when enabled)
srsly contract create --fleet ABC... --rate 25 --max 7d --cron "0 */3 * * *" # Every 3 hours
srsly contract create --fleet ABC... --rate 10 --max 30d --cron "0 9,17 * * *" # 9 AM and 5 PM dailyOptions:
-f, --fleet <ADDRESS>- Fleet address (required)-r, --rate <AMOUNT>- Rental rate per payment period in ATLAS (required)-x, --max <DURATION>- Maximum rental duration (e.g., 7d, 1w, 30d) (required)-n, --min <DURATION>- Minimum rental duration (defaults to 1 payment period)-p, --pay <FREQ>- Payment frequency: hourly, daily, weekly, monthly--cron <EXPR>- Custom cron expression (requires config update)--owner-profile <ADDRESS>- Star Atlas profile address
Note: The --max and --min durations are interpreted as the number of payment periods on mainnet. For example, with daily payments, --max 7d means 7 daily payments.
Schedule Management
Preview Payment Schedule
Preview when payments will occur for a given schedule.
# Preview standard frequencies
srsly schedule preview @daily --duration 7d
srsly schedule preview @hourly --periods 24
# Preview custom cron expressions
srsly schedule preview "0 */3 * * *" --duration 7d
srsly schedule preview "0 9,17 * * MON-FRI" --periods 10Options:
-d, --duration <TIME>- Duration to preview (default: 7d)-p, --periods <COUNT>- Number of periods to preview
Validate Cron Expression
Check if a cron expression is valid.
srsly schedule validate "@daily"
srsly schedule validate "0 */3 * * *"
srsly schedule validate "0 0 * * MON"Get Frequency Info
Show information about standard payment frequencies.
srsly schedule info daily
srsly schedule info hourlyRental Operations
Accept Rental
Accept a rental contract and start the rental period.
srsly rental accept --contract <ADDRESS> --duration <TIME>Cancel Rental
Cancel an active rental (requires sufficient notice period).
srsly rental cancel --contract <ADDRESS> --rental <ADDRESS>Configuration
View Config
srsly config showSet Config Values
srsly config set --network mainnet --keypair ~/.config/solana/id.jsonUtility Commands
Derive Addresses
# Derive contract address from fleet
srsly derive contract --fleet <ADDRESS>
# Derive rental address
srsly derive rental --contract <ADDRESS> --borrower <ADDRESS>Wallet Info
srsly wallet showPayment Schedules
Standard Frequencies
@hourly- Every hour on the hour@daily- Every day at midnight UTC@weekly- Every week@monthly- Every month (approximately 31 days)
Custom Cron Expressions
When enabled by the protocol administrator, you can use custom cron expressions:
"0 */3 * * *"- Every 3 hours"0 9,17 * * *"- At 9 AM and 5 PM daily"0 0 * * MON-FRI"- Midnight on weekdays"*/30 * * * *"- Every 30 minutes
Note: Custom cron expressions require:
- The
Custompayment frequency to be enabled in the protocol config - The antegen service to be upgraded with croner support
Environment Variables
SRSLY_NETWORK- Default network (mainnet, devnet)SRSLY_RPC_URL- Custom RPC endpointSRSLY_KEYPAIR_PATH- Path to keypair file
Examples
Create a Daily Rental Contract
# Create contract: 100 ATLAS per day, 7-30 day rentals
srsly contract create \
--fleet 8dCasgoyxi9iSitMS3g9G1Tafj77sfL7HatMzZfW3Q8N \
--rate 100 \
--min 7d \
--max 30d \
--pay dailyCreate a Custom Schedule Contract
# Create contract: 50 ATLAS every 3 hours, 5-20 payments
srsly contract create \
--fleet 8dCasgoyxi9iSitMS3g9G1Tafj77sfL7HatMzZfW3Q8N \
--rate 50 \
--min 5 \
--max 20 \
--cron "0 */3 * * *"Preview Payment Schedule
# See when payments will occur
srsly schedule preview "0 */3 * * *" --periods 10
# Output:
# Expression: 0 */3 * * *
# Total Payments: 10
# First Payment: 2024-01-15 3:00:00 AM
# Last Payment: 2024-01-16 6:00:00 AM
#
# Sample payment times:
# 1. 2024-01-15 3:00:00 AM
# 2. 2024-01-15 6:00:00 AM
# 3. 2024-01-15 9:00:00 AM
# 4. 2024-01-15 12:00:00 PM
# 5. 2024-01-15 3:00:00 PM
# ... and 5 moreNetwork Configuration
The CLI supports multiple networks:
mainnet- Solana mainnetdevnet- Solana devnetlocalhost- Local test validator
Set the network:
srsly config set --network mainnetTroubleshooting
Common Issues
"Custom payment frequencies are not enabled"
- Custom cron expressions require protocol configuration update
- Contact the protocol administrator
"Invalid cron expression"
- Use
srsly schedule validateto check your expression - Ensure you're using quotes around the expression
- Use
"Duration must be a multiple of payment frequency"
- This only applies to standard frequencies on older contracts
- Mainnet contracts use payment periods instead of seconds
Support
For issues and feature requests, visit: https://github.com/wuwei-labs/srsly/issues
