Skip to content

OleksandrKucherenko/chatgpt-translate-md

Repository files navigation

Translate with ChatGpt

Roadmap

version 1:

  • Support Markdown documents

version 2:

  • Support CSV documents
  • Support JSON documents
  • Support data extraction from different online sources:
    • Google Sheets
    • Gmail

version 3:

  • reinforce next chunk with a summary of the previous chunk

Developer Environment

# execute script to verify the environment
# (follow the script instructions)
.scripts/00-validate-local-env.sh

# use the latest YARN v3.x.x
yarn set version berry

# https://yarnpkg.com/features/plugins#official-plugins
yarn plugin import interactive-tools
yarn plugin import typescript
yarn plugin import workspace-tools
yarn plugin import version
yarn plugin import https://mskelton.dev/yarn-outdated/v3

# https://yarnpkg.com/getting-started/editor-sdks
yarn dlx @yarnpkg/sdks vscode

Secrets (or Sensitive Data)

RULE: keep all secrets in the .secrets directory.

RULE: Use .envrc to load secret into the environment variable.

RULE: secrets never left the local machine (exception CI/CD env variables).

How to get OpenAI API key?

You will need a commercial account with some credits to use the API.

How to Run?

# install dependencies first, before running the tool
yarn install

# get tool command line help
yarn cli --help

# get tool version
yarn cli --version

# run translation
yarn cli --cwd ./packages/translate-with-chatgpt \
  --source "**/*.md" \
  --ignore "**/node_modules/**" \
  --language Swedish \
  --token ${token}

# token can be injected via environment variable $OPENAI_API_TOKEN
# token can be placed into `.secrets/openai_api_token` file and DIRENV will load it

How to Publish?

As Homebrew package: https://bharathvaj.me/blog/how-to-publish-your-nodejs-project-on-homebrew

https://github.com/vercel/pkg

References

About

Command line tool for translating Markdown files to any supported by ChatGPT language

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published