usage.mdx (1125B)
1 --- 2 title: "CLI Usage" 3 --- 4 5 import Copyright from "/snippets/copyright.mdx"; 6 7 ## 1. Encrypting code (`encode`) 8 9 Transforms a `.c` file into a `.mojic` file. You'll be prompted to create a password — it's required to decrypt. 10 11 ```bash 12 # Encrypt a single file 13 mojic encode main.c 14 15 # Encrypt an entire directory recursively 16 mojic encode ./src -r 17 18 # Flatten/minify code structure before encryption (removes newlines/indentation) 19 mojic encode main.c --flat 20 ``` 21 22 ## 2. Decrypting code (`decode`) 23 24 Restores the original C code from a `.mojic` file. 25 26 ```bash 27 # Decrypt a single file 28 mojic decode main.mojic 29 30 # Decrypt an entire directory recursively 31 mojic decode ./src -r 32 ``` 33 34 ## 3. Security & rotation tools (`srt`) 35 36 Manage encrypted files without ever revealing their plaintext contents. 37 38 ```bash 39 # Rotate password: changes the password of an encrypted file 40 mojic srt --pass secret.mojic 41 42 # Re-encrypt: re-shuffles the entropy (new salt) with the SAME password 43 # useful to change the visual emoji pattern without changing the password 44 mojic srt --re secret.mojic 45 ``` 46 47 Continue to [How It Works](/mojic/algorithm). 48 49 <Copyright />