From a0c60ad970a1409b1dc35291d39a69249c93f8ee Mon Sep 17 00:00:00 2001 From: Shinsuke Sugaya Date: Sun, 24 Aug 2025 11:07:52 +0900 Subject: [PATCH] Refactor installation docs and bump version to 0.2.0.dev --- README.md | 98 ++++++++++++++++++++++++++++++-------------------- pyproject.toml | 4 +-- 2 files changed, 61 insertions(+), 41 deletions(-) diff --git a/README.md b/README.md index 520430c..44050dd 100644 --- a/README.md +++ b/README.md @@ -13,75 +13,95 @@ Fess is an open-source enterprise search server based on OpenSearch. (Currently under development, more features and improvements are on the way. Stay tuned for updates!) -## Installation +## Installation and Usage -### Requirements +There are three ways to use fessctl: -- Python 3.13+ -- [`uv`](https://github.com/astral-sh/uv) (recommended for environment setup) +### Method 1: Using Pre-built Docker Image -### Setup +The easiest way to get started is using the pre-built Docker image: ```bash -git clone https://github.com/your-org/fessctl.git -cd fessctl -uv venv -source .venv/bin/activate # or .venv\Scripts\activate on Windows -uv pip install -e src +docker run --rm \ + -e FESS_ENDPOINT=https://your-fess-server \ + -e FESS_ACCESS_TOKEN=your_access_token_here \ + -e FESS_VERSION=15.1.0 \ + ghcr.io/codelibs/fessctl:0.1.0 --help ``` -## Run CLI +Run actual commands: ```bash -fessctl --help -``` - -### Example Commands +docker run --rm \ + -e FESS_ENDPOINT=https://your-fess-server \ + -e FESS_ACCESS_TOKEN=your_access_token_here \ + -e FESS_VERSION=15.1.0 \ + ghcr.io/codelibs/fessctl:0.1.0 ping -```bash -export FESS_ACCESS_TOKEN=... -export FESS_VERSION=15.1.0 -fessctl ping -fessctl user list -fessctl webconfig create --name TestConfig --url https://test.config.com/ +docker run --rm \ + -e FESS_ENDPOINT=https://your-fess-server \ + -e FESS_ACCESS_TOKEN=your_access_token_here \ + -e FESS_VERSION=15.1.0 \ + ghcr.io/codelibs/fessctl:0.1.0 user list ``` -## Docker Build and Run +### Method 2: Building Your Own Docker Image -### Build Docker Image +Clone the repository and build the Docker image locally: ```bash +git clone https://github.com/your-org/fessctl.git +cd fessctl docker build -t fessctl:latest . ``` -### Run fessctl in Docker - -You need to provide the following environment variables when running: - -- FESS_ENDPOINT: The URL of your Fess server's API endpoint. (Default: `http://localhost:8080`) -- FESS_ACCESS_TOKEN: Your access token to authenticate with the Fess API. -- FESS_VERSION: Your Fess server version for API compatibility. (Default: `15.1.0`) - -Example: +Then run with your custom image: ```bash docker run --rm \ -e FESS_ENDPOINT=https://your-fess-server \ -e FESS_ACCESS_TOKEN=your_access_token_here \ -e FESS_VERSION=15.1.0 \ - fessctl --help + fessctl:latest --help ``` -To run an actual command, for example: +### Method 3: Install from Source with pip + +For development or when you need to modify the source code: + +#### Requirements +- Python 3.13+ +- [`uv`](https://github.com/astral-sh/uv) (recommended for environment setup) +#### Setup ```bash -docker run --rm \ - -e FESS_ENDPOINT=https://your-fess-server \ - -e FESS_ACCESS_TOKEN=your_access_token_here \ - -e FESS_VERSION=15.1.0 \ - fessctl webconfig list +git clone https://github.com/your-org/fessctl.git +cd fessctl +uv venv +source .venv/bin/activate # or .venv\Scripts\activate on Windows +uv pip install -e src +``` + +#### Usage +```bash +export FESS_ACCESS_TOKEN=your_access_token_here +export FESS_ENDPOINT=https://your-fess-server +export FESS_VERSION=15.1.0 + +fessctl --help +fessctl ping +fessctl user list +fessctl webconfig create --name TestConfig --url https://test.config.com/ ``` +## Environment Variables + +All three methods require the following environment variables: + +- `FESS_ENDPOINT`: The URL of your Fess server's API endpoint (default: `http://localhost:8080`) +- `FESS_ACCESS_TOKEN`: Bearer token for API authentication (required) +- `FESS_VERSION`: Target Fess version for API compatibility (default: `15.1.0`) + ## License This project is licensed under the Apache License 2.0. diff --git a/pyproject.toml b/pyproject.toml index abf44c1..77c1bd8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "fessctl" -version = "0.1.0" +version = "0.2.0.dev" description = "CLI tool to manage Fess using the admin API" authors = [{ name = "CodeLibs, Inc.", email = "info@codelibs.co" }] requires-python = ">=3.13" @@ -33,4 +33,4 @@ requires = ["setuptools>=61.0.0", "wheel"] build-backend = "setuptools.build_meta" [tool.setuptools.packages.find] -where = ["src"] \ No newline at end of file +where = ["src"]