# FlavorCLI
[](https://www.rust-lang.org/ "Go to Rust homepage")
[](https://www.gnu.org/licenses/gpl-3.0.en.html "GNU GPL 3.0")
[](https://hackatime.hackclub.com/ "Go to Hackatime homepage")
[](https://github.com/Lordseriouspig/flavorcli/commits/main/ "Commit History")
[](https://github.com/Lordseriouspig/flavorcli/commits/main/ "Commit History")
[](https://github.com/Lordseriouspig/flavorcli/actions/workflows/rust-clippy.yml)
> [!CAUTION]
> FlavorCLI *only kinda works* as of right now. I'm still working on writing some more commands and am still waiting on some more API routes to be added. Right now there's only read routes available.
FlavorCLI is a fully-featured implementation of the Flavortown API, allowing for easier and streamlined interaction with HackClub's Flavortown.
## Installation
### Prebuilt (Recommended)
At some point, FlavorCLI will be available on all[^1] major package managers.
#### GitHub Releases
To download and install precompiled binaries from GitHub, follow these steps:
1. Download the ZIP file for your platform
2. Unzip the contents
3. Inside, you will see the precompiled binary, plus this readme, a copy of the licence, and an installer and uninstaller script for convience.
4. (Optional) Execute the installer script.
1. If you are on windows, run ``powershell.exe -ExecutionPolicy Bypass -File "install-win.ps1"``
2. If you are on linux, run ``chmod +x install-linux.sh``
3. Actually run the script
4. This will move the binary to a bin directory and add it to PATH, so you can type ``flavor`` to run the app at any time.
5. Keep the uninstall script handy for once flavortown ends.
: What that constitutes is unknown to me, *I'll figure it out when it's timeā¢*
#### Cargo
If you have cargo, you may choose to install FlavorCLI with the following command:
```
cargo install flavorcli
```
Ensure you have the cargo install directory in your PATH.
### Build it yourself
1. Download the source code or git clone the repo
2. Download and install rust if it is not already installed
3. Run ``cargo build -r``
4. Run ``cargo install --path .``
5. Ensure you have your cargo's install directory (usually ``~/.cargo/bin``) in PATH
6. Profit!
: What you do is up to you, just get a copy of the code
## Usage
### Get your API key
1. To get your Flavortown API key, go to https://flavortown.hackclub.com/kitchen and do all the things to get yourself signed in.
2. Click the gear icon in the toolbar to open your settings

3. Copy your API Key

4. Get your User ID. Either hover over the link, and note down the number that shows, or click on the link and note the number in the URL bar.

5. Run ``ft auth set <USER_ID> <TOKEN>``
: You can use ``ft auth delete`` at any time to delete your API Key. Your API Key is stored on device with your device's keychain. If you want to set auth for each command, add the ``--auth <APIKEY>`` flag
### Using the commands
Uhm, just use ``ft --help`` ig. (TODO: write proper guides on how to use the commands that definitely exist)
## Features
* Stores and verifies your API Key in your OS' keychain when using ``ft auth set <USER_ID> <TOKEN>``.
* Get and list projects
* Get and list devlogs
* Get and list store items
* Get and list users
### Planned Features
- [x] Actually *have* commands
- [x] Make those commands reflect what can be done with the API, add **more**
- [x] Authorization with Flavortown.
- [x] API Key storage with keychain.
- [x] Actually handle the commands lol.
- [x] API Implementation
- [ ] The rest is dependant on what additions are made to the API
- [ ] Also a few flags are planned, i've marked them in comments and cannot be bothered to write them here haha