fishctl/README.md
2024-06-21 04:54:27 +09:00

72 lines
2.2 KiB
Markdown

# 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
# curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash
# Install pre-built executable
cargo binstall --locked --git https://firefish.dev/firefish/firefish-cli.git
```
You can update the package using the same command.
```sh
cargo binstall --locked --git https://firefish.dev/firefish/firefish-cli.git
```
### Install from source
```sh
# Build from source
cargo install --locked --git https://firefish.dev/firefish/firefish-cli.git
```
You can update the package using the same command.
```sh
cargo install --locked --git https://firefish.dev/firefish/firefish-cli.git
```
### Use pre-built OCI image
Using the `registry.firefish.dev/firefish/firefish-cli` container image, `fishctl ___` commands can be executed as
```sh
docker run -it --rm --volume "$(pwd)":/firefish --network network_name \
registry.firefish.dev/firefish/firefish-cli \
fishctl ___
# or
podman run -it --rm --volume "$(pwd)":/firefish --network network_name \
registry.firefish.dev/firefish/firefish-cli \
fishctl ___
```
If you are using a container network (which is typically the case if you using `docker-compose.yml` to run Firefish), you can search for your network name by `docker network ls` or `podman network ls`.
If you want to use this in the host network, you should use `host` as the network name.
## Usage
Please make sure to `cd` to the Firefish local repository before running these commands.
### Migrate the config files
[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
fishctl config migrate
```
### Validate the config files
To validate the config files, run the following command. 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.
```sh
fishctl config validate
```