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.
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.
-
Install the Ollama environment.
- This can be done by visiting https://ollama.com and following the download instructions.
- This can be done by visiting https://ollama.com and following the download instructions.
-
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.
- 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.
-
Use the run command to start the model.
-
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)
.
- 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)
.
-
Good to go.
Listed below are the commands that can be used to interact with the F2Read tool.
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.
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.
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
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
bun f2 --v OR bun f2 --version
Will return the current version of the CLI tool being used.
bun f2 --h OR bun f2 --help
Will reload this message. Any future commands or changes will be reflected here above.
bun f2 main.py
Produces a README.md file explaining the contents of main.py from the src folder
bun f2 examples/sample.py
Produces a README.md file explaining the contents of sample.py from the src/exmples/ folder
bun f2 examples/
Produces a README.md file explaining the contents of each file found inside of the src/examples/ folder
If you would like to have your commands loaded automatically through a configuration file, follow these steps:
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.
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.