f2read

1.0.2 • Public • Published

F2Read / Usage

This command line interface tool will help you to read 1 or multiple files and convert the contents into a READMe.md file explaining your code.


alt text


Initial Setup

To run the CLI interface, Ollama has to be installed to the system. This Tool runs off the Ollama provider, using any model of a user's choosing. By default the model will be set to Gemma2.

Steps

  1. Install the Ollama environment.
    • This can be done by visiting https://ollama.com and following the download instructions.

      alt text



  1. Select the model of your choosing.
    • Visit the models tab, or https://ollama.com/library, and choose a model that works for you. By default this tool uses Gemma2, you may choose that if you so wish.

      alt text



  1. Use the run command to start the model.
    • Open up a cmd prompt window and use the run command for the model of your choice.

      Example for Gemma2:

      alt text

      Usage:

      alt text



  1. Pull the repo and get files ready.

    • Once Ollama model is set up, clone or fork the repo and place any of your files inside the src folder or in the root folder (file names will need to be called with a prefix of ./ if placed in the root) .

  2. Good to go.

    • Once these steps have been completed and the model is running, you may run the command line interface tool. The commands and usage guide will be listed below.

    • To check if your Ollama model is running, type the command ollama ps.

      Example of usage:

      alt text



Commands

Listed below are the commands that can be used to interact with the F2Read tool.

CLI Tool

f2 <fl...>

  • bun f2 fileName


Running f2 with a following path to a file name will pass in the file and use the tool.

NOTE: If you are passing in a file, for example main.py, the tool will assume it is inside the src folder. Typing a dir name before the filename will also work, for example: 'examples/sample.py' which exists at 'f2read/src/examples/sample.py'. If filename has no path, program will check in src folder by default.

f2 <dir...>

  • bun f2 dirName


Running f2 with a directory name will pass in the directory and read all its files.

NOTE: If you are passing in a directory, for example 'examples/', the tool will assume it is inside the src folder. Any dir name outside of src will not work, the program will check in src folder by default.

--output filePath OR --o filePath

  • bun f2 fileName --output filePath.md


Adding the --output or --o tag as an option in the CLI call will allow for renaming of the output markdown file to the specified filename. File must be specified with .md

If README.md is not an issue for a file name, DO NOT include this tag

--model modelName OR --m modelName

  • bun f2 fileName --model llama2


Adding the --model or --m tag as an option in the CLI call will allow for specifying the model to be used for the prompt. Model must be a valid Ollama model to work.

If Gemma2 / Gemma2:2b is not an issue for a prompt model, DO NOT include this tag


Version

  • bun f2 --v OR bun f2 --version


Will return the current version of the CLI tool being used.


Help

  • bun f2 --h OR bun f2 --help


Will reload this message. Any future commands or changes will be reflected here above.


Example 1

  • bun f2 main.py


Produces a README.md file explaining the contents of main.py from the src folder

Example 2

  • bun f2 examples/sample.py


Produces a README.md file explaining the contents of sample.py from the src/exmples/ folder

Example 3

  • bun f2 examples/


Produces a README.md file explaining the contents of each file found inside of the src/examples/ folder


Config

If you would like to have your commands loaded automatically through a configuration file, follow these steps:

1. Create a configuration file

Go to your home directory and create a new file in there called F2READ-config.toml. Format it something like this:

model = "llama3.2"
output = "NAME.md"
tokenUsage = false
stream = true

It can contain variables of only the above: model, output, tokenUsage, and stream. They can be written in any order.

2. Enjoy

The program should take these values from your configuration file and use them. This way you don't have to type them on the command line each time.

Readme

Keywords

none

Package Sidebar

Install

npm i f2read

Weekly Downloads

1

Version

1.0.2

License

none

Unpacked Size

797 kB

Total Files

29

Last publish

Collaborators

  • cduarte3