An open API service indexing awesome lists of open source software.

https://github.com/devkcud/mess

mk reborn
https://github.com/devkcud/mess

Last synced: 6 months ago
JSON representation

mk reborn

Awesome Lists containing this project

README

          

# ๐Ÿงน mess

**mess** is your fast, friendly command-line helper for whipping up directories and files. It keeps your project neat-ish without arcane syntax or ceremony.

Compared to older tools like `mk`, mess is more intuitive, flexible, and built for actual humans (also fixed a ton of old bugs mk had).

## ๐Ÿš€ Usage

```sh
mess [-flags] <..|dir/|dir/file|file>[@|%]...
```

### ๐Ÿ“ Behavior Rules

- `dir/` โ†’ Creates a directory and adds it to the stack. Everything created afterward goes inside it.
- `file` โ†’ Creates a file in the current stack location.
- `dir/file` โ†’ Creates the specified directory and file, but does not push the directory to the stack.
- `..` โ†’ Pops the last directory off the stack. Back up one level like a well-behaved script.
- `@` โ†’ Defines the user of the directory or file. Example: `sudo mess dir@root/file@pato`
- `%` โ†’ Defines the octal permission of the directory or file. Example: `sudo mess dir%0555/file`

> Tip: You can mash everything together: `mess dir@pato%555/ file1@root file2@testuser projects%0/`

### ๐Ÿงฉ Flags

- `-h` or `--help`: The "what does this flag do?" menu.
- `-b ` or `--base `: Set the base working directory (default: your current pwd).
- `-d` or `--dry`: Dry run mode. No files harmed, just simulated structure.
- `-e` or `--echo`: Print out shell commands instead of creating anything. Similar to dry run, but less pretty.
- `--loglevel <0-4>`: How chatty should it be?
- `0`: ๐Ÿ˜ถ Error only
- `1`: โš ๏ธ Warnings
- `2`: โ„น๏ธ Info
- `3`: ๐Ÿ› Debug
- `4`: ๐Ÿงต Trace everything. Yes, everything. Almost.

## ๐Ÿ› ๏ธ Examples

### ๐Ÿ“„ Create a file

```sh
mess hello.txt
```

Drops `hello.txt` in the base directory. Easy.

### ๐Ÿ—‚๏ธ Nested directory + file

```sh
mess src/lib/components/Button.svelte
```

Creates `src/lib/components/` if it doesn't exist and create the file `Button.svelte`.

### โฌ…๏ธ Back up with ..

```sh
mess project/ docs/ README.md .. src/ index.js
```

Creates `project/docs/README.md`, goes up one level, and `project/src/index.js`.

Alternatively, you could simply do:

```sh
mess project/ docs/README.md src/index.js
```

Note: `dir/file` creates the file but does not push the directory to the stack.

### ๐Ÿซฅ Dry run

```sh
~ $ mess -d notes/ day-1.md day-2.md day-3.md
```

Sends you:

```
/home//notes/
โ”œโ”€โ”€ day-1.md
โ”œโ”€โ”€ day-2.md
โ””โ”€โ”€ day-3.md
```

### ๐ŸŽญ Echo mode

```sh
~ $ mess -e cli/ cmd/goon/main.go internal/ modules/download.go testing/framework.go .. pkg/utils/commands.go
```

Should spit out:

```sh
mkdir -p /home//cli/cmd/goon
mkdir -p /home//cli/internal/modules
mkdir -p /home//cli/internal/testing
mkdir -p /home//cli/pkg/utils
touch /home//cli/cmd/goon/main.go
touch /home//cli/internal/modules/download.go
touch /home//cli/internal/testing/framework.go
touch /home//cli/pkg/utils/commands.go
```

## โœจ Why mess?

Because file and folder creation should be fast, flexible, and slightly entertaining. **mess** helps you build structure without building a headache.

## ๐Ÿ“œ License

[The Unlicense](LICENSE): use it, break it, improve it. No strings attached.