Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/fdncred/nu_plugin_file
A nushell plugin that will inspect a file and return information based on it's magic number.
https://github.com/fdncred/nu_plugin_file
nushell nushell-plugin
Last synced: 4 months ago
JSON representation
A nushell plugin that will inspect a file and return information based on it's magic number.
- Host: GitHub
- URL: https://github.com/fdncred/nu_plugin_file
- Owner: fdncred
- License: mit
- Created: 2023-08-09T16:19:25.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2024-03-09T23:41:06.000Z (4 months ago)
- Last Synced: 2024-03-10T00:32:52.873Z (4 months ago)
- Topics: nushell, nushell-plugin
- Language: Rust
- Homepage:
- Size: 74.2 KB
- Stars: 6
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Lists
- awesome-nu - nu_plugin_file
README
# nu_plugin_file
This nushell plugin will open files to inspect them and report back a little information. It uses magic bytes to determine many file formats. The core code was "borrowed" from a [spacedrive](https://github.com/spacedriveapp/spacedrive/tree/main/crates/file-ext) crate that I thought looked interesting.
## Usage:
```nushell
❯ help file
View file format informationUsage:
> fileFlags:
-h, --help - Display the help message for this commandParameters:
filename : full path to file name to inspectExamples:
Get format information from file
> file some.jpg
╭──────────────┬──────────╮
│ description │ Image │
│ format │ jpg │
│ magic_offset │ 0 │
│ magic_length │ 2 │
│ magic_bytes │ [FF, D8] │
╰──────────────┴──────────╯
```## Installation
1. clone repo `git clone https://github.com/fdncred/nu_plugin_file.git`
2. install with cargo `cargo install --path .`
3. register with nushell `register /path/to/nu_plugin_file`
4. inspect a file `file some.jpg`