Skip to content

Commit

Permalink
feat!: add ext option
Browse files Browse the repository at this point in the history
BREAKING CHANGE: deprecate --skip and use --avoidOverwrite instead
  • Loading branch information
tychenjiajun committed Sep 7, 2024
1 parent 07ceb1a commit 8d6af65
Show file tree
Hide file tree
Showing 11 changed files with 536 additions and 133 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Exif AI

![NPM Downloads](https://img.shields.io/npm/dw/exif-ai)
[![NPM Downloads](https://img.shields.io/npm/dw/exif-ai)](https://www.npmjs.com/package/exif-ai)

## About

Expand Down Expand Up @@ -43,7 +43,8 @@ Optional options:
- `--exif-tool-write-args <args...>`: Additional ExifTool arguments for writing metadata.
- `--provider-args <args...>`: Additional arguments for the AI provider.
- `-w, --watch <path>`: Watch directory for new files to process.
- `-s, --skip`: Skip if EXIF tags already exist in the file.
- `--avoid-overwrite`: Avoid overwriting if EXIF tags already exist in the file.
- `--ext <extensions...>`: File extensions to watch. Only files with this extensions will be processed.

Example usage:

Expand All @@ -68,8 +69,7 @@ const options = {
dry: false, // Optional: Perform a dry run without writing to the file
writeArgs: [], // Optional: Additional arguments for EXIF write task
providerArgs: [], // Optional: Additional arguments for the AI provider
skip: false, // Optional: Skip if EXIF tags already exist in the file
watch: false, // Optional: Watch directory for new files to process
avoidOverwrite: true,
};

execute(options)
Expand All @@ -96,7 +96,7 @@ Exif AI relies on API providers to generate image descriptions. Currently, we su
### Supported Providers

- ZhipuAI: A leading AI service provider. Requires an API key.
- Olama: A local AI service that runs on your machine, eliminating the need for an API key.
- Ollama: A local AI service that runs on your machine, eliminating the need for an API key.

### Custom Providers

Expand All @@ -106,7 +106,7 @@ You can also develop your own custom provider by implementing the provider inter

### Setting API Keys (for ZhipuAI)

To use ZhipuAI, you need to set the API key. You can do this by setting an environment variable:
To use [ZhipuAI](https://open.bigmodel.cn/usercenter/apikeys), you need to set the API key. You can do this by setting an environment variable:

```bash
export ZHIPUAI_API_KEY=your_zhipuai_api_key
Expand Down
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "exif-ai",
"version": "1.2.0",
"version": "2.0.0",
"description": "A Node.js CLI and library that uses Ollama or ZhipuAI to intelligently write image description to exif metadata by it's content.",
"homepage": "https://github.com/tychenjiajun/exif-ai",
"repository": {
Expand Down Expand Up @@ -46,15 +46,18 @@
},
"license": "GPL-2.0-only",
"dependencies": {
"@fluent/bundle": "^0.18.0",
"chokidar": "^3.6.0",
"commander": "^12.1.0",
"exiftool-vendored": "^28.2.1",
"iso-639-1": "^3.1.3",
"ollama": "^0.5.8",
"sharp": "^0.33.5"
},
"devDependencies": {
"@eslint/js": "^9.9.1",
"@types/node": "^22.5.1",
"del": "^7.1.0",
"eslint": "^9.9.1",
"eslint-plugin-n": "^17.10.2",
"eslint-plugin-promise": "^7.1.0",
Expand Down
Loading

0 comments on commit 8d6af65

Please sign in to comment.