xJonathanLEI / starkli

Starkli (/ˈstɑːrklaɪ/), a ⚡ blazing ⚡ fast ⚡ CLI tool for Starknet powered by 🦀 starknet-rs 🦀
https://book.starkli.rs
Apache License 2.0
155 stars 43 forks source link

feature request: profiles #42

Closed milancermak closed 6 months ago

milancermak commented 8 months ago

I use starkli for various projects and in various ways. In some cases, I have simple .sh scripts will all the settings. In others, I either have a long running shell session with the env vars exported (which is a PITA to setup again if I had to restart my OS) or passing some/all necessary args via the command line. In each case tho I use different config options to run starkli. These change on a per project basis.

I would appreciate a way to have the management of this simplified. I don't have a clear picture how this ought to look like, just curious if you'd be willing to add something like this. Maybe a STARKLI_PROFILE / --profile arg that would read all the rest of the config options (RPC, networks, account, private key, etc.) from a file? An integration with Scarb via a [tool.starkli] section in Scarb.toml would also be nice.

xJonathanLEI commented 6 months ago

Support for profiles is definitely nice to have. In fact, some very very initial support for this has just been added in https://github.com/xJonathanLEI/starkli/commit/27402da9028f087b3868205abce7a9c9b1f538e7 (where I replaced the "sequencer gateway fallback" with "random free RPC vendor"). The ultimate goal is to support different profiles, each with its own networks, RPC, accounts, address books, etc..

For network configs, you should be able to set RPC, compiler version/path, etc..

xJonathanLEI commented 6 months ago

Initial profiles support is now available in release v0.2.1. There's also a new Profiles page in the book.