-
-
Notifications
You must be signed in to change notification settings - Fork 0
Using the CLI
Tooka's CLI is designed to be simple and intuitive. Here’s an overview of available commands and how to use them in your workflow.
| Command | Description |
|---|---|
add <YAML-file> |
Import a rule file |
remove <ID> |
Remove a rule by its ID |
toggle <ID> |
Enable or disable a rule |
list |
List all loaded rules |
export <ID> <path> |
Export a rule to a YAML file |
sort [OPTIONS] |
Apply active rules to files in a folder |
template [OPTIONS] |
Generate rule templates using predefined patterns |
config [OPTIONS] |
View or update Tooka’s configuration |
completions <shell> |
Generate autocompletion scripts for bash, zsh, fish, etc. |
-
Add rules:
tooka add my-rules.yaml
-
View all rules:
tooka list
-
Toggle specific rules (optional):
tooka toggle example_rule
-
Dry-run your folder:
tooka sort --dry-run ~/Downloads -
Generate a detailed report:
tooka sort --report=pdf
Tip
Rules are enabled by default after adding. Toggling is optional unless you want to temporarily disable one.
You can also temporarily override the configuration when sorting:
tooka sort \
--source=<folder> \
--rules=<comma-separated-rule-ids> \
--report=<pdf|csv|json> \
--output=<report-output-folder>-
Add a rule:
tooka add my-rule.yaml
-
List current rules:
tooka list
-
Remove a rule by ID:
tooka remove example_rule
-
Toggle a rule (enable/disable):
tooka toggle example_rule
Important
Rule IDs must be unique.
Use --overwrite to replace an existing rule:
tooka add my-rule.yaml --overwrite
Tooka supports generating autocompletions for various shells:
tooka completions bashPaste the result into your shell’s configuration file (e.g. ~/.bashrc, ~/.zshrc, or ~/.config/fish/config.fish).
You can override Tooka’s default paths using environment variables:
| Variable | Purpose |
|---|---|
| TOOKA_CONFIG_DIR | Path to config file |
| TOOKA_DATA_DIR | Path to data directory (rules, logs, etc.) |
| TOOKA_SOURCE_FOLDER | Default folder to scan with the sort command |
export TOOKA_CONFIG_DIR="$HOME/.config/custom-tooka"
export TOOKA_DATA_DIR="$HOME/.local/share/custom-tooka"
export TOOKA_SOURCE_FOLDER="$HOME/Downloads"Set these in your .bashrc, .zshrc, or equivalent to persist them across sessions.