From ba4bd785aafb3ff3d8a8170f1c8c307fc5ce45e7 Mon Sep 17 00:00:00 2001 From: tech Date: Wed, 18 Mar 2026 14:37:19 +0800 Subject: [PATCH] docs: update README with config file usage Replace command-line credential options and environment variables with config file documentation. Add the new `running` command and update all examples to use the required --server option. Co-Authored-By: Claude Opus 4.6 --- README.md | 44 +++++++++++++++++++++++++------------------- 1 file changed, 25 insertions(+), 19 deletions(-) diff --git a/README.md b/README.md index f38aaa5..afbb224 100644 --- a/README.md +++ b/README.md @@ -25,48 +25,54 @@ uv run zzpyjenkins --help ## Configuration -You can provide Jenkins credentials via command-line options or environment variables: +Create a config file at `~/.config/zzpyjenkins/config.toml` with your Jenkins server configurations: -### Command-line options (preferred) +```toml +[work] +url = "https://jenkins.work.com" +username = "myuser" +password = "my-api-token" -```bash -zzpyjenkins -u https://jenkins.example.com -U username -P token info +[home] +url = "http://localhost:8080" +username = "admin" +password = "admin123" ``` -### Environment variables - -```bash -export JENKINS_URL="https://your-jenkins-server.com" -export JENKINS_USERNAME="your_username" -export JENKINS_PASSWORD="your_api_token" # or JENKINS_TOKEN -``` +Use the `-s/--server` option to select which server to use. ## Usage ```bash # Show Jenkins server info -zzpyjenkins info +zzpyjenkins -s work info # List all jobs -zzpyjenkins list +zzpyjenkins -s work list # List jobs with filter -zzpyjenkins list -p "my-project" +zzpyjenkins -s work list -p "my-project" # Trigger a build -zzpyjenkins build my-job-name +zzpyjenkins -s work build my-job-name # Trigger a build with parameters -zzpyjenkins build my-job-name -p BRANCH=main -p ENV=staging +zzpyjenkins -s work build my-job-name -p BRANCH=main -p ENV=staging # Get build status -zzpyjenkins status my-job-name +zzpyjenkins -s work status my-job-name # Get specific build status -zzpyjenkins status my-job-name 123 +zzpyjenkins -s work status my-job-name 123 # Watch build progress -zzpyjenkins watch my-job-name +zzpyjenkins -s work watch my-job-name + +# List running jobs +zzpyjenkins -s work running + +# Show only count of running jobs +zzpyjenkins -s work running -c ``` ## Development