fishctl/README.md

86 lines
2.8 KiB
Markdown
Raw Normal View History

2024-06-21 02:09:50 +09:00
# Firefish CLI tool
## Install and Update
### Install pre-built executable using [cargo-binstall](https://github.com/cargo-bins/cargo-binstall)
```sh
# If you don't have cargo-binstall, install it first
2024-06-21 08:55:11 +09:00
curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash
2024-06-21 02:09:50 +09:00
# Install pre-built executable
2024-06-21 02:14:32 +09:00
cargo binstall --locked --git https://firefish.dev/firefish/firefish-cli.git
2024-06-21 02:09:50 +09:00
```
You can update the package using the same command.
```sh
2024-06-21 02:14:32 +09:00
cargo binstall --locked --git https://firefish.dev/firefish/firefish-cli.git
2024-06-21 02:09:50 +09:00
```
2024-06-21 05:38:43 +09:00
### Download pre-built executable file
You can also download the pre-built executable file from the [release page](https://firefish.dev/firefish/firefish-cli/-/releases), but you need to manage/update the file on your own.
2024-06-21 02:09:50 +09:00
### Install from source
```sh
# Build from source
2024-06-21 02:14:32 +09:00
cargo install --locked --git https://firefish.dev/firefish/firefish-cli.git
2024-06-21 02:09:50 +09:00
```
You can update the package using the same command.
```sh
2024-06-21 02:14:32 +09:00
cargo install --locked --git https://firefish.dev/firefish/firefish-cli.git
2024-06-21 02:09:50 +09:00
```
### Use pre-built OCI image
2024-06-21 04:48:01 +09:00
Using the `registry.firefish.dev/firefish/firefish-cli` container image, `fishctl ___` commands can be executed as
2024-06-21 02:09:50 +09:00
```sh
2024-06-21 04:54:27 +09:00
docker run -it --rm --volume "$(pwd)":/firefish --network network_name \
2024-06-21 02:14:32 +09:00
registry.firefish.dev/firefish/firefish-cli \
2024-06-21 02:09:50 +09:00
fishctl ___
# or
2024-06-21 04:54:27 +09:00
podman run -it --rm --volume "$(pwd)":/firefish --network network_name \
2024-06-21 02:14:32 +09:00
registry.firefish.dev/firefish/firefish-cli \
2024-06-21 02:09:50 +09:00
fishctl ___
```
2024-06-21 08:52:05 +09:00
Where `network_name` is the network name on which the database is running. If you want to use this for the host network (i.e., use the container as if it were a locally installed command), you should replace `network_name` with `host`.
If you are using a container network (which is typically the case if you are using `docker-compose.yml` to run Firefish), you need to search for your network name by `docker network ls` or `podman network ls`:
2024-06-21 04:56:49 +09:00
```
$ podman network ls # the network name is `firefish_calcnet` in this case
NETWORK ID NAME DRIVER
0060ac847249 firefish_calcnet bridge
2f259bab93aa podman bridge
```
2024-06-21 02:09:50 +09:00
## Usage
Please make sure to `cd` to the Firefish local repository before running these commands.
2024-06-21 05:00:46 +09:00
### Update the config files
2024-06-21 02:09:50 +09:00
[The admin note](https://firefish.dev/firefish/firefish/-/blob/main/docs/notice-for-admins.md) may tell you that you need to update the config files. In such a case, please execute the following command.
```sh
2024-06-21 05:00:46 +09:00
fishctl config update
2024-06-21 02:09:50 +09:00
```
### Validate the config files
2024-06-21 13:16:16 +09:00
Execute the following command to validate the config files.
2024-06-21 02:09:50 +09:00
```sh
fishctl config validate
```
2024-06-21 13:16:16 +09:00
Note that this only performs a formal validation and does not check that the settings are appropriate. For example, this command does not check if the database password is correct.