2022-02-10 21:47:57 +00:00
# Python 3 library and CLI for [SporeStack](https://sporestack.com) [.onion](http://spore64i5sofqlfz5gq2ju4msgzojjwifls7rok2cti624zyq3fcelad.onion)
2022-04-14 01:44:54 +00:00
[Changelog ](CHANGELOG.md )
2022-02-10 21:47:57 +00:00
## Requirements
2023-02-07 19:42:49 +00:00
* Python 3.7-3.11 (or maybe newer)
2022-02-10 21:47:57 +00:00
## Installation
2023-05-12 20:05:38 +00:00
* `pip install sporestack` (Run `pip install 'sporestack[cli]'` if you wish to use the CLI features and not just the Python library.)
2022-04-01 01:08:12 +00:00
* Recommended: Create a virtual environment, first, and use it inside there.
2023-04-14 22:45:43 +00:00
* Something else to consider: Installing [rich ](https://github.com/Textualize/rich ) (`pip install rich`) in the same virtual environment will make `--help` -style output prettier.
2022-02-10 21:47:57 +00:00
2022-04-01 01:08:12 +00:00
## Running without installing
2022-02-10 21:47:57 +00:00
* Make sure `pipx` is installed.
2023-05-12 20:05:38 +00:00
* `pipx run 'sporestack[cli]'`
2022-04-01 01:08:12 +00:00
* Make sure you're on the latest stable version comparing `sporestack version` with git tags in this repository, or releases on [PyPI ](https://pypi.org/project/sporestack/ ).
2022-02-10 21:47:57 +00:00
## Usage
2022-04-01 01:08:12 +00:00
* `sporestack token create --dollars 20 --currency xmr # Can use btc as well.`
* `sporestack token list`
2023-05-12 20:05:38 +00:00
* `sporestack token info`
* `sporestack server launch --hostname SomeHostname --operating-system debian-11 --days 1 # Will use ~/.ssh/id_rsa.pub as your SSH key, by default`
2022-04-01 01:08:12 +00:00
(You may also want to consider passing `--region` to have a non-random region. This will use the "primary" token by default, which is the default when you run `sporestack token create` .)
2023-05-12 20:05:38 +00:00
* `sporestack server stop --hostname SomeHostname`
* `sporestack server stop --machine-id ss_m_... # Or use --machine-id to be more pedantic.`
* `sporestack server start --hostname SomeHostname`
* `sporestack server autorenew-enable --hostname SomeHostname`
* `sporestack server autorenew-disable --hostname SomeHostname`
2022-04-01 01:08:12 +00:00
* `sporestack server list`
2023-05-12 20:05:38 +00:00
* `sporestack server delete --hostname SomeHostname`
* `sporestack server remove --hostname SomeHostname # If expired`
2022-02-10 21:47:57 +00:00
## Notes
2022-04-01 01:08:12 +00:00
* If you want to communicate with SporeStack APIs using Tor, set this environment variable: `SPORESTACK_USE_TOR_ENDPOINT=1`
2022-02-10 21:47:57 +00:00
## Developing
* `pipenv install --deploy --dev`
* `pipenv run make test` (If you don't have `make` , use `almake` )
2023-02-07 19:42:49 +00:00
* `pipenv run make format` to format files and apply ruff fixes.
2022-02-10 21:47:57 +00:00
## Licence
[Unlicense/Public domain ](LICENSE.txt )