https://github.com/shobhit-nagpal/frmt
A CLI file format convertor for those who live in the terminal.
https://github.com/shobhit-nagpal/frmt
cli cli-tool file file-conversion file-converter go golang
Last synced: 5 months ago
JSON representation
A CLI file format convertor for those who live in the terminal.
- Host: GitHub
- URL: https://github.com/shobhit-nagpal/frmt
- Owner: Shobhit-Nagpal
- Created: 2023-12-27T03:12:04.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-05-21T11:53:01.000Z (over 1 year ago)
- Last Synced: 2024-05-22T05:21:10.909Z (over 1 year ago)
- Topics: cli, cli-tool, file, file-conversion, file-converter, go, golang
- Language: Go
- Homepage:
- Size: 16.8 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# About
frmt is a CLI format convertor for those who live in the terminal.It was built for my own convenience and thought it'd be cool to turn this into a tool that anyone can use.
Go was the first choice due to the ease of making CLI tools with the language.Pronounced as format.

# Installation
## 1. Install with Go
```shell
go install github.com/Shobhit-Nagpal/frmt@latest
```## 2. Install from Homebrew
### Tap the repo
``` shell
brew tap Shobhit-Nagpal/frmt
```
### Install frmt
```shell
brew install frmt
```
- To check the directory where frmt is installed:
```shell
which frmt
```
## 3. Install manually
### Clone repo
```shell
git clone git@github.com:Shobhit-Nagpal/frmt.git
```### Move binary to /bin directory
```shell
sudo mv frmt /bin/
```- Once the binary file has been moved to /bin/ directory, you can start using frmt as you'd like :)
# Uninstallation
## 1. With Homebrew
```shell
brew uninstall frmt
```
## 2. Manually
To remove the binary from your bin directory:
```shell
which frmt
``````shell
sudo rm $(which frmt)
```# Usage
To convert your file into another format, execute the following command:```shell
frmt -p -f
```- Converted file is created in your present working directory (aka where you executed the command)
- File paths can be relative and/or absolute
- Format flag is case insensitive- For information on flags, run
``` shell
frmt -h
```# Supported output formats
- PNG
- JPG / JPEG
- BMP
- TIF / TIFF# Working
The way frmt works is pretty simple.- First, it takes your file path and desired format as arguments/flags
- It converts the file path to an absolute path and then checks if the file exists
- If the file exists, it checks if the file is already present in the desired format
- If the file is not in its desired format, it creates a new file which is the converted format of the original file
- Error handling is done at each stage# To add:
- Give pdf as input and convert to desired format